|
Brooklyn | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | METHOD | DETAIL: FIELD | METHOD |
brooklyn.entity.Entity brooklyn.entity.trait.Configurable brooklyn.entity.basic.EntityLocal brooklyn.entity.rebind.Rebindable
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, T>) 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)
Emits a SensorEvent event on behalf of this entity (as though produced by this entity). |
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)
@deprecated in 0.5; use getConfig(HasConfigKey) |
ExecutionContext
|
getExecutionContext()
@return The task execution context for the entity, or null if it is not yet managed. |
ManagementContext
|
getManagementContext()
@return The management context for the entity, or null if it is not yet managed. |
boolean
|
removeAllEnrichers()
Removes all enricher from this entity. |
boolean
|
removeAllPolicies()
Removes all policy from this entity. |
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)
Allow us to subscribe to data from a Sensor on another entity. |
SubscriptionHandle
|
subscribeToChildren(Entity parent, Sensor sensor, SensorEventListener listener)
@see SubscriptionManager#subscribeToChildren(Map, Entity, Sensor, SensorEventListener) |
SubscriptionHandle
|
subscribeToMembers(Group group, Sensor sensor, SensorEventListener listener)
@see SubscriptionManager#subscribeToMembers(Group, Sensor, SensorEventListener) |
boolean
|
unsubscribe(Entity producer)
Unsubscribes from the given producer. |
boolean
|
unsubscribe(Entity producer, SubscriptionHandle handle)
Unsubscribes the given handle. |
Methods inherited from interface Entity | |
---|---|
addChild, addChild, addEnricher, addGroup, addOwnedChild, addPolicy, clearOwner, clearParent, getApplication, getApplicationId, getAttribute, getChildren, getConfig, getDisplayName, getEnrichers, getEntityType, getGroups, getId, getLocations, getOwnedChildren, getOwner, getParent, getPolicies, getRebindSupport, invoke, removeChild, removeEnricher, removeOwnedChild, removePolicy, setOwner, setParent |
Methods inherited from interface Configurable | |
---|---|
setConfig |
Method Detail |
---|
public void emit(Sensor sensor, java.lang.Object value)
Note that for attribute sensors it is nearly always recommended to use setAttribute, as this method will not update local values.
public java.lang.Object getConfig(ConfigKey key, java.lang.Object defaultValue)
// * T val = getConfig(KEY.getConfigKey()); // * if (val != null) { // * setAttribute(KEY, val) // * } // *// * // *
public java.lang.Object getConfig(HasConfigKey key)
public java.lang.Object getConfig(HasConfigKey key, java.lang.Object defaultValue)
public ExecutionContext getExecutionContext()
public ManagementContext getManagementContext()
public boolean removeAllEnrichers()
public boolean removeAllPolicies()
public java.lang.Object setAttribute(AttributeSensor sensor, java.lang.Object val)
public java.lang.Object setConfig(ConfigKey key, java.lang.Object val)
public java.lang.Object setConfig(ConfigKey key, Task val)
public java.lang.Object setConfig(HasConfigKey key, java.lang.Object val)
public java.lang.Object setConfig(HasConfigKey key, Task val)
public void setDisplayName(java.lang.String displayName)
@Beta public SubscriptionHandle subscribe(Entity producer, Sensor sensor, SensorEventListener listener)
@Beta public SubscriptionHandle subscribeToChildren(Entity parent, Sensor sensor, SensorEventListener listener)
@Beta public SubscriptionHandle subscribeToMembers(Group group, Sensor sensor, SensorEventListener listener)
@Beta public boolean unsubscribe(Entity producer)
@Beta public boolean unsubscribe(Entity producer, SubscriptionHandle handle)
Brooklyn Multi-Cloud Application Management Platform
brooklyncentral.github.com. Apache License. © 2012.