Brooklyn

brooklyn.location.basic
[Java] Class LocationPropertiesFromBrooklynProperties

java.lang.Object
  brooklyn.location.basic.LocationPropertiesFromBrooklynProperties

public class LocationPropertiesFromBrooklynProperties

The properties to use for locations, loaded from brooklyn.properties file.

Authors:
aledsage


Field Summary
protected static java.util.Map DEPRECATED_KEYS_MAPPING

 
Method Summary
protected java.util.Map getDeprecatedKeysMapping()

protected java.util.Map getGenericLocationSingleWordProperties(java.util.Map properties)

Returns those properties in the form "brooklyn.location.xyz", where "xyz" is any key that does not contain dots.

java.util.Map getLocationProperties(java.lang.String provider, java.lang.String namedLocation, java.util.Map properties)

Finds the properties that apply to location, stripping off the prefixes.

protected java.util.Map getMatchingProperties(java.lang.String fullPrefix, java.util.Map properties)

Gets all properties that start with the given fullPrefix, stripping off the prefix in the returned map.

protected java.util.Map getMatchingProperties(java.lang.String fullPreferredPrefix, java.lang.String fullDeprecatedPrefix, java.util.Map properties)

Gets all properties that start with either of the given prefixes.

protected java.util.Map getMatchingSingleWordProperties(java.lang.String fullPrefix, java.util.Map properties)

Gets all properties that start with the given fullPrefix, stripping off the prefix in the returned map.

protected java.util.Map getMatchingSingleWordProperties(java.lang.String fullPreferredPrefix, java.lang.String fullDeprecatedPrefix, java.util.Map properties)

Gets all single-word properties that start with either of the given prefixes.

protected java.util.Map getNamedLocationProperties(java.lang.String locationName, java.util.Map properties)

protected java.lang.String getNamedProvider(java.lang.String namedLocation, java.util.Map properties)

Gets the named provider (e.g. if using a property like brooklyn.location.named.myfavourite=localhost, then getNamedProvider("myfavourite", properties) will return "localhost").

protected java.util.Map getScopedLocationProperties(java.lang.String scopeSuffix, java.util.Map properties)

Gets all properties that start with {@code "brooklyn.location."

protected java.util.Map transformDeprecated(java.util.Map properties)

 
Methods inherited from class java.lang.Object
java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#wait(long, int), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()
 

Field Detail

DEPRECATED_KEYS_MAPPING

@SuppressWarnings("deprecation")
protected static final java.util.Map DEPRECATED_KEYS_MAPPING


 
Method Detail

getDeprecatedKeysMapping

protected java.util.Map getDeprecatedKeysMapping()


getGenericLocationSingleWordProperties

protected java.util.Map getGenericLocationSingleWordProperties(java.util.Map properties)
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.


getLocationProperties

public java.util.Map getLocationProperties(java.lang.String provider, java.lang.String namedLocation, java.util.Map properties)
Finds the properties that apply to location, stripping off the prefixes. Order of preference (in ascending order) is:
  1. brooklyn.location.*
  2. brooklyn.location.provider.*
  3. brooklyn.location.named.namedlocation.*

Converts deprecated hyphenated properties to the non-deprecated camelCase format.


getMatchingProperties

protected java.util.Map getMatchingProperties(java.lang.String fullPrefix, java.util.Map properties)
Gets all properties that start with the given fullPrefix, stripping off the prefix in the returned map.


getMatchingProperties

protected java.util.Map getMatchingProperties(java.lang.String fullPreferredPrefix, java.lang.String fullDeprecatedPrefix, java.util.Map properties)
Gets all properties that start with either of the given prefixes. The fullPreferredPrefix properties will override any duplicates in fullDeprecatedPrefix. If there are any properties that match the fullDeprecatedPrefix, then a warning will be logged.
See Also:
getMatchingProperties(String, Map)


getMatchingSingleWordProperties

protected java.util.Map getMatchingSingleWordProperties(java.lang.String fullPrefix, java.util.Map properties)
Gets all properties that start with the given 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.*).


getMatchingSingleWordProperties

protected java.util.Map getMatchingSingleWordProperties(java.lang.String fullPreferredPrefix, java.lang.String fullDeprecatedPrefix, java.util.Map properties)
Gets all single-word properties that start with either of the given prefixes. The fullPreferredPrefix properties will override any duplicates in fullDeprecatedPrefix. If there are any properties that match the fullDeprecatedPrefix, then a warning will be logged.
See Also:
getMatchingSingleWordProperties(String, Map)


getNamedLocationProperties

protected java.util.Map getNamedLocationProperties(java.lang.String locationName, java.util.Map properties)


getNamedProvider

protected java.lang.String getNamedProvider(java.lang.String namedLocation, java.util.Map properties)
Gets the named provider (e.g. if using a property like brooklyn.location.named.myfavourite=localhost, then getNamedProvider("myfavourite", properties) will return "localhost").


getScopedLocationProperties

protected java.util.Map getScopedLocationProperties(java.lang.String scopeSuffix, java.util.Map properties)
Gets all properties that start with "brooklyn.location."+scopeSuffix+".", stripping off the prefix in the returned map.


transformDeprecated

protected java.util.Map transformDeprecated(java.util.Map properties)


 

Brooklyn Multi-Cloud Application Management Platform
brooklyncentral.github.com. Apache License. © 2012.