T
- Enrichers.builder()
public class CustomAggregatingEnricher<S,T> extends AbstractAggregatingEnricher<S,T> implements SensorEventListener<S>
AbstractEntityAdjunct.AdjunctTagSupport
BrooklynObject.TagSupport
Configurable.ConfigurationSupport
BrooklynObjectInternal.ConfigurationSupportInternal
SUPPRESS_DUPLICATES
NOOP
Constructor and Description |
---|
CustomAggregatingEnricher(AttributeSensor<? extends S> source,
AttributeSensor<T> target,
com.google.common.base.Function<java.util.Collection<S>,T> aggregator)
Deprecated.
|
CustomAggregatingEnricher(AttributeSensor<? extends S> source,
AttributeSensor<T> target,
com.google.common.base.Function<java.util.Collection<S>,T> aggregator,
S defaultValue)
Deprecated.
|
CustomAggregatingEnricher(AttributeSensor<S> source,
AttributeSensor<T> target,
groovy.lang.Closure<?> aggregator)
Deprecated.
|
CustomAggregatingEnricher(AttributeSensor<S> source,
AttributeSensor<T> target,
groovy.lang.Closure<?> aggregator,
S defaultValueForUnreportedSensors)
Deprecated.
|
CustomAggregatingEnricher(java.util.Map<java.lang.String,?> flags,
AttributeSensor<? extends S> source,
AttributeSensor<T> target,
groovy.lang.Closure<?> aggregator)
Deprecated.
|
CustomAggregatingEnricher(java.util.Map<java.lang.String,?> flags,
AttributeSensor<? extends S> source,
AttributeSensor<T> target,
groovy.lang.Closure<?> aggregator,
S defaultValueForUnreportedSensors)
Deprecated.
|
CustomAggregatingEnricher(java.util.Map<java.lang.String,?> flags,
AttributeSensor<? extends S> source,
AttributeSensor<T> target,
com.google.common.base.Function<java.util.Collection<S>,T> aggregator)
Deprecated.
|
CustomAggregatingEnricher(java.util.Map<java.lang.String,?> flags,
AttributeSensor<? extends S> source,
AttributeSensor<T> target,
com.google.common.base.Function<java.util.Collection<S>,T> aggregator,
S defaultIniitalValueForUnreportedSensors)
Deprecated.
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.
|
Modifier and Type | Method and Description |
---|---|
T |
getAggregate()
Deprecated.
|
static <N extends java.lang.Number> |
newAveragingEnricher(AttributeSensor<N> source,
AttributeSensor<java.lang.Double> target)
Deprecated.
|
static <N extends java.lang.Number> |
newAveragingEnricher(java.util.Map<java.lang.String,?> flags,
AttributeSensor<? extends N> source,
AttributeSensor<java.lang.Double> target,
N defaultValueForUnreportedSensors,
java.lang.Double valueToReportIfNoSensors)
Deprecated.
since 0.7.0; use
Enrichers.builder() |
static <S,T> CustomAggregatingEnricher<S,T> |
newEnricher(AttributeSensor<S> source,
AttributeSensor<T> target,
groovy.lang.Closure<?> aggregator)
Deprecated.
|
static <S,T> CustomAggregatingEnricher<S,T> |
newEnricher(AttributeSensor<S> source,
AttributeSensor<T> target,
groovy.lang.Closure<?> aggregator,
S defaultVal)
Deprecated.
|
static <S,T> CustomAggregatingEnricher<S,T> |
newEnricher(AttributeSensor<S> source,
AttributeSensor<T> target,
com.google.common.base.Function<java.util.Collection<S>,T> aggregator)
Deprecated.
|
static <S,T> CustomAggregatingEnricher<S,T> |
newEnricher(AttributeSensor<S> source,
AttributeSensor<T> target,
com.google.common.base.Function<java.util.Collection<S>,T> aggregator,
S defaultVal)
Deprecated.
|
static <S,T> CustomAggregatingEnricher<S,T> |
newEnricher(java.util.Map<java.lang.String,?> flags,
AttributeSensor<S> source,
AttributeSensor<T> target,
groovy.lang.Closure<?> aggregator)
Deprecated.
|
static <S,T> CustomAggregatingEnricher<S,T> |
newEnricher(java.util.Map<java.lang.String,?> flags,
AttributeSensor<S> source,
AttributeSensor<T> target,
groovy.lang.Closure<?> aggregator,
S defaultVal)
Deprecated.
since 0.7.0; use
Enrichers.builder() |
static <S,T> CustomAggregatingEnricher<S,T> |
newEnricher(java.util.Map<java.lang.String,?> flags,
AttributeSensor<S> source,
AttributeSensor<T> target,
com.google.common.base.Function<java.util.Collection<S>,T> aggregator)
Deprecated.
|
static <S,T> CustomAggregatingEnricher<S,T> |
newEnricher(java.util.Map<java.lang.String,?> flags,
AttributeSensor<S> source,
AttributeSensor<T> target,
com.google.common.base.Function<java.util.Collection<S>,T> aggregator,
S defaultVal)
Deprecated.
since 0.7.0; use
Enrichers.builder() |
static <N extends java.lang.Number> |
newSummingEnricher(AttributeSensor<N> source,
AttributeSensor<N> target)
Deprecated.
|
static <N extends java.lang.Number,T extends java.lang.Number> |
newSummingEnricher(java.util.Map<java.lang.String,?> flags,
AttributeSensor<N> source,
AttributeSensor<T> target,
N defaultValueForUnreportedSensors,
T valueToReportIfNoSensors)
Deprecated.
since 0.7.0; use
Enrichers.builder() |
void |
onUpdated()
Deprecated.
Called whenever the values for the set of producers changes (e.g.
|
addProducer, onEvent, removeProducer, setEntity
getEnricherType, getRebindSupport
config, configure, destroy, getAllConfig, getConfig, getConfigMap, getDisplayName, getName, getUniqueTag, isDestroyed, isRunning, setConfig, setDisplayName, setName, tags, toString
getCatalogItemId, getId, getManagementContext, getTagSupport, init, rebind, setCatalogItemId, setManagementContext
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
onEvent
getAllConfig, getConfig, getId, getName, setConfig
getUniqueTag, isDestroyed, isRunning
getCatalogItemId, getDisplayName, getTagSupport, tags
config
setCatalogItemId
public CustomAggregatingEnricher(java.util.Map<java.lang.String,?> flags, AttributeSensor<? extends S> source, AttributeSensor<T> target, com.google.common.base.Function<java.util.Collection<S>,T> aggregator, S defaultIniitalValueForUnreportedSensors)
flags
- source
- target
- 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<java.lang.String,?> flags, AttributeSensor<? extends S> source, AttributeSensor<T> target, com.google.common.base.Function<java.util.Collection<S>,T> aggregator)
public CustomAggregatingEnricher(AttributeSensor<? extends S> source, AttributeSensor<T> target, com.google.common.base.Function<java.util.Collection<S>,T> aggregator, S defaultValue)
public CustomAggregatingEnricher(AttributeSensor<? extends S> source, AttributeSensor<T> target, com.google.common.base.Function<java.util.Collection<S>,T> aggregator)
public CustomAggregatingEnricher(java.util.Map<java.lang.String,?> flags, AttributeSensor<? extends S> source, AttributeSensor<T> target, groovy.lang.Closure<?> aggregator, S defaultValueForUnreportedSensors)
flags
- source
- target
- aggregator
- Should take a collection of values and return a single, aggregate valuedefaultValueForUnreportedSensors
- CustomAggregatingEnricher(Map, AttributeSensor, AttributeSensor, Function, Object)
public CustomAggregatingEnricher(java.util.Map<java.lang.String,?> flags, AttributeSensor<? extends S> source, AttributeSensor<T> target, groovy.lang.Closure<?> aggregator)
public CustomAggregatingEnricher(AttributeSensor<S> source, AttributeSensor<T> target, groovy.lang.Closure<?> aggregator, S defaultValueForUnreportedSensors)
public CustomAggregatingEnricher(AttributeSensor<S> source, AttributeSensor<T> target, groovy.lang.Closure<?> aggregator)
public void onUpdated()
AbstractAggregatingEnricher
public T getAggregate()
public static <S,T> CustomAggregatingEnricher<S,T> newEnricher(java.util.Map<java.lang.String,?> flags, AttributeSensor<S> source, AttributeSensor<T> target, groovy.lang.Closure<?> aggregator, S defaultVal)
Enrichers.builder()
Enrichers.Builder builder = Enrichers.builder()
.aggregating(source)
.publishing(target)
.computing(GroovyJavaMethods.<Collection<S>, T>functionFromClosure((Closure<T>)aggregator))
.defaultValueForUnreportedSensors(defaultValueForUnreportedSensors);
if (Boolean.TRUE.equals(allMembers)) builder.fromMembers();
if (filter != null) builder.entityFilter(filter);
if (hardCodedProducers != null) builder.fromHardcodedProducers(hardCodedProducers);
addEnricher(builder.build());
public static <S,T> CustomAggregatingEnricher<S,T> newEnricher(java.util.Map<java.lang.String,?> flags, AttributeSensor<S> source, AttributeSensor<T> target, groovy.lang.Closure<?> aggregator)
public static <S,T> CustomAggregatingEnricher<S,T> newEnricher(AttributeSensor<S> source, AttributeSensor<T> target, groovy.lang.Closure<?> aggregator, S defaultVal)
public static <S,T> CustomAggregatingEnricher<S,T> newEnricher(AttributeSensor<S> source, AttributeSensor<T> target, groovy.lang.Closure<?> aggregator)
public static <S,T> CustomAggregatingEnricher<S,T> newEnricher(java.util.Map<java.lang.String,?> flags, AttributeSensor<S> source, AttributeSensor<T> target, com.google.common.base.Function<java.util.Collection<S>,T> aggregator, S defaultVal)
Enrichers.builder()
Enrichers.Builder builder = Enrichers.builder()
.aggregating(source)
.publishing(target)
.computing(aggregator)
.defaultValueForUnreportedSensors(defaultVal);
if (Boolean.TRUE.equals(allMembers)) builder.fromMembers();
if (filter != null) builder.entityFilter(filter);
if (hardCodedProducers != null) builder.fromHardcodedProducers(hardCodedProducers);
addEnricher(builder.build());
public static <S,T> CustomAggregatingEnricher<S,T> newEnricher(java.util.Map<java.lang.String,?> flags, AttributeSensor<S> source, AttributeSensor<T> target, com.google.common.base.Function<java.util.Collection<S>,T> aggregator)
public static <S,T> CustomAggregatingEnricher<S,T> newEnricher(AttributeSensor<S> source, AttributeSensor<T> target, com.google.common.base.Function<java.util.Collection<S>,T> aggregator, S defaultVal)
public static <S,T> CustomAggregatingEnricher<S,T> newEnricher(AttributeSensor<S> source, AttributeSensor<T> target, com.google.common.base.Function<java.util.Collection<S>,T> aggregator)
public static <N extends java.lang.Number,T extends java.lang.Number> CustomAggregatingEnricher<N,T> newSummingEnricher(java.util.Map<java.lang.String,?> flags, AttributeSensor<N> source, AttributeSensor<T> target, N defaultValueForUnreportedSensors, T valueToReportIfNoSensors)
Enrichers.builder()
Enrichers.Builder builder = Enrichers.builder()
.aggregating(source)
.publishing(target)
.computingSum()
.defaultValueForUnreportedSensors(defaultValueForUnreportedSensors)
.valueToReportIfNoSensors(valueToReportIfNoSensors);
if (Boolean.TRUE.equals(allMembers)) builder.fromMembers();
if (filter != null) builder.entityFilter(filter);
if (hardCodedProducers != null) builder.fromHardcodedProducers(hardCodedProducers);
addEnricher(builder.build());
public static <N extends java.lang.Number> CustomAggregatingEnricher<N,N> newSummingEnricher(AttributeSensor<N> source, AttributeSensor<N> target)
#newSummingEnricher(Map, AttributeSensor, AttributeSensor, Number, Number)}
public static <N extends java.lang.Number> CustomAggregatingEnricher<N,java.lang.Double> newAveragingEnricher(java.util.Map<java.lang.String,?> flags, AttributeSensor<? extends N> source, AttributeSensor<java.lang.Double> target, N defaultValueForUnreportedSensors, java.lang.Double valueToReportIfNoSensors)
Enrichers.builder()
Enrichers.Builder builder = Enrichers.builder()
.aggregating(source)
.publishing(target)
.computingAverage()
.defaultValueForUnreportedSensors(defaultValueForUnreportedSensors)
.valueToReportIfNoSensors(valueToReportIfNoSensors);
if (Boolean.TRUE.equals(allMembers)) builder.fromMembers();
if (filter != null) builder.entityFilter(filter);
if (hardCodedProducers != null) builder.fromHardcodedProducers(hardCodedProducers);
addEnricher(builder.build());
public static <N extends java.lang.Number> CustomAggregatingEnricher<N,java.lang.Double> newAveragingEnricher(AttributeSensor<N> source, AttributeSensor<java.lang.Double> target)