You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@brooklyn.apache.org by sv...@apache.org on 2017/03/15 13:07:36 UTC
[2/4] brooklyn-server git commit: Format enrichers to make them
easier to read on screens that aren't enormous
Format enrichers to make them easier to read on screens that aren't enormous
Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo
Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/786b9388
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/786b9388
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/786b9388
Branch: refs/heads/master
Commit: 786b9388f5e293dc62ca8e02e00cc2ec27110977
Parents: 8cdca1b
Author: Sam Corbett <sa...@cloudsoftcorp.com>
Authored: Mon Mar 13 10:45:41 2017 +0000
Committer: Sam Corbett <sa...@cloudsoftcorp.com>
Committed: Mon Mar 13 10:48:13 2017 +0000
----------------------------------------------------------------------
.../core/enricher/AbstractEnricher.java | 5 ++-
.../enricher/stock/AbstractAggregator.java | 44 +++++++++++++-------
.../enricher/stock/AbstractTransformer.java | 9 ++--
.../brooklyn/enricher/stock/Aggregator.java | 24 +++++++----
.../apache/brooklyn/enricher/stock/Joiner.java | 33 +++++++++++----
.../brooklyn/enricher/stock/Propagator.java | 16 ++++---
.../brooklyn/enricher/stock/Transformer.java | 9 ++--
.../enricher/stock/reducer/Reducer.java | 22 ++++++----
8 files changed, 108 insertions(+), 54 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/786b9388/core/src/main/java/org/apache/brooklyn/core/enricher/AbstractEnricher.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/brooklyn/core/enricher/AbstractEnricher.java b/core/src/main/java/org/apache/brooklyn/core/enricher/AbstractEnricher.java
index 5471c78..f957b18 100644
--- a/core/src/main/java/org/apache/brooklyn/core/enricher/AbstractEnricher.java
+++ b/core/src/main/java/org/apache/brooklyn/core/enricher/AbstractEnricher.java
@@ -45,8 +45,9 @@ import com.google.common.collect.Maps;
*/
public abstract class AbstractEnricher extends AbstractEntityAdjunct implements Enricher {
- public static final ConfigKey<Boolean> SUPPRESS_DUPLICATES = ConfigKeys.newBooleanConfigKey("enricher.suppressDuplicates",
- "Whether duplicate values published by this enricher should be suppressed");
+ public static final ConfigKey<Boolean> SUPPRESS_DUPLICATES = ConfigKeys.newBooleanConfigKey(
+ "enricher.suppressDuplicates",
+ "Whether duplicate values published by this enricher should be suppressed");
private final EnricherDynamicType enricherType;
protected Boolean suppressDuplicates;
http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/786b9388/core/src/main/java/org/apache/brooklyn/enricher/stock/AbstractAggregator.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/brooklyn/enricher/stock/AbstractAggregator.java b/core/src/main/java/org/apache/brooklyn/enricher/stock/AbstractAggregator.java
index 2ba494b..be80772 100644
--- a/core/src/main/java/org/apache/brooklyn/enricher/stock/AbstractAggregator.java
+++ b/core/src/main/java/org/apache/brooklyn/enricher/stock/AbstractAggregator.java
@@ -50,25 +50,37 @@ public abstract class AbstractAggregator<T,U> extends AbstractEnricher implement
private static final Logger LOG = LoggerFactory.getLogger(AbstractAggregator.class);
- public static final ConfigKey<Entity> PRODUCER = ConfigKeys.newConfigKey(Entity.class, "enricher.producer", "The entity whose children/members will be aggregated");
+ public static final ConfigKey<Entity> PRODUCER = ConfigKeys.newConfigKey(Entity.class,
+ "enricher.producer", "The entity whose children/members will be aggregated");
- public static final ConfigKey<Sensor<?>> TARGET_SENSOR = ConfigKeys.newConfigKey(new TypeToken<Sensor<?>>() {}, "enricher.targetSensor");
+ public static final ConfigKey<Sensor<?>> TARGET_SENSOR = ConfigKeys.newConfigKey(new TypeToken<Sensor<?>>() {},
+ "enricher.targetSensor");
// FIXME this is not just for "members" i think -Alex
- public static final ConfigKey<?> DEFAULT_MEMBER_VALUE = ConfigKeys.newConfigKey(Object.class, "enricher.defaultMemberValue");
-
- public static final ConfigKey<Set<? extends Entity>> FROM_HARDCODED_PRODUCERS = ConfigKeys.newConfigKey(new TypeToken<Set<? extends Entity>>() {}, "enricher.aggregating.fromHardcodedProducers");
-
- public static final ConfigKey<Boolean> FROM_MEMBERS = ConfigKeys.newBooleanConfigKey("enricher.aggregating.fromMembers",
- "Whether this enricher looks at members; only supported if a Group producer is supplier; defaults to true for Group entities");
-
- public static final ConfigKey<Boolean> FROM_CHILDREN = ConfigKeys.newBooleanConfigKey("enricher.aggregating.fromChildren",
- "Whether this enricher looks at children; this is the default for non-Group producers");
-
- public static final ConfigKey<Predicate<? super Entity>> ENTITY_FILTER = ConfigKeys.newConfigKey(new TypeToken<Predicate<? super Entity>>() {}, "enricher.aggregating.entityFilter");
-
- public static final ConfigKey<Predicate<?>> VALUE_FILTER = ConfigKeys.newConfigKey(new TypeToken<Predicate<?>>() {}, "enricher.aggregating.valueFilter");
- public static final ConfigKey<Boolean> EXCLUDE_BLANK = ConfigKeys.newBooleanConfigKey("enricher.aggregator.excludeBlank", "Whether explicit nulls or blank strings should be excluded (default false); may only apply if no value filter set", false);
+ public static final ConfigKey<?> DEFAULT_MEMBER_VALUE = ConfigKeys.newConfigKey(Object.class,
+ "enricher.defaultMemberValue");
+
+ public static final ConfigKey<Set<? extends Entity>> FROM_HARDCODED_PRODUCERS = ConfigKeys.newConfigKey(new TypeToken<Set<? extends Entity>>() {},
+ "enricher.aggregating.fromHardcodedProducers");
+
+ public static final ConfigKey<Boolean> FROM_MEMBERS = ConfigKeys.newBooleanConfigKey(
+ "enricher.aggregating.fromMembers",
+ "Whether this enricher looks at members; only supported if a Group producer is supplier; " +
+ "defaults to true for Group entities");
+
+ public static final ConfigKey<Boolean> FROM_CHILDREN = ConfigKeys.newBooleanConfigKey(
+ "enricher.aggregating.fromChildren",
+ "Whether this enricher looks at children; this is the default for non-Group producers");
+
+ public static final ConfigKey<Predicate<? super Entity>> ENTITY_FILTER = ConfigKeys.newConfigKey(new TypeToken<Predicate<? super Entity>>() {},
+ "enricher.aggregating.entityFilter");
+
+ public static final ConfigKey<Predicate<?>> VALUE_FILTER = ConfigKeys.newConfigKey(new TypeToken<Predicate<?>>() {},
+ "enricher.aggregating.valueFilter");
+ public static final ConfigKey<Boolean> EXCLUDE_BLANK = ConfigKeys.newBooleanConfigKey(
+ "enricher.aggregator.excludeBlank",
+ "Whether explicit nulls or blank strings should be excluded (default false); " +
+ "may only apply if no value filter set", false);
protected Entity producer;
protected Sensor<U> targetSensor;
http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/786b9388/core/src/main/java/org/apache/brooklyn/enricher/stock/AbstractTransformer.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/brooklyn/enricher/stock/AbstractTransformer.java b/core/src/main/java/org/apache/brooklyn/enricher/stock/AbstractTransformer.java
index 340095d..35138af 100644
--- a/core/src/main/java/org/apache/brooklyn/enricher/stock/AbstractTransformer.java
+++ b/core/src/main/java/org/apache/brooklyn/enricher/stock/AbstractTransformer.java
@@ -45,11 +45,14 @@ public abstract class AbstractTransformer<T,U> extends AbstractEnricher implemen
private static final Logger LOG = LoggerFactory.getLogger(AbstractTransformer.class);
- public static final ConfigKey<Entity> PRODUCER = ConfigKeys.newConfigKey(Entity.class, "enricher.producer");
+ public static final ConfigKey<Entity> PRODUCER = ConfigKeys.newConfigKey(Entity.class,
+ "enricher.producer");
- public static final ConfigKey<Sensor<?>> SOURCE_SENSOR = ConfigKeys.newConfigKey(new TypeToken<Sensor<?>>() {}, "enricher.sourceSensor");
+ public static final ConfigKey<Sensor<?>> SOURCE_SENSOR = ConfigKeys.newConfigKey(new TypeToken<Sensor<?>>() {},
+ "enricher.sourceSensor");
- public static final ConfigKey<Sensor<?>> TARGET_SENSOR = ConfigKeys.newConfigKey(new TypeToken<Sensor<?>>() {}, "enricher.targetSensor");
+ public static final ConfigKey<Sensor<?>> TARGET_SENSOR = ConfigKeys.newConfigKey(new TypeToken<Sensor<?>>() {},
+ "enricher.targetSensor");
public static final ConfigKey<List<? extends Sensor<?>>> TRIGGER_SENSORS = ConfigKeys.newConfigKey(
new TypeToken<List<? extends Sensor<?>>>() {},
http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/786b9388/core/src/main/java/org/apache/brooklyn/enricher/stock/Aggregator.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/brooklyn/enricher/stock/Aggregator.java b/core/src/main/java/org/apache/brooklyn/enricher/stock/Aggregator.java
index 2dd8a3c..d10b55e 100644
--- a/core/src/main/java/org/apache/brooklyn/enricher/stock/Aggregator.java
+++ b/core/src/main/java/org/apache/brooklyn/enricher/stock/Aggregator.java
@@ -52,20 +52,29 @@ public class Aggregator<T,U> extends AbstractAggregator<T,U> implements SensorEv
private static final Logger LOG = LoggerFactory.getLogger(Aggregator.class);
- public static final ConfigKey<Sensor<?>> SOURCE_SENSOR = ConfigKeys.newConfigKey(new TypeToken<Sensor<?>>() {}, "enricher.sourceSensor");
+ public static final ConfigKey<Sensor<?>> SOURCE_SENSOR = ConfigKeys.newConfigKey(new TypeToken<Sensor<?>>() {},
+ "enricher.sourceSensor");
@SetFromFlag("transformation")
- public static final ConfigKey<Object> TRANSFORMATION_UNTYPED = ConfigKeys.newConfigKey(Object.class, "enricher.transformation.untyped",
- "Specifies a transformation, as a function from a collection to the value, or as a string matching a pre-defined named transformation, "
- + "such as 'average' (for numbers), 'sum' (for numbers), or 'list' (the default, putting any collection of items into a list)");
- public static final ConfigKey<Function<? super Collection<?>, ?>> TRANSFORMATION = ConfigKeys.newConfigKey(new TypeToken<Function<? super Collection<?>, ?>>() {}, "enricher.transformation");
+ public static final ConfigKey<Object> TRANSFORMATION_UNTYPED = ConfigKeys.newConfigKey(Object.class,
+ "enricher.transformation.untyped",
+ "Specifies a transformation, as a function from a collection to the value, or as a string " +
+ "matching a pre-defined named transformation, such as 'average' (for numbers), " +
+ "'sum' (for numbers), 'isQuorate' (to compute a quorum), " +
+ "or 'list' (the default, putting any collection of items into a list)");
+
+ public static final ConfigKey<Function<? super Collection<?>, ?>> TRANSFORMATION = ConfigKeys.newConfigKey(new TypeToken<Function<? super Collection<?>, ?>>() {},
+ "enricher.transformation");
/**
* @see QuorumChecks
*/
- public static final ConfigKey<String> QUORUM_CHECK_TYPE = ConfigKeys.newStringConfigKey("quorum.check.type", "The requirement to be considered quorate -- possible values: 'all', 'allAndAtLeastOne', 'atLeastOne', 'atLeastOneUnlessEmpty', 'alwaysHealthy'", "allAndAtLeastOne");
+ public static final ConfigKey<String> QUORUM_CHECK_TYPE = ConfigKeys.newStringConfigKey(
+ "quorum.check.type", "The requirement to be considered quorate -- possible values: " +
+ "'all', 'allAndAtLeastOne', 'atLeastOne', 'atLeastOneUnlessEmpty', 'alwaysHealthy'", "allAndAtLeastOne");
- public static final ConfigKey<Integer> QUORUM_TOTAL_SIZE = ConfigKeys.newIntegerConfigKey("quorum.total.size", "The total size to consider when determining if quorate", 1);
+ public static final ConfigKey<Integer> QUORUM_TOTAL_SIZE = ConfigKeys.newIntegerConfigKey(
+ "quorum.total.size", "The total size to consider when determining if quorate", 1);
protected Sensor<T> sourceSensor;
protected Function<? super Collection<T>, ? extends U> transformation;
@@ -119,7 +128,6 @@ public class Aggregator<T,U> extends AbstractAggregator<T,U> implements SensorEv
if (input==null) return null;
return MutableList.copyOf(input).asUnmodifiable();
}
-
}
@Override
http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/786b9388/core/src/main/java/org/apache/brooklyn/enricher/stock/Joiner.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/brooklyn/enricher/stock/Joiner.java b/core/src/main/java/org/apache/brooklyn/enricher/stock/Joiner.java
index 175c1df..731d26d 100644
--- a/core/src/main/java/org/apache/brooklyn/enricher/stock/Joiner.java
+++ b/core/src/main/java/org/apache/brooklyn/enricher/stock/Joiner.java
@@ -45,21 +45,36 @@ public class Joiner<T> extends AbstractEnricher implements SensorEventListener<T
private static final Logger LOG = LoggerFactory.getLogger(Joiner.class);
- public static ConfigKey<Entity> PRODUCER = ConfigKeys.newConfigKey(Entity.class, "enricher.producer");
- public static ConfigKey<Sensor<?>> SOURCE_SENSOR = ConfigKeys.newConfigKey(new TypeToken<Sensor<?>>() {}, "enricher.sourceSensor");
- public static ConfigKey<Sensor<?>> TARGET_SENSOR = ConfigKeys.newConfigKey(new TypeToken<Sensor<?>>() {}, "enricher.targetSensor");
+ public static final ConfigKey<Entity> PRODUCER = ConfigKeys.newConfigKey(Entity.class,
+ "enricher.producer");
+ public static final ConfigKey<Sensor<?>> SOURCE_SENSOR = ConfigKeys.newConfigKey(new TypeToken<Sensor<?>>() {},
+ "enricher.sourceSensor");
+ public static final ConfigKey<Sensor<?>> TARGET_SENSOR = ConfigKeys.newConfigKey(new TypeToken<Sensor<?>>() {},
+ "enricher.targetSensor");
@SetFromFlag("separator")
- public static ConfigKey<String> SEPARATOR = ConfigKeys.newStringConfigKey("enricher.joiner.separator", "Separator string to insert between each argument", ",");
+ public static final ConfigKey<String> SEPARATOR = ConfigKeys.newStringConfigKey(
+ "enricher.joiner.separator",
+ "Separator string to insert between each argument", ",");
@SetFromFlag("keyValueSeparator")
- public static ConfigKey<String> KEY_VALUE_SEPARATOR = ConfigKeys.newStringConfigKey("enricher.joiner.keyValueSeparator", "Separator string to insert between each key-value pair", "=");
+ public static final ConfigKey<String> KEY_VALUE_SEPARATOR = ConfigKeys.newStringConfigKey(
+ "enricher.joiner.keyValueSeparator",
+ "Separator string to insert between each key-value pair", "=");
@SetFromFlag("joinMapEntries")
- public static ConfigKey<Boolean> JOIN_MAP_ENTRIES = ConfigKeys.newBooleanConfigKey("enricher.joiner.joinMapEntries", "Whether to add map entries as key-value pairs or just use the value, defaulting to false", false);
+ public static final ConfigKey<Boolean> JOIN_MAP_ENTRIES = ConfigKeys.newBooleanConfigKey(
+ "enricher.joiner.joinMapEntries",
+ "Whether to add map entries as key-value pairs or just use the value, defaulting to false", false);
@SetFromFlag("quote")
- public static ConfigKey<Boolean> QUOTE = ConfigKeys.newBooleanConfigKey("enricher.joiner.quote", "Whether to bash-escape each parameter and wrap in double-quotes, defaulting to true", true);
+ public static final ConfigKey<Boolean> QUOTE = ConfigKeys.newBooleanConfigKey(
+ "enricher.joiner.quote",
+ "Whether to bash-escape each parameter and wrap in double-quotes, defaulting to true", true);
@SetFromFlag("minimum")
- public static ConfigKey<Integer> MINIMUM = ConfigKeys.newIntegerConfigKey("enricher.joiner.minimum", "Minimum number of elements to join; if fewer than this, sets null; default 0 (no minimum)");
+ public static final ConfigKey<Integer> MINIMUM = ConfigKeys.newIntegerConfigKey(
+ "enricher.joiner.minimum",
+ "Minimum number of elements to join; if fewer than this, sets null; default 0 (no minimum)");
@SetFromFlag("maximum")
- public static ConfigKey<Integer> MAXIMUM = ConfigKeys.newIntegerConfigKey("enricher.joiner.maximum", "Maximum number of elements to join; default null means all elements always taken");
+ public static final ConfigKey<Integer> MAXIMUM = ConfigKeys.newIntegerConfigKey(
+ "enricher.joiner.maximum",
+ "Maximum number of elements to join; default null means all elements always taken");
protected Entity producer;
protected AttributeSensor<T> sourceSensor;
http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/786b9388/core/src/main/java/org/apache/brooklyn/enricher/stock/Propagator.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/brooklyn/enricher/stock/Propagator.java b/core/src/main/java/org/apache/brooklyn/enricher/stock/Propagator.java
index e843960..90182a4 100644
--- a/core/src/main/java/org/apache/brooklyn/enricher/stock/Propagator.java
+++ b/core/src/main/java/org/apache/brooklyn/enricher/stock/Propagator.java
@@ -63,21 +63,27 @@ public class Propagator extends AbstractEnricher implements SensorEventListener<
Attributes.SERVICE_STATE_ACTUAL, Attributes.SERVICE_STATE_EXPECTED, Attributes.SERVICE_PROBLEMS);
@SetFromFlag("producer")
- public static ConfigKey<Entity> PRODUCER = ConfigKeys.newConfigKey(Entity.class, "enricher.producer");
+ public static final ConfigKey<Entity> PRODUCER = ConfigKeys.newConfigKey(Entity.class,
+ "enricher.producer");
@SetFromFlag("propagatingAllBut")
- public static ConfigKey<Collection<? extends Sensor<?>>> PROPAGATING_ALL_BUT = ConfigKeys.newConfigKey(
+ public static final ConfigKey<Collection<? extends Sensor<?>>> PROPAGATING_ALL_BUT = ConfigKeys.newConfigKey(
new TypeToken<Collection<? extends Sensor<?>>>() {},
"enricher.propagating.propagatingAllBut");
@SetFromFlag("propagatingAll")
- public static ConfigKey<Boolean> PROPAGATING_ALL = ConfigKeys.newBooleanConfigKey("enricher.propagating.propagatingAll");
+ public static final ConfigKey<Boolean> PROPAGATING_ALL = ConfigKeys.newBooleanConfigKey(
+ "enricher.propagating.propagatingAll");
@SetFromFlag("propagating")
- public static ConfigKey<Collection<? extends Sensor<?>>> PROPAGATING = ConfigKeys.newConfigKey(new TypeToken<Collection<? extends Sensor<?>>>() {}, "enricher.propagating.inclusions");
+ public static final ConfigKey<Collection<? extends Sensor<?>>> PROPAGATING = ConfigKeys.newConfigKey(
+ new TypeToken<Collection<? extends Sensor<?>>>() {},
+ "enricher.propagating.inclusions");
@SetFromFlag("sensorMapping")
- public static ConfigKey<Map<? extends Sensor<?>, ? extends Sensor<?>>> SENSOR_MAPPING = ConfigKeys.newConfigKey(new TypeToken<Map<? extends Sensor<?>, ? extends Sensor<?>>>() {}, "enricher.propagating.sensorMapping");
+ public static final ConfigKey<Map<? extends Sensor<?>, ? extends Sensor<?>>> SENSOR_MAPPING = ConfigKeys.newConfigKey(
+ new TypeToken<Map<? extends Sensor<?>, ? extends Sensor<?>>>() {},
+ "enricher.propagating.sensorMapping");
protected Entity producer;
protected Map<Sensor<?>, Sensor<?>> sensorMapping;
http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/786b9388/core/src/main/java/org/apache/brooklyn/enricher/stock/Transformer.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/brooklyn/enricher/stock/Transformer.java b/core/src/main/java/org/apache/brooklyn/enricher/stock/Transformer.java
index 356e16f..b73ef07 100644
--- a/core/src/main/java/org/apache/brooklyn/enricher/stock/Transformer.java
+++ b/core/src/main/java/org/apache/brooklyn/enricher/stock/Transformer.java
@@ -39,9 +39,12 @@ public class Transformer<T,U> extends AbstractTransformer<T,U> {
private static final Logger LOG = LoggerFactory.getLogger(Transformer.class);
// exactly one of these should be supplied to set a value
- public static final ConfigKey<Object> TARGET_VALUE = ConfigKeys.newConfigKey(Object.class, "enricher.targetValue");
- public static final ConfigKey<Function<?, ?>> TRANSFORMATION_FROM_VALUE = ConfigKeys.newConfigKey(new TypeToken<Function<?, ?>>() {}, "enricher.transformation");
- public static final ConfigKey<Function<?, ?>> TRANSFORMATION_FROM_EVENT = ConfigKeys.newConfigKey(new TypeToken<Function<?, ?>>() {}, "enricher.transformation.fromevent");
+ public static final ConfigKey<Object> TARGET_VALUE = ConfigKeys.newConfigKey(Object.class,
+ "enricher.targetValue");
+ public static final ConfigKey<Function<?, ?>> TRANSFORMATION_FROM_VALUE = ConfigKeys.newConfigKey(new TypeToken<Function<?, ?>>() {},
+ "enricher.transformation");
+ public static final ConfigKey<Function<?, ?>> TRANSFORMATION_FROM_EVENT = ConfigKeys.newConfigKey(new TypeToken<Function<?, ?>>() {},
+ "enricher.transformation.fromevent");
public Transformer() { }
http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/786b9388/core/src/main/java/org/apache/brooklyn/enricher/stock/reducer/Reducer.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/brooklyn/enricher/stock/reducer/Reducer.java b/core/src/main/java/org/apache/brooklyn/enricher/stock/reducer/Reducer.java
index 4c02fb7..9d5ca33 100644
--- a/core/src/main/java/org/apache/brooklyn/enricher/stock/reducer/Reducer.java
+++ b/core/src/main/java/org/apache/brooklyn/enricher/stock/reducer/Reducer.java
@@ -52,15 +52,21 @@ public class Reducer extends AbstractEnricher implements SensorEventListener<Obj
private static final Logger LOG = LoggerFactory.getLogger(Reducer.class);
@SetFromFlag("producer")
- public static ConfigKey<Entity> PRODUCER = ConfigKeys.newConfigKey(Entity.class, "enricher.producer");
- public static ConfigKey<Sensor<?>> TARGET_SENSOR = ConfigKeys.newConfigKey(new TypeToken<Sensor<?>>() {}, "enricher.targetSensor");
- public static ConfigKey<List<? extends AttributeSensor<?>>> SOURCE_SENSORS = ConfigKeys.newConfigKey(new TypeToken<List<? extends AttributeSensor<?>>>() {}, "enricher.sourceSensors");
- public static ConfigKey<Function<List<?>,?>> REDUCER_FUNCTION = ConfigKeys.newConfigKey(new TypeToken<Function<List<?>, ?>>() {}, "enricher.reducerFunction");
+ public static final ConfigKey<Entity> PRODUCER = ConfigKeys.newConfigKey(Entity.class,
+ "enricher.producer");
+ public static final ConfigKey<Sensor<?>> TARGET_SENSOR = ConfigKeys.newConfigKey(new TypeToken<Sensor<?>>() {},
+ "enricher.targetSensor");
+ public static final ConfigKey<List<? extends AttributeSensor<?>>> SOURCE_SENSORS = ConfigKeys.newConfigKey(new TypeToken<List<? extends AttributeSensor<?>>>() {},
+ "enricher.sourceSensors");
+ public static final ConfigKey<Function<List<?>,?>> REDUCER_FUNCTION = ConfigKeys.newConfigKey(new TypeToken<Function<List<?>, ?>>() {},
+ "enricher.reducerFunction");
@SetFromFlag("transformation")
- public static final ConfigKey<String> REDUCER_FUNCTION_TRANSFORMATION = ConfigKeys.newStringConfigKey("enricher.reducerFunction.transformation",
- "A string matching a pre-defined named reducer function, such as joiner");
- public static final ConfigKey<Map<String, Object>> PARAMETERS = ConfigKeys.newConfigKey(new TypeToken<Map<String, Object>>() {}, "enricher.reducerFunction.parameters",
- "A map of parameters to pass into the reducer function");
+ public static final ConfigKey<String> REDUCER_FUNCTION_TRANSFORMATION = ConfigKeys.newStringConfigKey(
+ "enricher.reducerFunction.transformation",
+ "A string matching a pre-defined named reducer function, such as joiner");
+ public static final ConfigKey<Map<String, Object>> PARAMETERS = ConfigKeys.newConfigKey(new TypeToken<Map<String, Object>>() {},
+ "enricher.reducerFunction.parameters",
+ "A map of parameters to pass into the reducer function");
protected Entity producer;
protected List<AttributeSensor<?>> subscribedSensors;