Brooklyn

brooklyn.location.basic
[Java] Class AbstractLocation

java.lang.Object
  brooklyn.location.basic.AbstractLocation
All Implemented Interfaces:
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

protected HostGeoInfo hostGeoInfo

protected java.util.Map leftoverProperties

protected java.lang.String name

 
Constructor Summary
AbstractLocation()

Construct a new instance of an AbstractLocation.

AbstractLocation(java.util.Map properties)

 
Method Summary
protected void addChildLocation(Location child)

protected void configure()

will set fields from flags, and put the remaining ones into the 'leftovers' map.

protected void configure(java.util.Map properties)

boolean containsLocation(Location potentialDescendent)

boolean equals(java.lang.Object o)

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

java.util.Collection getChildLocations()

HostGeoInfo getHostGeoInfo()

java.lang.String getId()

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

java.lang.String getName()

Location getParentLocation()

boolean hasLocationProperty(java.lang.String key)

int hashCode()

protected boolean removeChildLocation(Location child)

void setHostGeoInfo(HostGeoInfo hostGeoInfo)

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


hostGeoInfo

protected HostGeoInfo hostGeoInfo


leftoverProperties

protected java.util.Map leftoverProperties


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

protected void addChildLocation(Location child)


configure

protected void configure()
will set fields from flags, and put the remaining ones into the 'leftovers' map. can be subclassed 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.)


configure

protected void configure(java.util.Map properties)


containsLocation

public boolean containsLocation(Location potentialDescendent)


equals

public boolean equals(java.lang.Object o)


findLocationProperty

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


getChildLocations

public java.util.Collection getChildLocations()


getHostGeoInfo

public HostGeoInfo getHostGeoInfo()


getId

public java.lang.String getId()


getLocationProperty

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


getName

public java.lang.String getName()


getParentLocation

public Location getParentLocation()


hasLocationProperty

public boolean hasLocationProperty(java.lang.String key)


hashCode

public int hashCode()


removeChildLocation

protected boolean removeChildLocation(Location child)


setHostGeoInfo

public void setHostGeoInfo(HostGeoInfo hostGeoInfo)


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.