public abstract class AbstractLocation extends AbstractBrooklynObject implements LocationInternal, HasHostGeoInfo, Configurable
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.BrooklynObjectInternal.ConfigurationSupportInternalBrooklynObject.TagSupportConfigurable.ConfigurationSupport| Modifier and Type | Field and Description |
|---|---|
static org.slf4j.Logger |
LOG
Deprecated.
since 0.7.0 shouldn't be public
|
static ConfigKey<Location> |
PARENT_LOCATION |
static ConfigKey<java.lang.Boolean> |
TEMPORARY_LOCATION |
FINAL_SPEC, NAMED_SPEC_NAME, ORIGINAL_SPEC| Constructor and Description |
|---|
AbstractLocation()
Construct a new instance of an AbstractLocation.
|
AbstractLocation(java.util.Map<?,?> properties)
Construct a new instance of an AbstractLocation.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addChild(Location child) |
<T> void |
addExtension(java.lang.Class<T> extensionType,
T extension)
Registers the given extension for the given type.
|
BrooklynObjectInternal.ConfigurationSupportInternal |
config() |
AbstractLocation |
configure(java.util.Map<?,?> properties)
Deprecated.
since 0.7.0; only used for legacy brooklyn types where constructor is called directly;
see overridden method for more info
|
boolean |
containsLocation(Location potentialDescendent)
Answers true if this location equals or is an ancestor of the given location.
|
boolean |
equals(java.lang.Object o) |
java.util.Map<java.lang.String,java.lang.Object> |
getAllConfig(boolean includeInherited)
Deprecated.
|
ConfigBag |
getAllConfigBag()
Deprecated.
|
java.util.Collection<Location> |
getChildren()
Get the 'children' of this location.
|
<T> T |
getConfig(ConfigKey.HasConfigKey<T> key)
Convenience method for
config().get(key) |
<T> T |
getConfig(ConfigKey<T> key)
Returns configuration set at this location or inherited or default.
|
java.lang.String |
getDisplayName()
A display name; recommended to be a concise single-line description.
|
<T> T |
getExtension(java.lang.Class<T> extensionType)
Returns an extension of the given type.
|
HostGeoInfo |
getHostGeoInfo() |
ConfigBag |
getLocalConfigBag() |
Location |
getParent()
Get the 'parent' of this location.
|
ConfigBag |
getRawLocalConfigBag()
Deprecated.
since 0.7; use
getLocalConfigBag() |
RebindSupport<LocationMemento> |
getRebindSupport()
Users are strongly discouraged from calling or overriding this method.
|
boolean |
hasConfig(ConfigKey<?> key,
boolean includeInherited)
Deprecated.
|
boolean |
hasExtension(java.lang.Class<?> extensionType)
Whether this location has support for the given extension type.
|
int |
hashCode() |
boolean |
isManaged() |
void |
onManagementStarted() |
void |
onManagementStopped() |
boolean |
removeChild(Location child) |
<T> T |
setConfig(ConfigKey<T> key,
T value)
Deprecated.
|
void |
setDisplayName(java.lang.String newName) |
void |
setHostGeoInfo(HostGeoInfo hostGeoInfo) |
void |
setManagementContext(ManagementContextInternal managementContext) |
void |
setName(java.lang.String newName)
Deprecated.
since 0.7.0; use
getDisplayName() |
void |
setParent(Location newParent)
Set the 'parent' of this location.
|
void |
setParent(Location newParent,
boolean updateChildListParents) |
java.util.Map<java.lang.String,java.lang.String> |
toMetadataRecord()
Get a record of the metadata of this location.
|
java.lang.String |
toString()
Default String representation is simplified name of class, together with selected fields.
|
java.lang.String |
toVerboseString() |
getCatalogItemId, getId, getManagementContext, getTagSupport, init, rebind, setCatalogItemId, tagsgetManagementContextsetCatalogItemIdgetCatalogItemId, getTagSupport, tags@Deprecated public static final org.slf4j.Logger LOG
public static final ConfigKey<java.lang.Boolean> TEMPORARY_LOCATION
public AbstractLocation()
public AbstractLocation(java.util.Map<?,?> properties)
Location
public void setManagementContext(ManagementContextInternal managementContext)
setManagementContext in class AbstractBrooklynObject@Deprecated public AbstractLocation configure(java.util.Map<?,?> properties)
AbstractBrooklynObjectConfigBag.getUnusedConfig().
To be overridden by AbstractEntity, AbstractLoation, AbstractPolicy, AbstractEnricher, etc.
But should not be overridden by specific entity types. If you do, the entity may break in subsequent releases. Also note that if you require fields to be initialized you must do that in this method. 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.)
public boolean isManaged()
public void onManagementStarted()
public void onManagementStopped()
public java.lang.String getDisplayName()
BrooklynObjectgetDisplayName in interface BrooklynObjectgetDisplayName in interface Locationpublic Location getParent()
Locationnull if this location is the tree root.public java.util.Collection<Location> getChildren()
LocationgetChildren in interface Locationpublic void setParent(Location newParent)
Locationnull to indicate that the location should be disconnected
from its parent.
Adds this location as a child of the new parent (see getChildLocations()).public void setParent(Location newParent, boolean updateChildListParents)
public BrooklynObjectInternal.ConfigurationSupportInternal config()
config in interface BrooklynObjectInternalconfig in interface Configurablepublic <T> T getConfig(ConfigKey.HasConfigKey<T> key)
Locationconfig().get(key)public <T> T getConfig(ConfigKey<T> key)
Locationconfig().get(key)@Deprecated public boolean hasConfig(ConfigKey<?> key, boolean includeInherited)
Location@Deprecated public java.util.Map<java.lang.String,java.lang.Object> getAllConfig(boolean includeInherited)
LocationgetAllConfig in interface Location@Deprecated public ConfigBag getAllConfigBag()
LocationInternalConfigInheritance and so usage is discouraged.getAllConfigBag in interface LocationInternalpublic ConfigBag getLocalConfigBag()
getLocalConfigBag in interface LocationInternal@Deprecated public ConfigBag getRawLocalConfigBag()
getLocalConfigBag()@Deprecated public <T> T setConfig(ConfigKey<T> key, T value)
setConfig in interface Configurable@Deprecated public void setName(java.lang.String newName)
getDisplayName()public void setDisplayName(java.lang.String newName)
setDisplayName in class AbstractBrooklynObjectpublic boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic boolean containsLocation(Location potentialDescendent)
LocationcontainsLocation in interface Locationpublic void addChild(Location child)
public boolean removeChild(Location child)
public java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String toVerboseString()
toVerboseString in interface Locationpublic HostGeoInfo getHostGeoInfo()
getHostGeoInfo in interface HasHostGeoInfopublic void setHostGeoInfo(HostGeoInfo hostGeoInfo)
public RebindSupport<LocationMemento> getRebindSupport()
LocationInternalgetRebindSupport in interface BrooklynObjectInternalgetRebindSupport in interface RebindablegetRebindSupport in interface LocationInternalpublic boolean hasExtension(java.lang.Class<?> extensionType)
LocationLocation.getExtension(Class).hasExtension in interface Locationpublic <T> T getExtension(java.lang.Class<T> extensionType)
LocationgetExtension(Object.class) will not match
anything, even though registered extension extend Object.
This will not look at extensions of Location.getParent().
getExtension in interface Locationpublic <T> void addExtension(java.lang.Class<T> extensionType,
T extension)
LocationInternaladdExtension in interface LocationInternalpublic java.util.Map<java.lang.String,java.lang.String> toMetadataRecord()
LocationInternalMetadata records are used to record an audit trail of events relating to location usage (for billing purposes, for example). Implementations (and subclasses) should override this method to return information useful for this purpose.
toMetadataRecord in interface LocationInternal