Brooklyn

brooklyn.enricher.basic
[Java] Class Aggregator

java.lang.Object
  brooklyn.policy.basic.AbstractEntityAdjunct
      brooklyn.enricher.basic.AbstractEnricher
          brooklyn.enricher.basic.Aggregator
All Implemented Interfaces:
SensorEventListener

public class Aggregator
extends AbstractEnricher

Field Summary
static ConfigKey DEFAULT_MEMBER_VALUE

static ConfigKey ENTITY_FILTER

static ConfigKey FROM_CHILDREN

static ConfigKey FROM_HARDCODED_PRODUCERS

static ConfigKey FROM_MEMBERS

static ConfigKey PRODUCER

static ConfigKey SOURCE_SENSOR

static ConfigKey TARGET_SENSOR

static ConfigKey TRANSFORMATION

static ConfigKey VALUE_FILTER

protected java.lang.Object defaultMemberValue

protected Predicate entityFilter

protected java.lang.Boolean fromChildren

protected java.util.Set fromHardcodedProducers

protected java.lang.Boolean fromMembers

protected Entity producer

protected Sensor sourceSensor

protected Sensor targetSensor

protected Function transformation

protected Predicate valueFilter

protected java.util.Map values

Users of values should either on it synchronize when iterating over its entries or use copyOfValues to obtain an immutable copy of the map.

 
Fields inherited from class AbstractEntityAdjunct
_subscriptionTracker, adjunctType, configsInternal, entity, execution, id, leftoverProperties, name
 
Constructor Summary
Aggregator()

 
Method Summary
protected void addProducer(Entity producer)

java.lang.Object compute()

protected java.util.Map copyOfValues()

void onEvent(SensorEvent event)

protected void onProducerAdded(Entity producer)

protected void onProducerAdded(Entity producer, boolean update)

protected java.lang.Object onProducerRemoved(Entity producer)

protected void onUpdated()

Called whenever the values for the set of producers changes (e.g. on an event, or on a member added/removed).

protected java.lang.Object removeProducer(Entity producer)

void setEntity(EntityLocal entity)

 
Methods inherited from class AbstractEnricher
getEnricherType
 
Methods inherited from class AbstractEntityAdjunct
check, checkCanSubscribe, checkCanSubscribe, configure, configure, destroy, doReconfigureConfig, emit, getAdjunctType, getAllConfig, getAllSubscriptions, getConfig, getConfigMap, getId, getManagementContext, getName, getRequiredConfig, getSubscriptionTracker, init, isDestroyed, isLegacyConstruction, isRunning, setConfig, setEntity, setId, setManagementContext, setName, subscribe, subscribeToChildren, subscribeToMembers, toString, unsubscribe, unsubscribe
 

Field Detail

DEFAULT_MEMBER_VALUE

public static final ConfigKey DEFAULT_MEMBER_VALUE


ENTITY_FILTER

public static final ConfigKey ENTITY_FILTER


FROM_CHILDREN

public static final ConfigKey FROM_CHILDREN


FROM_HARDCODED_PRODUCERS

public static final ConfigKey FROM_HARDCODED_PRODUCERS


FROM_MEMBERS

public static final ConfigKey FROM_MEMBERS


PRODUCER

public static final ConfigKey PRODUCER


SOURCE_SENSOR

public static final ConfigKey SOURCE_SENSOR


TARGET_SENSOR

public static final ConfigKey TARGET_SENSOR


TRANSFORMATION

public static final ConfigKey TRANSFORMATION


VALUE_FILTER

public static final ConfigKey VALUE_FILTER


defaultMemberValue

protected java.lang.Object defaultMemberValue


entityFilter

protected Predicate entityFilter


fromChildren

protected java.lang.Boolean fromChildren


fromHardcodedProducers

protected java.util.Set fromHardcodedProducers


fromMembers

protected java.lang.Boolean fromMembers


producer

protected Entity producer


sourceSensor

protected Sensor sourceSensor


targetSensor

protected Sensor targetSensor


transformation

protected Function transformation


valueFilter

protected Predicate valueFilter


values

protected final java.util.Map values
Users of values should either on it synchronize when iterating over its entries or use copyOfValues to obtain an immutable copy of the map.


 
Constructor Detail

Aggregator

public Aggregator()


 
Method Detail

addProducer

protected void addProducer(Entity producer)


compute

public java.lang.Object compute()


copyOfValues

protected java.util.Map copyOfValues()


onEvent

@java.lang.Overrideif (LOG.isDebugEnabled()) LOG.debug("{} received event for unknown producer ({}); presumably that producer has recently been removed", this, e);
public void onEvent(SensorEvent event)


onProducerAdded

protected void onProducerAdded(Entity producer)


onProducerAdded

protected void onProducerAdded(Entity producer, boolean update)


onProducerRemoved

protected java.lang.Object onProducerRemoved(Entity producer)


onUpdated

protected void onUpdated()
Called whenever the values for the set of producers changes (e.g. on an event, or on a member added/removed).


removeProducer

protected java.lang.Object removeProducer(Entity producer)


setEntity

@java.lang.SuppressWarnings@Override
@java.lang.Overridepublic void setEntity(EntityLocal entity) {
public void setEntity(EntityLocal entity)


 

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