Brooklyn

brooklyn.location
[Java] Interface Location

brooklyn.location.Location
  brooklyn.entity.rebind.Rebindable
All Superinterfaces:
Rebindable

public interface Location
extends java.io.Serializable, Rebindable

A location that an entity can be in. Examples of locations include a single machine or a pool of machines, or a region within a given cloud. See Startable.start. Locations may not be java.io.Serializable in subsequent releases!


Method Summary
boolean containsLocation(Location potentialDescendent)

Answers true if this location equals or is an ancestor of the given location.

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

// * Returns the location properties of this immediate location (i.e. not including those from the parent hierarchy). // * @deprecated since 0.5.0, use getAllConfig //

java.util.Map getAllConfig()

Returns all config set _at_ this location (not inherited)

java.util.Collection getChildLocations()

Get the 'children' of this location.

java.lang.Object getConfig(ConfigKey key)

Returns configuration set at this location or inherited

java.lang.String getId()

A unique id for this location.

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

Returns the value of the property identified by the specified key.

java.lang.String getName()

Get the name assigned to this location.

Location getParentLocation()

Get the 'parent' of this location.

RebindSupport getRebindSupport()

boolean hasConfig(ConfigKey key)

True iff the indication config key is set _at_ this location (not parents)

boolean hasLocationProperty(java.lang.String key)

Returns true iff this location contains a property with the specified key.

void setParentLocation(Location newParent)

Set the 'parent' of this location.

 
Methods inherited from interface Rebindable
getRebindSupport
 

Method Detail

containsLocation

public boolean containsLocation(Location potentialDescendent)
Answers true if this location equals or is an ancestor of the given location.


findLocationProperty

@Deprecated
public java.lang.Object findLocationProperty(java.lang.String key)
// * Returns the location properties of this immediate location (i.e. not including those from the parent hierarchy). // *
deprecated:
since 0.5.0, use getAllConfig //


getAllConfig

public java.util.Map getAllConfig()
Returns all config set _at_ this location (not inherited)


getChildLocations

public java.util.Collection getChildLocations()
Get the 'children' of this location. Locations are organized into a tree hierarchy, and this method will return a collection containing the children of this location. This collection is an unmodifiable view of the data.
Returns:
a collection containing the children of this location.


getConfig

public java.lang.Object getConfig(ConfigKey key)
Returns configuration set at this location or inherited


getId

public java.lang.String getId()
A unique id for this location.


getLocationProperty

@Deprecated
public java.lang.Object getLocationProperty(java.lang.String key)
Returns the value of the property identified by the specified key. This method only interrogates the immediate properties; the parent hierarchy is NOT searched in the event that the property is not found locally. NOTE: must not name this method 'getProperty' as this will clash with the 'magic' Groovy's method of the same name, at which point everything stops working!
deprecated:
since 0.5.0, use `if (hasConfig) { getConfig }` if you really need to preserve "don't look at parents" behaviour


getName

public java.lang.String getName()
Get the name assigned to this location.
Returns:
the name assigned to the location.


getParentLocation

public Location getParentLocation()
Get the 'parent' of this location. Locations are organized into a tree hierarchy, and this method will return a reference to the parent of this location, or null if this location is the tree root.
Returns:
a reference to the parent of this location, or null if this location is the tree root.


getRebindSupport

@Override
public RebindSupport getRebindSupport()


hasConfig

public boolean hasConfig(ConfigKey key)
True iff the indication config key is set _at_ this location (not parents)


hasLocationProperty

@Deprecated
public boolean hasLocationProperty(java.lang.String key)
Returns true iff this location contains a property with the specified key. The property's value can be obtained by calling getLocationProperty. This method only interrogates the immediate properties; the parent hierarchy is NOT searched in the event that the property is not found locally.
deprecated:
since 0.5.0, use hasConfig


setParentLocation

public void setParentLocation(Location newParent)
Set the 'parent' of this location. If this location was previously a child of a different location, it is removed from the other location first. It is valid to pass in null to indicate that the location should be disconnected from its parent. Adds this location as a child of the new parent (see getChildLocations()).
Parameters:
newParent - the new parent location object, or null to clear the parent reference.


 

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