|
Brooklyn | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbrooklyn.policy.basic.AbstractEntityAdjunct
brooklyn.enricher.basic.AbstractEnricher
brooklyn.enricher.basic.AbstractAggregatingEnricher
brooklyn.enricher.CustomAggregatingEnricher
public class CustomAggregatingEnricher extends AbstractAggregatingEnricher
Subscribes to events from producers with a sensor of type T, aggregates them with the provided closure and emits the result on the target sensor V.
Field Summary | |
---|---|
protected Function |
aggregator
|
Fields inherited from class AbstractAggregatingEnricher | |
---|---|
defaultValue, target, values |
Fields inherited from class AbstractEntityAdjunct | |
---|---|
_subscriptionTracker, adjunctType, configsInternal, entity, execution, id, leftoverProperties, name |
Constructor Summary | |
CustomAggregatingEnricher(java.util.Map flags, AttributeSensor source, AttributeSensor target, Function aggregator, S defaultIniitalValueForUnreportedSensors)
The valid keys for the flags are: - producers: a collection of entities to be aggregated - allMembers: indicates that should track members of the entity that the aggregator is associated with, to aggregate across all those members |
|
CustomAggregatingEnricher(java.util.Map flags, AttributeSensor source, AttributeSensor target, Function aggregator)
|
|
CustomAggregatingEnricher(AttributeSensor source, AttributeSensor target, Function aggregator, S defaultValue)
|
|
CustomAggregatingEnricher(AttributeSensor source, AttributeSensor target, Function aggregator)
|
|
CustomAggregatingEnricher(java.util.Map flags, AttributeSensor source, AttributeSensor target, groovy.lang.Closure aggregator, S defaultValueForUnreportedSensors)
@param flags |
|
CustomAggregatingEnricher(java.util.Map flags, AttributeSensor source, AttributeSensor target, groovy.lang.Closure aggregator)
|
|
CustomAggregatingEnricher(AttributeSensor source, AttributeSensor target, groovy.lang.Closure aggregator, S defaultValueForUnreportedSensors)
|
|
CustomAggregatingEnricher(AttributeSensor source, AttributeSensor target, groovy.lang.Closure aggregator)
|
Method Summary | |
---|---|
java.lang.Object
|
getAggregate()
|
static CustomAggregatingEnricher
|
newAveragingEnricher(java.util.Map flags, AttributeSensor source, AttributeSensor target, N defaultValueForUnreportedSensors, java.lang.Double valueToReportIfNoSensors)
creates an enricher which averages over all children/members, defaulting to excluding sensors which have not published anything (or published null), and null if there are no sensors; this behaviour can be customised, both default value for sensors, and what to report if no sensors |
static CustomAggregatingEnricher
|
newAveragingEnricher(java.util.Map flags, AttributeSensor source, AttributeSensor target)
@see #newAveragingEnricher(Map, AttributeSensor, AttributeSensor, Number, Double) |
static CustomAggregatingEnricher
|
newAveragingEnricher(java.util.Map flags, AttributeSensor source, AttributeSensor target, java.lang.Number defaultValue)
@see #newAveragingEnricher(Map, AttributeSensor, AttributeSensor, Number, Double) |
static CustomAggregatingEnricher
|
newAveragingEnricher(AttributeSensor source, AttributeSensor target)
@see #newAveragingEnricher(Map, AttributeSensor, AttributeSensor, Number, Double) |
static CustomAggregatingEnricher
|
newEnricher(java.util.Map flags, AttributeSensor source, AttributeSensor target, groovy.lang.Closure aggregator, S defaultVal)
|
static CustomAggregatingEnricher
|
newEnricher(java.util.Map flags, AttributeSensor source, AttributeSensor target, groovy.lang.Closure aggregator)
|
static CustomAggregatingEnricher
|
newEnricher(AttributeSensor source, AttributeSensor target, groovy.lang.Closure aggregator, S defaultVal)
|
static CustomAggregatingEnricher
|
newEnricher(AttributeSensor source, AttributeSensor target, groovy.lang.Closure aggregator)
|
static CustomAggregatingEnricher
|
newEnricher(java.util.Map flags, AttributeSensor source, AttributeSensor target, Function aggregator, S defaultVal)
|
static CustomAggregatingEnricher
|
newEnricher(java.util.Map flags, AttributeSensor source, AttributeSensor target, Function aggregator)
|
static CustomAggregatingEnricher
|
newEnricher(AttributeSensor source, AttributeSensor target, Function aggregator, S defaultVal)
|
static CustomAggregatingEnricher
|
newEnricher(AttributeSensor source, AttributeSensor target, Function aggregator)
|
static CustomAggregatingEnricher
|
newSummingEnricher(java.util.Map flags, AttributeSensor source, AttributeSensor target, N defaultValueForUnreportedSensors, java.lang.Object valueToReportIfNoSensors)
creates an enricher which sums over all children/members, defaulting to excluding sensors which have not published anything (or published null), and null if there are no sensors; this behaviour can be customised, both default value for sensors, and what to report if no sensors |
static CustomAggregatingEnricher
|
newSummingEnricher(java.util.Map flags, AttributeSensor source, AttributeSensor target)
@see newSummingEnricher(Map, AttributeSensor, AttributeSensor, Number, Number) |
static CustomAggregatingEnricher
|
newSummingEnricher(java.util.Map flags, AttributeSensor source, AttributeSensor target, N defaultValue)
@see newSummingEnricher(Map, AttributeSensor, AttributeSensor, Number, Number) |
static CustomAggregatingEnricher
|
newSummingEnricher(AttributeSensor source, AttributeSensor target)
@see newSummingEnricher(Map, AttributeSensor, AttributeSensor, Number, Number) |
static CustomAggregatingEnricher
|
newSummingEnricher(AttributeSensor source, AttributeSensor target, N defaultValue)
@see newSummingEnricher(Map, AttributeSensor, AttributeSensor, Number, Number) |
void
|
onUpdated()
|
Methods inherited from class AbstractAggregatingEnricher | |
---|---|
addProducer, copyOfValues, onEvent, onUpdated, removeProducer, setEntity |
Methods inherited from class AbstractEnricher | |
---|---|
getEnricherType |
Field Detail |
---|
protected final Function aggregator
Constructor Detail |
---|
public CustomAggregatingEnricher(java.util.Map flags, AttributeSensor source, AttributeSensor target, Function aggregator, S defaultIniitalValueForUnreportedSensors)
aggregator
- Aggregates a collection of values, to return a single value for the target sensordefaultIniitalValueForUnreportedSensors
- Default value to populate the collection given to aggregator,
where sensors are null or not present initially, defaults to null (note however that subsequent null reports will put an explicit null)
public CustomAggregatingEnricher(java.util.Map flags, AttributeSensor source, AttributeSensor target, Function aggregator)
public CustomAggregatingEnricher(AttributeSensor source, AttributeSensor target, Function aggregator, S defaultValue)
public CustomAggregatingEnricher(AttributeSensor source, AttributeSensor target, Function aggregator)
@SuppressWarnings("unchecked") public CustomAggregatingEnricher(java.util.Map flags, AttributeSensor source, AttributeSensor target, groovy.lang.Closure aggregator, S defaultValueForUnreportedSensors)
aggregator
- Should take a collection of values and return a single, aggregate value
public CustomAggregatingEnricher(java.util.Map flags, AttributeSensor source, AttributeSensor target, groovy.lang.Closure aggregator)
public CustomAggregatingEnricher(AttributeSensor source, AttributeSensor target, groovy.lang.Closure aggregator, S defaultValueForUnreportedSensors)
public CustomAggregatingEnricher(AttributeSensor source, AttributeSensor target, groovy.lang.Closure aggregator)
Method Detail |
---|
public java.lang.Object getAggregate()
public static CustomAggregatingEnricher newAveragingEnricher(java.util.Map flags, AttributeSensor source, AttributeSensor target, N defaultValueForUnreportedSensors, java.lang.Double valueToReportIfNoSensors)
ortarget) { public static CustomAggregatingEnricher newAveragingEnricher(java.util.Map flags, AttributeSensor source, AttributeSensor target)
ortarget, public static CustomAggregatingEnricher newAveragingEnricher(java.util.Map flags, AttributeSensor source, AttributeSensor target, java.lang.Number defaultValue)
public static CustomAggregatingEnricher newAveragingEnricher(AttributeSensor source, AttributeSensor target)
public static CustomAggregatingEnricher newEnricher(java.util.Map flags, AttributeSensor source, AttributeSensor target, groovy.lang.Closure aggregator, S defaultVal)
public static CustomAggregatingEnricher newEnricher(java.util.Map flags, AttributeSensor source, AttributeSensor target, groovy.lang.Closure aggregator)
public static CustomAggregatingEnricher newEnricher(AttributeSensor source, AttributeSensor target, groovy.lang.Closure aggregator, S defaultVal)
public static CustomAggregatingEnricher newEnricher(AttributeSensor source, AttributeSensor target, groovy.lang.Closure aggregator)
public static CustomAggregatingEnricher newEnricher(java.util.Map flags, AttributeSensor source, AttributeSensor target, Function aggregator, S defaultVal)
public static CustomAggregatingEnricher newEnricher(java.util.Map flags, AttributeSensor source, AttributeSensor target, Function aggregator)
public static CustomAggregatingEnricher newEnricher(AttributeSensor source, AttributeSensor target, Function aggregator, S defaultVal)
public static CustomAggregatingEnricher newEnricher(AttributeSensor source, AttributeSensor target, Function aggregator)
public static CustomAggregatingEnricher newSummingEnricher(java.util.Map flags, AttributeSensor source, AttributeSensor target, N defaultValueForUnreportedSensors, java.lang.Object valueToReportIfNoSensors)
> target) { public static CustomAggregatingEnricher newSummingEnricher(java.util.Map flags, AttributeSensor source, AttributeSensor target)
> target, N defaultValue) { public static CustomAggregatingEnricher newSummingEnricher(java.util.Map flags, AttributeSensor source, AttributeSensor target, N defaultValue)
public static CustomAggregatingEnricher newSummingEnricher(AttributeSensor source, AttributeSensor target)
public static CustomAggregatingEnricher newSummingEnricher(AttributeSensor source, AttributeSensor target, N defaultValue)
@Override public void onUpdated()
Brooklyn Multi-Cloud Application Management Platform
brooklyncentral.github.com. Apache License. © 2012.