brooklyn.entity
Interface Entity

All Superinterfaces:
Rebindable<EntityMemento>, Serializable
All Known Subinterfaces:
Application, DriverDependentEntity<D>, Group

public interface Entity
extends Serializable, Rebindable<EntityMemento>

The basic interface for a Brooklyn entity.

See Also:
AbstractEntity

Method Summary
 Entity addChild(Entity child)
          Add a child Entity, and set this entity as its parent.
 void addGroup(Group group)
          Add this entity as a member of the given Group.
 Entity addOwnedChild(Entity child)
          Deprecated. see addChild(Entity)
 void clearOwner()
          Deprecated. see clearParent()
 void clearParent()
          Clears the parent (i.e.
 Application getApplication()
           
 String getApplicationId()
          Return the id of the Application this entity is registered with.
<T> T
getAttribute(AttributeSensor<T> sensor)
          Gets the value of the given attribute on this entity, or null if has not been set.
 Collection<Entity> getChildren()
          Return the entities that are children of (i.e.
<T> T
getConfig(ConfigKey<T> key)
          Gets the given configuration value for this entity, which may be inherited from its parent.
 String getDisplayName()
          A display name; recommended to be a concise single-line description.
 Collection<Enricher> getEnrichers()
           
 EntityType getEntityType()
          Information about the type of this entity; analogous to Java's object.getClass.
 Collection<Group> getGroups()
          The Collection of Groups that this entity is a member of.
 String getId()
          The unique identifier for this entity.
 Collection<Location> getLocations()
          Return all the Locations this entity is deployed to.
 Collection<Entity> getOwnedChildren()
          Deprecated. see getChildren()
 Entity getOwner()
          Deprecated. see getParent()
 Entity getParent()
          The parent of this entity, null if no parent.
 Collection<Policy> getPolicies()
           
<T> Task<T>
invoke(Effector<T> eff, Map<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 removeOwnedChild(Entity child)
          Deprecated. see removeChild(Entity)
 Entity setOwner(Entity group)
          Deprecated. see setOwner(Entity)
 Entity setParent(Entity parent)
          Sets the parent (i.e.
 
Methods inherited from interface brooklyn.entity.rebind.Rebindable
getRebindSupport
 

Method Detail

getId

String getId()
The unique identifier for this entity.


getDisplayName

String getDisplayName()
A display name; recommended to be a concise single-line description.


getEntityType

EntityType getEntityType()
Information about the type of this entity; analogous to Java's object.getClass.


getApplication

Application getApplication()

getApplicationId

String getApplicationId()
Return the id of the Application this entity is registered with.


getParent

Entity getParent()
The parent of this entity, null if no parent. The parent is normally the entity responsible for creating/destroying/managing this entity.

See Also:
setParent(Entity), clearParent()

getChildren

Collection<Entity> getChildren()
Return the entities that are children of (i.e. "owned by") this entity


setParent

Entity setParent(Entity parent)
Sets the parent (i.e. "owner") of this entity. Returns this entity, for convenience.

See Also:
getParent(), clearParent()

clearParent

void clearParent()
Clears the parent (i.e. "owner") of this entity. Also cleans up any references within its parent entity.

See Also:
getParent(), setParent(brooklyn.entity.Entity)

addChild

Entity addChild(Entity child)
Add a child Entity, and set this entity as its parent.


removeChild

boolean removeChild(Entity child)
Removes the specified child Entity; its parent will be set to null.

Returns:
True if the given entity was contained in the set of children

getOwner

@Deprecated
Entity getOwner()
Deprecated. see getParent()


getOwnedChildren

@Deprecated
Collection<Entity> getOwnedChildren()
Deprecated. see getChildren()


setOwner

@Deprecated
Entity setOwner(Entity group)
Deprecated. see setOwner(Entity)


clearOwner

@Deprecated
void clearOwner()
Deprecated. see clearParent()


addOwnedChild

@Deprecated
Entity addOwnedChild(Entity child)
Deprecated. see addChild(Entity)


removeOwnedChild

@Deprecated
boolean removeOwnedChild(Entity child)
Deprecated. see removeChild(Entity)


getPolicies

Collection<Policy> getPolicies()
Returns:
an immutable thread-safe view of the policies.

getEnrichers

Collection<Enricher> getEnrichers()
Returns:
an immutable thread-safe view of the policies.

getGroups

Collection<Group> getGroups()
The Collection of Groups that this entity is a member of. Groupings can be used to allow easy management/monitoring of a group of entities.


addGroup

void addGroup(Group group)
Add this entity as a member of the given Group.


getLocations

Collection<Location> getLocations()
Return all the Locations this entity is deployed to.


getAttribute

<T> T getAttribute(AttributeSensor<T> sensor)
Gets the value of the given attribute on this entity, or null if has not been set. Attributes can be things like workrate and status information, as well as configuration (e.g. url/jmxHost/jmxPort), etc.


getConfig

<T> T getConfig(ConfigKey<T> key)
Gets the given configuration value for this entity, which may be inherited from its parent.


invoke

<T> Task<T> invoke(Effector<T> eff,
                   Map<String,?> parameters)
Invokes the given effector, with the given parameters to that effector.



Copyright © 2013. All Rights Reserved.