Class CollectionSetBuilder
- java.lang.Object
-
- org.opennms.netmgt.collection.support.builder.CollectionSetBuilder
-
public class CollectionSetBuilder extends java.lang.Object
A fluent API for building aCollectionSet
. Many of the existing collectors end up implementing their collections, attributes and resource types. This class is intended to replace those and provide a common means for building the collection sets.- Author:
- jwhite
-
-
Constructor Summary
Constructors Constructor Description CollectionSetBuilder(CollectionAgent agent)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description CollectionSetDTO
build()
CollectionSetBuilder
disableCounterPersistence(boolean disableCounterPersistence)
int
getNumAttributes()
int
getNumResources()
static AbstractCollectionResource
toCollectionResource(Resource resource, CollectionAgent agent)
CollectionSetBuilder
withAttribute(Resource resource, java.lang.String group, java.lang.String name, java.lang.String value, AttributeType type)
CollectionSetBuilder
withCounter(Resource resource, java.lang.String group, java.lang.String name, java.lang.Number value)
CollectionSetBuilder
withGauge(Resource resource, java.lang.String group, java.lang.String name, java.lang.Number value)
CollectionSetBuilder
withIdentifiedNumericAttribute(Resource resource, java.lang.String group, java.lang.String name, java.lang.Number value, AttributeType type, java.lang.String metricId)
CollectionSetBuilder
withIdentifiedStringAttribute(Resource resource, java.lang.String group, java.lang.String name, java.lang.String value, java.lang.String metricId)
CollectionSetBuilder
withNumericAttribute(Resource resource, java.lang.String group, java.lang.String name, java.lang.Number value, AttributeType type)
CollectionSetBuilder
withSequenceNumber(java.lang.Long sequenceNumber)
CollectionSetBuilder
withStatus(CollectionStatus status)
CollectionSetBuilder
withStringAttribute(Resource resource, java.lang.String group, java.lang.String name, java.lang.String value)
CollectionSetBuilder
withTimestamp(java.util.Date timestamp)
-
-
-
Constructor Detail
-
CollectionSetBuilder
public CollectionSetBuilder(CollectionAgent agent)
-
-
Method Detail
-
withStatus
public CollectionSetBuilder withStatus(CollectionStatus status)
-
withTimestamp
public CollectionSetBuilder withTimestamp(java.util.Date timestamp)
-
withGauge
public CollectionSetBuilder withGauge(Resource resource, java.lang.String group, java.lang.String name, java.lang.Number value)
-
withCounter
public CollectionSetBuilder withCounter(Resource resource, java.lang.String group, java.lang.String name, java.lang.Number value)
-
withNumericAttribute
public CollectionSetBuilder withNumericAttribute(Resource resource, java.lang.String group, java.lang.String name, java.lang.Number value, AttributeType type)
-
withStringAttribute
public CollectionSetBuilder withStringAttribute(Resource resource, java.lang.String group, java.lang.String name, java.lang.String value)
-
withIdentifiedNumericAttribute
public CollectionSetBuilder withIdentifiedNumericAttribute(Resource resource, java.lang.String group, java.lang.String name, java.lang.Number value, AttributeType type, java.lang.String metricId)
-
withIdentifiedStringAttribute
public CollectionSetBuilder withIdentifiedStringAttribute(Resource resource, java.lang.String group, java.lang.String name, java.lang.String value, java.lang.String metricId)
-
withAttribute
public CollectionSetBuilder withAttribute(Resource resource, java.lang.String group, java.lang.String name, java.lang.String value, AttributeType type)
-
disableCounterPersistence
public CollectionSetBuilder disableCounterPersistence(boolean disableCounterPersistence)
-
withSequenceNumber
public CollectionSetBuilder withSequenceNumber(java.lang.Long sequenceNumber)
-
build
public CollectionSetDTO build()
-
toCollectionResource
public static AbstractCollectionResource toCollectionResource(Resource resource, CollectionAgent agent)
-
getNumResources
public int getNumResources()
-
getNumAttributes
public int getNumAttributes()
-
-