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
Modifier and Type | Interface and Description |
---|---|
static interface |
Entity.AdjunctSupport<T extends EntityAdjunct> |
static interface |
Entity.EnricherSupport |
static interface |
Entity.GroupSupport
For managing/querying the group membership of this entity.
|
static interface |
Entity.PolicySupport |
static interface |
Entity.SensorSupport |
BrooklynObject.RelationSupport<T extends BrooklynObject>, BrooklynObject.SubscriptionSupport, 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)
Deprecated.
since 0.9.0; see
Entity.EnricherSupport.add(Enricher) |
<T extends Enricher> |
addEnricher(EnricherSpec<T> enricher)
Deprecated.
since 0.9.0; see
Entity.EnricherSupport.add(EnricherSpec) |
<T extends Feed> |
addFeed(T feed)
Adds the given feed to this entity.
|
void |
addGroup(Group group)
Deprecated.
since 0.9.0; see
GroupSupport#add() and groups() |
void |
addPolicy(Policy policy)
Deprecated.
since 0.9.0; see
Entity.PolicySupport.add(Policy) |
<T extends Policy> |
addPolicy(PolicySpec<T> policy)
Deprecated.
since 0.9.0; see
Entity.PolicySupport.add(PolicySpec) |
void |
clearParent()
Clears the parent (i.e.
|
Entity.EnricherSupport |
enrichers() |
Application |
getApplication() |
java.lang.String |
getApplicationId() |
<T> T |
getAttribute(AttributeSensor<T> sensor)
Convenience for calling
Entity.SensorSupport.get(AttributeSensor) ,
via code like sensors().get(key) . |
java.util.Collection<Entity> |
getChildren()
Return the entities that are children of (i.e.
|
<T> T |
getConfig(ConfigKey.HasConfigKey<T> 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()
Deprecated.
since 0.9.0; see
getEnrichers() |
EntityType |
getEntityType()
Information about the type of this entity; analogous to Java's object.getClass.
|
java.util.Collection<Group> |
getGroups()
Deprecated.
since 0.9.0; see
getGroups() and groups() |
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()
Deprecated.
since 0.9.0; see
getPolicies() |
Entity.GroupSupport |
groups() |
<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.
|
Entity.PolicySupport |
policies() |
BrooklynObject.RelationSupport<Entity> |
relations()
Relations specify a typed, directed connection between two entities.
|
boolean |
removeChild(Entity child)
Removes the specified child
Entity ; its parent will be set to null. |
boolean |
removeEnricher(Enricher enricher)
Deprecated.
since 0.9.0; see
Entity.EnricherSupport.remove(Enricher) |
void |
removeGroup(Group group)
Deprecated.
since 0.9.0; see
GroupSupport#remove() and groups() |
boolean |
removePolicy(Policy policy)
Deprecated.
since 0.9.0; see
Entity.PolicySupport.remove(Policy) |
Entity.SensorSupport |
sensors() |
void |
setDisplayName(java.lang.String displayName)
Sets the entity's display name.
|
Entity |
setParent(Entity parent)
Sets the parent (i.e.
|
getCatalogItemId, subscriptions, tags
config, getConfig, 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()
void setDisplayName(java.lang.String displayName)
Entity setParent(Entity parent)
getParent()
,
clearParent()
void clearParent()
<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.@Deprecated java.util.Collection<Policy> getPolicies()
getPolicies()
@Deprecated java.util.Collection<Enricher> getEnrichers()
getEnrichers()
@Deprecated 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.@Deprecated 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!)
@Deprecated 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)
Entity.SensorSupport.get(AttributeSensor)
,
via code like sensors().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)
@Deprecated void addPolicy(Policy policy)
Entity.PolicySupport.add(Policy)
@Deprecated <T extends Policy> T addPolicy(PolicySpec<T> policy)
Entity.PolicySupport.add(PolicySpec)
@Deprecated boolean removePolicy(Policy policy)
Entity.PolicySupport.remove(Policy)
@Deprecated void addEnricher(Enricher enricher)
Entity.EnricherSupport.add(Enricher)
@Deprecated <T extends Enricher> T addEnricher(EnricherSpec<T> enricher)
Entity.EnricherSupport.add(EnricherSpec)
@Deprecated boolean removeEnricher(Enricher enricher)
Entity.EnricherSupport.remove(Enricher)
<T extends Feed> T addFeed(T feed)
Entity.SensorSupport sensors()
Entity.PolicySupport policies()
Entity.EnricherSupport enrichers()
Entity.GroupSupport groups()
BrooklynObject.RelationSupport<Entity> relations()
BrooklynObject
relations
in interface BrooklynObject