Class AggregatorRegistry
- java.lang.Object
-
- com.tangosol.coherence.rest.util.aggregator.AggregatorRegistry
-
public class AggregatorRegistry extends Object
A registry forAggregatorFactoryinstances.- Author:
- vp 2011.07.07
-
-
Field Summary
Fields Modifier and Type Field Description static StringAGGREGATOR_REQUEST_REGEXRegex pattern that defines the aggregator request syntax.
-
Constructor Summary
Constructors Constructor Description AggregatorRegistry()Construct an AggregatorRegistry.AggregatorRegistry(Collection<AggregatorConfig> colConfig)Construct an AggregatorRegistry that includes built-in aggregators in addition to the specified aggregators.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description InvocableMap.EntryAggregatorgetAggregator(String sRequest)Returns a configured aggregator.voidregister(String sName, AggregatorFactory factory)Register an aggregator factory with the given name.voidregister(String sName, Class clz)Register an aggregator or aggregator factory with the given name.voidregister(Collection<AggregatorConfig> colConfig)Register a collection of aggregators.
-
-
-
Field Detail
-
AGGREGATOR_REQUEST_REGEX
public static final String AGGREGATOR_REQUEST_REGEX
Regex pattern that defines the aggregator request syntax.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
AggregatorRegistry
public AggregatorRegistry()
Construct an AggregatorRegistry.By default the following built-in aggregators will be registered:
- big-decimal-average
- big-decimal-max
- big-decimal-min
- big-decimal-sum
- comparable-max
- comparable-min
- count
- distinct-values
- double-average
- double-max
- double-min
- double-sum
- long-max
- long-min
- long-sum
-
AggregatorRegistry
public AggregatorRegistry(Collection<AggregatorConfig> colConfig)
Construct an AggregatorRegistry that includes built-in aggregators in addition to the specified aggregators.- Parameters:
colConfig- aggregator configurations
-
-
Method Detail
-
getAggregator
public InvocableMap.EntryAggregator getAggregator(String sRequest)
Returns a configured aggregator.- Parameters:
sRequest- the aggregator request- Returns:
- aggregator
-
register
public void register(String sName, AggregatorFactory factory)
Register an aggregator factory with the given name.- Parameters:
sName- the aggregator namefactory- the aggregator factory
-
register
public void register(String sName, Class clz)
Register an aggregator or aggregator factory with the given name.A
DefaultAggregatorFactorywill be used if theclzparameter is a class that implements InvocableMap.EntryAggregator.- Parameters:
sName- the aggregator nameclz- the aggregator or aggregator factory class
-
register
public void register(Collection<AggregatorConfig> colConfig)
Register a collection of aggregators.- Parameters:
colConfig- the aggregator configurations
-
-