public interface Entity extends BrooklynObject
Implementors of entities are strongly encouraged to extend AbstractEntity
.
To instantiate an entity, see managementContext.getEntityManager().createEntity(entitySpec)
.
Also see ApplicationBuilder
,
AbstractEntity.addChild(EntitySpec)
, and
EntitySpec
.
AbstractEntity
BrooklynObject.TagSupport
Configurable.ConfigurationSupport
Modifier and Type | Method and Description |
---|---|
<T extends Entity> |
addChild(EntitySpec<T> spec)
Creates an
Entity from the given spec and adds it, setting this entity as the parent,
returning the added child. |
<T extends Entity> |
addChild(T child)
Add a child
Entity , and set this entity as its parent,
returning the added child. |
void |
addEnricher(Enricher enricher)
Adds the given enricher to this entity.
|
<T extends Enricher> |
addEnricher(EnricherSpec<T> enricher)
Adds the given enricher to this entity.
|
<T extends Feed> |
addFeed(T feed)
Adds the given feed to this entity.
|
void |
addGroup(Group group)
Add this entity as a member of the given
Group . |
void |
addPolicy(Policy policy)
Adds the given policy to this entity.
|
<T extends Policy> |
addPolicy(PolicySpec<T> enricher)
Adds the given policy to this entity.
|
boolean |
addTag(java.lang.Object tag)
Deprecated.
since 0.7; see
BrooklynObject.tags() |
void |
clearParent()
Clears the parent (i.e.
|
boolean |
containsTag(java.lang.Object tag)
Deprecated.
since 0.7; see
BrooklynObject.tags() |
Application |
getApplication() |
java.lang.String |
getApplicationId() |
<T> T |
getAttribute(AttributeSensor<T> sensor)
Gets the value of the given attribute on this entity, or null if has not been set.
|
java.util.Collection<Entity> |
getChildren()
Return the entities that are children of (i.e.
|
<T> T |
getConfig(ConfigKey.HasConfigKey<T> key) |
<T> T |
getConfig(ConfigKey<T> key)
Convenience for calling
ConfigurationSupport#getConfig(ConfigKey) ,
via code like config().get(key) . |
Maybe<java.lang.Object> |
getConfigRaw(ConfigKey.HasConfigKey<?> key,
boolean includeInherited)
Deprecated.
since 0.7.0
|
Maybe<java.lang.Object> |
getConfigRaw(ConfigKey<?> key,
boolean includeInherited)
Deprecated.
since 0.7.0; use
((EntityInternal)entity).config().getRaw() or
((EntityInternal)entity).config().getLocalRaw() |
long |
getCreationTime()
Returns the creation time for this entity, in UTC.
|
java.lang.String |
getDisplayName()
A display name; recommended to be a concise single-line description.
|
java.util.Collection<Enricher> |
getEnrichers() |
EntityType |
getEntityType()
Information about the type of this entity; analogous to Java's object.getClass.
|
java.util.Collection<Group> |
getGroups()
The
Collection of Group s that this entity is a member of. |
java.lang.String |
getIconUrl()
A URL pointing to an image which can be used to represent this entity.
|
java.lang.String |
getId()
The unique identifier for this entity.
|
java.util.Collection<Location> |
getLocations()
Return all the
Location s this entity is deployed to. |
Entity |
getParent()
The parent of this entity, null if no parent.
|
java.util.Collection<Policy> |
getPolicies() |
java.util.Set<java.lang.Object> |
getTags()
Deprecated.
since 0.7; see
BrooklynObject.tags() |
<T> Task<T> |
invoke(Effector<T> eff,
java.util.Map<java.lang.String,?> parameters)
Invokes the given effector, with the given parameters to that effector.
|
boolean |
removeChild(Entity child)
Removes the specified child
Entity ; its parent will be set to null. |
boolean |
removeEnricher(Enricher enricher)
Removes the given enricher from this entity.
|
void |
removeGroup(Group group)
Removes this entity as a member of the given
Group . |
boolean |
removePolicy(Policy policy)
Removes the given policy from this entity.
|
boolean |
removeTag(java.lang.Object tag)
Deprecated.
since 0.7; see
BrooklynObject.tags() |
Entity |
setParent(Entity parent)
Sets the parent (i.e.
|
getCatalogItemId, getTagSupport, tags
config, setConfig
java.lang.String getId()
getId
in interface Identifiable
long getCreationTime()
java.lang.String getDisplayName()
getDisplayName
in interface BrooklynObject
@Nullable java.lang.String getIconUrl()
EntityType getEntityType()
Application getApplication()
Application
this entity is registered with, or null if not registered.java.lang.String getApplicationId()
Application
this entity is registered with, or null if not registered.Entity getParent()
setParent(Entity)
,
clearParent()
java.util.Collection<Entity> getChildren()
Entity setParent(Entity parent)
getParent()
,
clearParent()
void clearParent()
getParent()
,
setParent(brooklyn.entity.Entity)
<T extends Entity> T addChild(T child)
Entity
, and set this entity as its parent,
returning the added child.
As with addChild(EntitySpec)
the child is not brought under management
as part of this call. It should not be managed prior to this call either.
<T extends Entity> T addChild(EntitySpec<T> spec)
Entity
from the given spec and adds it, setting this entity as the parent,
returning the added child.
The added child is not managed as part of this call, even if the parent is managed,
so if adding post-management an explicit call to manage the child will be needed;
see the convenience method Entities.manage(...)
.
boolean removeChild(Entity child)
Entity
; its parent will be set to null.java.util.Collection<Policy> getPolicies()
java.util.Collection<Enricher> getEnrichers()
java.util.Collection<Group> getGroups()
Collection
of Group
s that this entity is a member of.
Groupings can be used to allow easy management/monitoring of a group of entities.void addGroup(Group group)
Group
. Called by framework.
Users should call Group.addMember(Entity)
instead; this method will then
automatically be called. However, the reverse is not true (calling this method will
not tell the group; this behaviour may change in a future release!)
void removeGroup(Group group)
Group
. Called by framework.
Users should call Group.removeMember(Entity)
instead; this method will then
automatically be called. However, the reverse is not true (calling this method will
not tell the group; this behaviour may change in a future release!)
java.util.Collection<Location> getLocations()
Location
s this entity is deployed to.<T> T getAttribute(AttributeSensor<T> sensor)
<T> T getConfig(ConfigKey<T> key)
ConfigurationSupport#getConfig(ConfigKey)
,
via code like config().get(key)
.<T> T getConfig(ConfigKey.HasConfigKey<T> key)
getConfig(ConfigKey)}
@Deprecated Maybe<java.lang.Object> getConfigRaw(ConfigKey<?> key, boolean includeInherited)
((EntityInternal)entity).config().getRaw()
or
((EntityInternal)entity).config().getLocalRaw()
@Deprecated Maybe<java.lang.Object> getConfigRaw(ConfigKey.HasConfigKey<?> key, boolean includeInherited)
#getConfigRaw(ConfigKey, boolean)}.
<T> Task<T> invoke(Effector<T> eff, java.util.Map<java.lang.String,?> parameters)
void addPolicy(Policy policy)
<T extends Policy> T addPolicy(PolicySpec<T> enricher)
boolean removePolicy(Policy policy)
void addEnricher(Enricher enricher)
<T extends Enricher> T addEnricher(EnricherSpec<T> enricher)
boolean removeEnricher(Enricher enricher)
<T extends Feed> T addFeed(T feed)
@Deprecated java.util.Set<java.lang.Object> getTags()
BrooklynObject.tags()
@Deprecated boolean addTag(@Nonnull java.lang.Object tag)
BrooklynObject.tags()
@Deprecated boolean removeTag(@Nonnull java.lang.Object tag)
BrooklynObject.tags()
@Deprecated boolean containsTag(@Nonnull java.lang.Object tag)
BrooklynObject.tags()