Brooklyn

brooklyn.location
[Java] Interface Location

brooklyn.location.Location
  brooklyn.entity.rebind.Rebindable
      brooklyn.entity.trait.Identifiable
All Superinterfaces:
Rebindable, Identifiable

public interface Location
extends java.io.Serializable, Identifiable, 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)

Like getLocationProperty, but if the property is not defined on this location, searches recursively up the parent hierarchy until it is found, or the root is reached (when this method will return null).

java.util.Map getAllConfig()

Returns all config set _at_ this location (not inherited)

java.util.Map getAllConfig(boolean includeInherited)

Returns all config set, either inherited (argument true) or locally-only (argument false)

java.util.Collection getChildLocations()

@deprecated since 0.6

java.util.Collection getChildren()

Get the 'children' of this location.

java.lang.Object getConfig(ConfigKey key)

Returns configuration set at this location or inherited or default

java.lang.String getDisplayName()

Get the name assigned to this location.

java.lang.Object getExtension(java.lang.Class extensionType)

Returns an extension of the given type.

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()

@deprecated since 0.6

Location getParent()

Get the 'parent' of this location.

Location getParentLocation()

@deprecated since 0.6

RebindSupport getRebindSupport()

boolean hasConfig(ConfigKey key)

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

boolean hasConfig(ConfigKey key, boolean includeInherited)

True iff the indication config key is set, either inherited (second argument true) or locally-only (second argument false)

boolean hasExtension(java.lang.Class extensionType)

Whether this location has support for the given extension type.

boolean hasLocationProperty(java.lang.String key)

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

void setParent(Location newParent)

Set the 'parent' of this location.

void setParentLocation(Location newParent)

@deprecated since 0.6

java.lang.String toVerboseString()

@return meta-data about the location (usually a long line, or a small number of lines).

 
Methods inherited from interface Rebindable
getRebindSupport
 
Methods inherited from interface Identifiable
getId
 
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()
 

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)
Like getLocationProperty, but if the property is not defined on this location, searches recursively up the parent hierarchy until it is found, or the root is reached (when this method will return null).
deprecated:
since 0.5.0, use getConfig


getAllConfig

@Deprecated
public java.util.Map getAllConfig()
Returns all config set _at_ this location (not inherited)
deprecated:
since 0.6.0 use {@link #getAllConfig(boolean)


getAllConfig

public java.util.Map getAllConfig(boolean includeInherited)
Returns all config set, either inherited (argument true) or locally-only (argument false)


getChildLocations

@Deprecated
public java.util.Collection getChildLocations()
deprecated:
since 0.6
See Also:
getChildren()


getChildren

public java.util.Collection getChildren()
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.
Since:
0.6 (previously getChildLocations())


getConfig

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


getDisplayName

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


getExtension

public java.lang.Object getExtension(java.lang.Class extensionType)
Returns an extension of the given type. Note that the type must be an exact match for how the extension was registered (e.g. getExtension(Object.class) will not match anything, even though registered extension extend java.lang.Object.

This will not look at extensions of getParent().

throws:
IllegalArgumentException if this location does not support the given extension type
throws:
NullPointerException if extensionType is null


getId

@Override
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

@Deprecated
public java.lang.String getName()
deprecated:
since 0.6
See Also:
getDisplayName()


getParent

public Location getParent()
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.
Since:
0.6 (previously getParentLocation())


getParentLocation

@Deprecated
public Location getParentLocation()
deprecated:
since 0.6
See Also:
getParent()


getRebindSupport

@Override
public RebindSupport getRebindSupport()


hasConfig

@Deprecated
public boolean hasConfig(ConfigKey key)
True iff the indication config key is set _at_ this location (not parents)
deprecated:
since 0.6.0 use hasConfig(ConfigKey, boolean)


hasConfig

public boolean hasConfig(ConfigKey key, boolean includeInherited)
True iff the indication config key is set, either inherited (second argument true) or locally-only (second argument false)


hasExtension

public boolean hasExtension(java.lang.Class extensionType)
Whether this location has support for the given extension type. See additional comments in getExtension(Class).
throws:
NullPointerException if extensionType is null


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


setParent

public void setParent(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.
Since:
0.6 (previously setParentLocation(Location))


setParentLocation

@Deprecated
public void setParentLocation(Location newParent)
deprecated:
since 0.6
See Also:
setParent(Location)


toVerboseString

public java.lang.String toVerboseString()
Returns:
meta-data about the location (usually a long line, or a small number of lines).
Since:
0.6


 

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