@Override protected ConfigBag extractConfig(Map<?,?> locationFlags, String spec, LocationRegistry registry) { ConfigBag config = super.extractConfig(locationFlags, spec, registry); config.putAsStringKeyIfAbsent("name", "localhost"); return config; } }
protected Map<String, Object> getFilteredLocationProperties(String provider, String namedLocation, Map<String, ?> prioritisedProperties, Map<String, ?> globalProperties) { return getFilteredLocationProperties(provider, namedLocation, globalProperties); }
@Override public boolean isEnabled() { return LocationConfigUtils.isResolverPrefixEnabled(managementContext, getPrefix()); }
protected ConfigBag extractConfig(Map<?,?> locationFlags, String spec, LocationRegistry registry) { @SuppressWarnings("unchecked") Map<String,?> globalProperties = registry.getProperties(); ParsedSpec parsedSpec = specParser.parse(spec); String namedLocation = (String) locationFlags.get(LocationInternal.NAMED_SPEC_NAME.getName()); // prefer args map over location flags ConfigBag flags = ConfigBag.newInstance(parsedSpec.argsMap).putIfAbsent(locationFlags); Map<String, Object> filteredProperties = getFilteredLocationProperties(getPrefix(), namedLocation, flags.getAllConfig(), globalProperties); flags.putIfAbsent(filteredProperties); return flags; }
@Override public LocationSpec<?> newLocationSpecFromString(String spec, Map<?,?> locationFlags, LocationRegistry registry) { ConfigBag config = extractConfig(locationFlags, spec, registry); @SuppressWarnings("unchecked") Map<String,?> globalProperties = registry.getProperties(); String namedLocation = (String) locationFlags.get(LocationInternal.NAMED_SPEC_NAME.getName()); if (registry != null) { LocationPropertiesFromBrooklynProperties.setLocalTempDir(globalProperties, config); } return LocationSpec.create(getLocationType()) .configure(config.getAllConfig()) .configure(LocationConfigUtils.finalAndOriginalSpecs(spec, locationFlags, globalProperties, namedLocation)); }
@Override public void init(ManagementContext managementContext) { this.managementContext = checkNotNull(managementContext, "managementContext"); this.specParser = getSpecParser(); }
@Override public boolean isEnabled() { // right now these two checks, but in case the generic mechanism in super changes... return super.isEnabled() && LocationConfigUtils.isEnabled(managementContext, BROOKLYN_LOCATION_LOCALHOST_PREFIX); }
@Override protected ConfigBag extractConfig(Map<?,?> locationFlags, String spec, LocationRegistry registry) { ConfigBag config = super.extractConfig(locationFlags, spec, registry); config.putAsStringKeyIfAbsent("name", "localhost"); return config; }
/** * @deprecated since 0.10.0; use {@link #getFilteredLocationProperties(String, String, Map, Map)} */ @Deprecated protected Map<String, Object> getFilteredLocationProperties(String provider, String namedLocation, Map<String, ?> globalProperties) { return new LocationPropertiesFromBrooklynProperties().getLocationProperties(getPrefix(), namedLocation, globalProperties); }
@Override protected ConfigBag extractConfig(Map<?,?> locationFlags, String spec, LocationRegistry registry) { ConfigBag config = super.extractConfig(locationFlags, spec, registry);