@Test public void testExtractProviderProperties() throws Exception { String provider = "myprovider"; String namedLocation = null; Map<String, String> properties = Maps.newLinkedHashMap(); properties.put("brooklyn.location.myprovider.privateKeyFile", "privateKeyFile-inProviderSpecific"); properties.put("brooklyn.location.privateKeyFile", "privateKeyFile-inLocationGeneric"); properties.put("brooklyn.location.publicKeyFile", "publicKeyFile-inLocationGeneric"); Map<String, Object> conf = parser.getLocationProperties(provider, namedLocation, properties); assertEquals(conf.get("privateKeyFile"), "privateKeyFile-inProviderSpecific"); assertEquals(conf.get("publicKeyFile"), "publicKeyFile-inLocationGeneric"); }
public Map<String, Object> getLocationProperties(String provider, String namedLocation, Map<String, ?> properties) { ConfigBag result = ConfigBag.newInstance(); if (!Strings.isNullOrEmpty(provider)) result.put(LocationConfigKeys.CLOUD_PROVIDER, provider); result.putAll(transformDeprecated(getGenericLocationSingleWordProperties(properties))); if (!Strings.isNullOrEmpty(provider)) result.putAll(transformDeprecated(getScopedLocationProperties(provider, properties))); if (!Strings.isNullOrEmpty(namedLocation)) result.putAll(transformDeprecated(getNamedLocationProperties(namedLocation, properties))); setLocalTempDir(properties, result); return result.getAllConfigRaw(); }
LocationPropertiesFromBrooklynProperties { public Map<String, Object> getLocationProperties(String provider, String namedLocation, Map<String, ?> properties) { ConfigBag result = ConfigBag.newInstance(); if (!Strings.isNullOrEmpty(provider)) result.put(LocationConfigKeys.CLOUD_PROVIDER, provider); result.putAll(transformDeprecated(getGenericLocationSingleWordProperties(properties))); if (!Strings.isNullOrEmpty(provider)) result.putAll(transformDeprecated(getScopedLocationProperties(provider, properties))); if (!Strings.isNullOrEmpty(namedLocation)) result.putAll(transformDeprecated(getNamedLocationProperties(namedLocation, properties))); setLocalTempDir(properties, result); return result.getAllConfigRaw(); } }
LocationPropertiesFromBrooklynProperties { public Map<String, Object> getLocationProperties(String provider, String namedLocation, Map<String, ?> properties) { ConfigBag result = ConfigBag.newInstance(); if (!Strings.isNullOrEmpty(provider)) result.put(LocationConfigKeys.CLOUD_PROVIDER, provider); result.putAll(transformDeprecated(getGenericLocationSingleWordProperties(properties))); if (!Strings.isNullOrEmpty(provider)) result.putAll(transformDeprecated(getScopedLocationProperties(provider, properties))); if (!Strings.isNullOrEmpty(namedLocation)) result.putAll(transformDeprecated(getNamedLocationProperties(namedLocation, properties))); setLocalTempDir(properties, result); return result.getAllConfigRaw(); }  }
LocationPropertiesFromBrooklynProperties { public Map<String, Object> getLocationProperties(String provider, String namedLocation, Map<String, ?> properties) { ConfigBag result = ConfigBag.newInstance(); if (!Strings.isNullOrEmpty(provider)) result.put(LocationConfigKeys.CLOUD_PROVIDER, provider); result.putAll(transformDeprecated(getGenericLocationSingleWordProperties(properties))); if (!Strings.isNullOrEmpty(provider)) result.putAll(transformDeprecated(getScopedLocationProperties(provider, properties))); if (!Strings.isNullOrEmpty(namedLocation)) result.putAll(transformDeprecated(getNamedLocationProperties(namedLocation, properties))); setLocalTempDir(properties, result); return result.getAllConfigRaw(); }  Map<String, Object> getLocationProperties(String provider, String namedLocation, Map<String, ?> properties); static void setLocalTempDir(Map<String,?> source, ConfigBag target); }
LocationPropertiesFromBrooklynProperties { public Map<String, Object> getLocationProperties(String provider, String namedLocation, Map<String, ?> properties) { ConfigBag result = ConfigBag.newInstance(); if (!Strings.isNullOrEmpty(provider)) result.put(LocationConfigKeys.CLOUD_PROVIDER, provider); result.putAll(transformDeprecated(getGenericLocationSingleWordProperties(properties))); if (!Strings.isNullOrEmpty(provider)) result.putAll(transformDeprecated(getScopedLocationProperties(provider, properties))); if (!Strings.isNullOrEmpty(namedLocation)) result.putAll(transformDeprecated(getNamedLocationProperties(namedLocation, properties))); setLocalTempDir(properties, result); return result.getAllConfigRaw(); }  Map<String, Object> getLocationProperties(String provider, String namedLocation, Map<String, ?> properties); static void setLocalTempDir(Map<String,?> source, ConfigBag target);  }