@Override public long getLong(String key) { return Long.parseLong(get(key)); }
@Override protected List<ServiceConfiguration> createServiceConfigurations(Config config) { ServiceConfiguration serviceConfiguration = new ServiceConfiguration(); serviceConfiguration.setName(Constants.Email.CONF_TYPE_PROPERTIES); Map<String, String> confMap = new HashMap<>(); confMap.put(PARAM_HOST, config.get(Constants.Email.PROPERTY_KEY_HOST)); confMap.put(PARAM_PORT, String.valueOf((Integer) config.getAny(Constants.Email.PROPERTY_KEY_PORT))); confMap.put(PARAM_SSL, String.valueOf((Boolean) config.getAny(Constants.Email.PROPERTY_KEY_SSL))); confMap.put(PARAM_STARTTLS, String.valueOf((Boolean) config.getAny(Constants.Email.PROPERTY_KEY_STARTTLS))); confMap.put(PARAM_PROTOCOL, config.get(Constants.Email.PROPERTY_KEY_PROTOCOL)); confMap.put(PARAM_AUTH, String.valueOf((Boolean) config.getAny(Constants.Email.PROPERTY_KEY_AUTH))); ObjectMapper objectMapper = new ObjectMapper(); try { String json = objectMapper.writeValueAsString(confMap); serviceConfiguration.setConfiguration(json); } catch (JsonProcessingException e) { throw new RuntimeException(e); } return Collections.singletonList(serviceConfiguration); }
String subType = topologyData.getBundleIdToType().get(topologyProcessor.getTopologyComponentBundleId().toString()); if (TopologyLayoutConstants.JSON_KEY_CUSTOM_PROCESSOR_SUB_TYPE.equals(subType)) { QueryParam queryParam = new QueryParam(CustomProcessorInfo.NAME, topologyProcessor.getConfig().get(CustomProcessorInfo.NAME)); Collection<TopologyComponentBundle> result = listCustomProcessorBundlesWithFilter(Collections.singletonList(queryParam)); if (result.size() != 1) { throw new IllegalStateException("Not able to find topology component bundle for custom processor :" + topologyProcessor.getConfig().get (CustomProcessorInfo.NAME));
@Override public double getDouble(String key) { return Double.parseDouble(get(key)); }
@Override public int getInt(String key) { return Integer.parseInt(get(key)); }
@Override public boolean getBoolean(String key) { return Boolean.parseBoolean(get(key)); }
@Override public double getDouble(String key, double defaultValue) { return Double.parseDouble(get(key, String.valueOf(defaultValue))); }
@Override public boolean getBoolean(String key, boolean defaultValue) { return Boolean.parseBoolean(get(key, String.valueOf(defaultValue))); }
@Override public int getInt(String key, int defaultValue) { return Integer.parseInt(get(key, String.valueOf(defaultValue))); }
@Override public long getLong(String key, long defaultValue) { return Long.parseLong(get(key, String.valueOf(defaultValue))); }
private void handleComponentMavenArtifactsConfigForStreamlineComponent(StreamlineComponent streamlineComponent) { Config config = streamlineComponent.getConfig(); if (config != null) { String componentMavenArtifacts = config.get(COMPONENT_CONFIG_KEY_MAVEN_ARTIFACTS, ""); if (!componentMavenArtifacts.isEmpty()) { LOG.debug("Adding component dependency artifact: %s", componentMavenArtifacts); mavenArtifacts.add(componentMavenArtifacts); } } } }
public String getNotifierName() { return getConfig().get(CONFIG_KEY_NAME); }
public String getNotifierJarFileName() { return getConfig().get(CONFIG_KEY_JAR_FILENAME); }
public String getNotifierClassName() { return getConfig().get(CONFIG_KEY_CLASSNAME); }
public String getScriptName() { return getConfig().get(CONFIG_KEY_SCRIPT_NAME); }
private ServiceConfiguration buildStormEnvServiceConfiguration(Config config) { Map<String, String> confMap; ServiceConfiguration stormEnv = new ServiceConfiguration(); stormEnv.setName(CONF_STORM_ENV); confMap = new HashMap<>(); if (config.contains(PARAM_NIMBUS_PRINCIPAL_NAME)) { confMap.put(PARAM_NIMBUS_PRINCIPAL_NAME, config.get(PARAM_NIMBUS_PRINCIPAL_NAME)); } try { String json = objectMapper.writeValueAsString(confMap); stormEnv.setConfiguration(json); } catch (JsonProcessingException e) { throw new RuntimeException(e); } return stormEnv; }