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 org.apache.brooklyn.core.entity.factory.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. |
<T extends Feed> |
addFeed(T feed)
Deprecated.
since 1.0.0; see
FeedSupport#add(Feed) |
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) |
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.
|
EntityType |
getEntityType()
Information about the type of this entity; analogous to Java's object.getClass.
|
java.lang.String |
getIconUrl()
Deprecated.
since 0.12.0 look up the
RegisteredType and use its
RegisteredType.getIconUrl() or use conveniences such as
RegisteredTypes.getIconUrl() . |
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.
|
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. |
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, getCatalogItemIdSearchPath, subscriptions, tags
config, getConfig
java.lang.String getId()
getId
in interface Identifiable
long getCreationTime()
java.lang.String getDisplayName()
getDisplayName
in interface BrooklynObject
@Deprecated @Nullable java.lang.String getIconUrl()
RegisteredType
and use its
RegisteredType.getIconUrl()
or use conveniences such as
RegisteredTypes.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.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)}
<T> Task<T> invoke(Effector<T> eff, java.util.Map<java.lang.String,?> parameters)
@Deprecated <T extends Feed> T addFeed(T feed)
FeedSupport#add(Feed)
Entity.SensorSupport sensors()
Entity.PolicySupport policies()
Entity.EnricherSupport enrichers()
Entity.GroupSupport groups()
BrooklynObject.RelationSupport<Entity> relations()
BrooklynObject
relations
in interface BrooklynObject