Brooklyn

brooklyn.location.basic
[Java] Class AbstractLocation

java.lang.Object
  brooklyn.location.basic.AbstractLocation
All Implemented Interfaces:
Configurable, HasHostGeoInfo, Location

public abstract class AbstractLocation

A basic implementation of the Location interface. This provides an implementation which works according to the requirements of the interface documentation, and is ready to be extended to make more specialized locations. Override configure(Map) to add special initialization logic.


Field Summary
static Logger LOG

static ConfigKey PARENT_LOCATION

protected HostGeoInfo hostGeoInfo

protected java.lang.String name

 
Constructor Summary
AbstractLocation()

Construct a new instance of an AbstractLocation.

AbstractLocation(java.util.Map properties)

 
Method Summary
void addChildLocation(Location child)

void configure()

@deprecated in 0.5.0, not used or exposed; use configure(Map)

protected void configure(java.util.Map properties)

will set fields from flags.

boolean containsLocation(Location potentialDescendent)

boolean equals(java.lang.Object o)

java.lang.Object findLocationProperty(java.lang.String key)

java.util.Map getAllConfig()

java.util.Collection getChildLocations()

java.lang.Object getConfig(ConfigKey key)

ConfigBag getConfigBag()

HostGeoInfo getHostGeoInfo()

java.lang.String getId()

java.lang.Object getLocationProperty(java.lang.String key)

java.lang.String getName()

Location getParentLocation()

RebindSupport getRebindSupport()

boolean hasConfig(ConfigKey key)

boolean hasLocationProperty(java.lang.String key)

int hashCode()

protected boolean removeChildLocation(Location child)

java.lang.Object setConfig(ConfigKey key, java.lang.Object value)

void setHostGeoInfo(HostGeoInfo hostGeoInfo)

void setName(java.lang.String name)

void setParentLocation(Location parent)

protected ToStringHelper string()

override this, adding to the returned value, to supply additional fields to include in the toString

java.lang.String toString()

Default String representation is simplified name of class, together with selected fields.

 
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

LOG

public static final Logger LOG


PARENT_LOCATION

public static final ConfigKey PARENT_LOCATION


hostGeoInfo

protected HostGeoInfo hostGeoInfo


name

@SetFromFlag
protected java.lang.String name


 
Constructor Detail

AbstractLocation

public AbstractLocation()
Construct a new instance of an AbstractLocation. The properties map recognizes the following keys: Other common properties (retrieved via get/findLocationProperty) include:
Parameters:
properties


AbstractLocation

public AbstractLocation(java.util.Map properties)


 
Method Detail

addChildLocation

public void addChildLocation(Location child)


configure

public final void configure()
deprecated:
in 0.5.0, not used or exposed; use configure(Map)


configure

protected void configure(java.util.Map properties)
will set fields from flags. The unused configuration can be found via the {
linkplain:
ConfigBag#getUnusedConfig()}. This can be overridden for custom initialization but note the following.

if you require fields to be initialized you must do that in this method, with a guard (as in FixedListMachineProvisioningLocation). you must *not* rely on field initializers because they may not run until *after* this method (this method is invoked by the constructor in this class, so initializers in subclasses will not have run when this overridden method is invoked.)


containsLocation

public boolean containsLocation(Location potentialDescendent)


equals

public boolean equals(java.lang.Object o)


findLocationProperty

@Override
@Deprecated
public java.lang.Object findLocationProperty(java.lang.String key)


getAllConfig

@Override
public java.util.Map getAllConfig()


getChildLocations

public java.util.Collection getChildLocations()


getConfig

@Override
public java.lang.Object getConfig(ConfigKey key)


getConfigBag

public ConfigBag getConfigBag()


getHostGeoInfo

public HostGeoInfo getHostGeoInfo()


getId

public java.lang.String getId()


getLocationProperty

@Override
@Deprecated
public java.lang.Object getLocationProperty(java.lang.String key)


getName

public java.lang.String getName()


getParentLocation

public Location getParentLocation()


getRebindSupport

@Override
public RebindSupport getRebindSupport()


hasConfig

@Override
public boolean hasConfig(ConfigKey key)


hasLocationProperty

@Override
@Deprecated
public boolean hasLocationProperty(java.lang.String key)


hashCode

public int hashCode()


removeChildLocation

protected boolean removeChildLocation(Location child)


setConfig

public java.lang.Object setConfig(ConfigKey key, java.lang.Object value)


setHostGeoInfo

public void setHostGeoInfo(HostGeoInfo hostGeoInfo)


setName

public void setName(java.lang.String name)


setParentLocation

public void setParentLocation(Location parent)


string

protected ToStringHelper string()
override this, adding to the returned value, to supply additional fields to include in the toString


toString

@Override
public java.lang.String toString()
Default String representation is simplified name of class, together with selected fields.


 

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