/** * Returns those properties in the form "brooklyn.location.xyz", where "xyz" is any * key that does not contain dots. We do this special (sub-optimal!) filtering * because we want to exclude brooklyn.location.named.*, brooklyn.location.jclouds.*, etc. * We only want those properties that are to be generic for all locations. * * Strips off the prefix in the returned map. */ protected Map<String, Object> getGenericLocationSingleWordProperties(Map<String, ?> properties) { return getMatchingSingleWordProperties("brooklyn.location.", properties); }
/** * Gets all single-word properties that start with either of the given prefixes. The {@code fullPreferredPrefix} * properties will override any duplicates in {@code fullDeprecatedPrefix}. If there are any * properties that match the {@code fullDeprecatedPrefix}, then a warning will be logged. * * @see #getMatchingSingleWordProperties(String, Map) */ protected Map<String, Object> getMatchingSingleWordProperties(String fullPreferredPrefix, String fullDeprecatedPrefix, Map<String, ?> properties) { Map<String, Object> deprecatedResults = getMatchingSingleWordProperties(fullDeprecatedPrefix, properties); Map<String, Object> results = getMatchingSingleWordProperties(fullPreferredPrefix, properties); if (deprecatedResults.size() > 0) { LOG.warn("Deprecated use of properties prefix "+fullDeprecatedPrefix+"; instead use "+fullPreferredPrefix); return MutableMap.<String, Object>builder() .putAll(deprecatedResults) .putAll(results) .build(); } else { return results; } }