private void updateDataFlowUriIfNeeded(Map<String, String> appDeploymentProperties, List<String> commandLineArgs) { if (StringUtils.isEmpty(this.dataflowServerUri)) { return; } RelaxedNames relaxedNames = new RelaxedNames(DATAFLOW_SERVER_URI_KEY); for (String dataFlowUriKey : relaxedNames) { if (appDeploymentProperties.containsKey(dataFlowUriKey)) { return; } for (String cmdLineArg : commandLineArgs) { if (cmdLineArg.contains(dataFlowUriKey + "=")) { return; } } } appDeploymentProperties.put(DATAFLOW_SERVER_URI_KEY, this.dataflowServerUri); }
@Override public ConfigurationMetadataProperty getPropertyMetadata(String propertyName) { if (cpExec == null) { init(); } if (cachedProperties != null) { // generate and try relaxed variants for (String relaxedName : new RelaxedNames(propertyName)) { if (cachedProperties.containsKey(relaxedName)) { return cachedProperties.get(relaxedName); } else { // try to interpret array notation (strip '[index]' from pName) Matcher mArrNot = pArrayNotation.matcher(relaxedName); if (mArrNot.matches()) { return cachedProperties.get(mArrNot.group(1)); } else { // try to interpret map notation (see if pName starts with a set of known map props) for (String mapPropertyName : getMapPropertyNames()) { if (relaxedName.startsWith(mapPropertyName)) { return cachedProperties.get(mapPropertyName); } } } } } } return null; }
private HttpStatus getStatus(Health health) { String code = health.getStatus().getCode(); if (code != null) { code = code.toLowerCase().replace("_", "-"); for (String candidate : RelaxedNames.forCamelCase(code)) { HttpStatus status = this.statusMapping.get(candidate); if (status != null) { return status; } } } return null; }