Brooklyn

brooklyn.entity.basic
[Java] Interface EntityLocal

brooklyn.entity.rebind.Rebindable
  brooklyn.entity.Entity
      brooklyn.entity.basic.EntityLocal
          brooklyn.entity.trait.Identifiable
              brooklyn.entity.trait.Configurable
All Superinterfaces:
Rebindable, Entity, Identifiable, Configurable

public interface EntityLocal
extends Configurable, Entity

Extended Entity interface for use in places where the caller should have certain privileges, such as setting attribute values, adding policies, etc. FIXME Moved from core project to api project because of bug in groovy's covariant return types. EntityDriver needs to return EntityLocal rather than Entity, to avoid changing a whole load of sub-types. FIXME Add setAttribute(AttributeSensorAndConfigKey) back in if/when move it back, or if we extract an interface for AttributeSensorAndConfigKey.


Method Summary
void emit(Sensor sensor, java.lang.Object value)

@see SubscriptionManager#subscribeToChildren(Map, Entity, Sensor, SensorEventListener)

java.lang.Object getConfig(ConfigKey key, java.lang.Object defaultValue)

sets the value of the given attribute sensor from the config key value herein, // * if the config key resolves to a non-null value as a sensor // * // * @deprecated since 0.5; use setAttribute(AttributeSensor, Object), such as // *

//     * T val = getConfig(KEY.getConfigKey());
//     * if (val !

java.lang.Object getConfig(HasConfigKey key)

java.lang.Object getConfig(HasConfigKey key, java.lang.Object defaultValue)

ExecutionContext getExecutionContext()

ManagementContext getManagementContext()

boolean removeAllEnrichers()

boolean removeAllPolicies()

@return The task execution context for the entity, or null if it is not yet managed.

java.lang.Object setAttribute(AttributeSensor sensor, java.lang.Object val)

Sets the Sensor data for the given attribute to the specified value.

java.lang.Object setConfig(ConfigKey key, java.lang.Object val)

Must be called before the entity is managed.

java.lang.Object setConfig(ConfigKey key, Task val)

java.lang.Object setConfig(HasConfigKey key, java.lang.Object val)

java.lang.Object setConfig(HasConfigKey key, Task val)

void setDisplayName(java.lang.String displayName)

Sets the entity's display name.

SubscriptionHandle subscribe(Entity producer, Sensor sensor, SensorEventListener listener)

@see SubscriptionManager#subscribeToMembers(Group, Sensor, SensorEventListener)

SubscriptionHandle subscribeToChildren(Entity parent, Sensor sensor, SensorEventListener listener)

SubscriptionHandle subscribeToMembers(Group group, Sensor sensor, SensorEventListener listener)

boolean unsubscribe(Entity producer)

Removes all policy from this entity.

boolean unsubscribe(Entity producer, SubscriptionHandle handle)

 
Methods inherited from interface Entity
addChild, addChild, addEnricher, addGroup, addPolicy, clearParent, getApplication, getApplicationId, getAttribute, getChildren, getConfig, getConfig, getCreationTime, getDisplayName, getEnrichers, getEntityType, getGroups, getIconUrl, getId, getLocations, getParent, getPolicies, getRebindSupport, invoke, removeChild, removeEnricher, removePolicy, setParent
 
Methods inherited from interface Configurable
setConfig
 

Method Detail

emit

public void emit(Sensor sensor, java.lang.Object value)
See Also:
SubscriptionManager#subscribeToChildren(Map, Entity, Sensor, SensorEventListener)#subscribeToChildren(Map, Entity, Sensor, SensorEventListener)


getConfig

public java.lang.Object getConfig(ConfigKey key, java.lang.Object defaultValue)
sets the value of the given attribute sensor from the config key value herein, // * if the config key resolves to a non-null value as a sensor // * // *
deprecated:
since 0.5; use setAttribute(AttributeSensor, Object), such as // *
//     * T val = getConfig(KEY.getConfigKey());
//     * if (val != null) {
//     *     setAttribute(KEY, val)
//     * }
//     * 
// * // *
Returns:
old value //


getConfig

public java.lang.Object getConfig(HasConfigKey key)


getConfig

public java.lang.Object getConfig(HasConfigKey key, java.lang.Object defaultValue)


getExecutionContext

public ExecutionContext getExecutionContext()


getManagementContext

public ManagementContext getManagementContext()


removeAllEnrichers

public boolean removeAllEnrichers()


removeAllPolicies

public boolean removeAllPolicies()
deprecated:
since 0.5.0; access via EntityInternal#getExecutionContext()#getExecutionContext().
Returns:
The task execution context for the entity, or null if it is not yet managed.


setAttribute

public java.lang.Object setAttribute(AttributeSensor sensor, java.lang.Object val)
Sets the Sensor data for the given attribute to the specified value. This can be used to "enrich" the entity, such as adding aggregated information, rolling averages, etc.
Returns:
the old value for the attribute (possibly null)


setConfig

public java.lang.Object setConfig(ConfigKey key, java.lang.Object val)
Must be called before the entity is managed.


setConfig

public java.lang.Object setConfig(ConfigKey key, Task val)


setConfig

public java.lang.Object setConfig(HasConfigKey key, java.lang.Object val)


setConfig

public java.lang.Object setConfig(HasConfigKey key, Task val)


setDisplayName

public void setDisplayName(java.lang.String displayName)
Sets the entity's display name. Must be called before the entity is managed.


subscribe

*/
public SubscriptionHandle subscribe(Entity producer, Sensor sensor, SensorEventListener listener)
See Also:
SubscriptionManager#subscribeToMembers(Group, Sensor, SensorEventListener)#subscribeToMembers(Group, Sensor, SensorEventListener)


subscribeToChildren

*
public SubscriptionHandle subscribeToChildren(Entity parent, Sensor sensor, SensorEventListener listener)


subscribeToMembers

/**
public SubscriptionHandle subscribeToMembers(Group group, Sensor sensor, SensorEventListener listener)


unsubscribe

* Use with caution as some entities automatically register enrichers; this will remove those enrichers as well.
public boolean unsubscribe(Entity producer)
Removes all policy from this entity.
Returns:
True if any policies existed at this entity; false otherwise


unsubscribe

*/
public boolean unsubscribe(Entity producer, SubscriptionHandle handle)


 

Brooklyn Multi-Cloud Application Management Platform
brooklyncentral.github.com. Apache License. © 2012.