/** * Gets all properties that start with the given {@code fullPrefix}, stripping off * the prefix in the returned map. */ protected Map<String, Object> getMatchingProperties(String fullPrefix, Map<String, ?> properties) { return ConfigUtils.filterForPrefixAndStrip(properties, fullPrefix).asMapWithStringKeys(); }
protected Map<String, Object> getNamedLocationProperties(String locationName, Map<String, ?> properties) { checkArgument(!Strings.isNullOrEmpty(locationName), "locationName should not be blank"); String prefix = String.format("brooklyn.location.named.%s.", locationName); return ConfigUtils.filterForPrefixAndStrip(properties, prefix).asMapWithStringKeys(); }
protected Map<String, Object> getNamedJcloudsProperties(String locationName, Map<String, ?> properties) { if(locationName == null) return Maps.newHashMap(); String prefix = String.format("brooklyn.location.named.%s.", locationName); return ConfigUtils.filterForPrefixAndStrip(properties, prefix).asMapWithStringKeys(); }
/** * Gets all properties that start with {@code "brooklyn.location."+scopeSuffix+"."}, stripping off * the prefix in the returned map. */ protected Map<String, Object> getScopedLocationProperties(String scopeSuffix, Map<String, ?> properties) { checkArgument(!scopeSuffix.startsWith("."), "scopeSuffix \"%s\" should not start with \".\"", scopeSuffix); checkArgument(!scopeSuffix.endsWith("."), "scopeSuffix \"%s\" should not end with \".\"", scopeSuffix); String prefix = String.format("brooklyn.location.%s.", scopeSuffix); return ConfigUtils.filterForPrefixAndStrip(properties, prefix).asMapWithStringKeys(); }
/** * Gets all properties that start with the given {@code fullPrefix}, stripping off * the prefix in the returned map. * * Returns only those properties whose key suffix is a single word (i.e. contains no dots). * We do this special (sub-optimal!) filtering because we want sub-scoped things * (e.g. could want brooklyn.location.privateKeyFile, but not brooklyn.location.named.*). */ protected Map<String, Object> getMatchingSingleWordProperties(String fullPrefix, Map<String, ?> properties) { BrooklynProperties filteredProperties = ConfigUtils.filterForPrefixAndStrip(properties, fullPrefix); return ConfigUtils.filterFor(filteredProperties, Predicates.not(Predicates.containsPattern("\\."))).asMapWithStringKeys(); }