Class CollectionAttributeWrapper
- java.lang.Object
-
- org.opennms.netmgt.collection.support.CollectionAttributeWrapper
-
- All Implemented Interfaces:
CollectionAttribute,CollectionVisitable,Persistable
public class CollectionAttributeWrapper extends Object implements CollectionAttribute
Delegates the visit calls to the wrapped attribute. Allows individual functions to be intercepted.- Author:
- jwhite
-
-
Constructor Summary
Constructors Constructor Description CollectionAttributeWrapper(CollectionAttribute wrapped)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CollectionAttributeTypegetAttributeType()Return the attribute type for this attribute.StringgetMetricIdentifier()Get the metric identifier for the attribute to be used for NRTG collectionStringgetName()Gets the name of the attributeNumbergetNumericValue()Get the numeric value of the attribute.CollectionResourcegetResource()getResourceStringgetStringValue()Get the value of the attribute as a String.AttributeTypegetType()The type of metric that the attribute represents.booleanshouldPersist(ServiceParameters params)Determines whether the attribute should be persisted.voidstoreAttribute(Persister persister)Stores the attribute using the persister.voidvisit(CollectionSetVisitor visitor)Provide a way to visit all the values in the CollectionSet, for any appropriate purposes (persisting, thresholding, or others) The expectation is that calling this method will ultimately call visitResource, visitGroup and visitAttribute (as appropriate)
-
-
-
Constructor Detail
-
CollectionAttributeWrapper
public CollectionAttributeWrapper(CollectionAttribute wrapped)
-
-
Method Detail
-
visit
public void visit(CollectionSetVisitor visitor)
Provide a way to visit all the values in the CollectionSet, for any appropriate purposes (persisting, thresholding, or others) The expectation is that calling this method will ultimately call visitResource, visitGroup and visitAttribute (as appropriate)- Specified by:
visitin interfaceCollectionVisitable- Parameters:
visitor- aCollectionSetVisitorobject.
-
shouldPersist
public boolean shouldPersist(ServiceParameters params)
Determines whether the attribute should be persisted.- Specified by:
shouldPersistin interfacePersistable- Parameters:
params- aServiceParametersobject.- Returns:
- a boolean.
-
getResource
public CollectionResource getResource()
getResource
- Specified by:
getResourcein interfaceCollectionAttribute- Returns:
- a
org.opennms.netmgt.config.collector.CollectionResourceobject.
-
getStringValue
public String getStringValue()
Get the value of the attribute as a String.- Specified by:
getStringValuein interfaceCollectionAttribute- Returns:
- a String representing the attribute value
-
getNumericValue
public Number getNumericValue()
Get the numeric value of the attribute.- Specified by:
getNumericValuein interfaceCollectionAttribute- Returns:
- a
Numberobject.
-
getName
public String getName()
Gets the name of the attribute- Specified by:
getNamein interfaceCollectionAttribute- Returns:
- a name
-
getMetricIdentifier
public String getMetricIdentifier()
Get the metric identifier for the attribute to be used for NRTG collection- Specified by:
getMetricIdentifierin interfaceCollectionAttribute- Returns:
- the metric identifier
-
storeAttribute
public void storeAttribute(Persister persister)
Stores the attribute using the persister. Not sure this should be here...- Specified by:
storeAttributein interfaceCollectionAttribute- Parameters:
persister- aorg.opennms.netmgt.collectd.Persisterobject.
-
getAttributeType
public CollectionAttributeType getAttributeType()
Return the attribute type for this attribute. Not sure what an CollectionAttributeType is yet... please fill in if you do know- Specified by:
getAttributeTypein interfaceCollectionAttribute- Returns:
- a
org.opennms.netmgt.collectd.CollectionAttributeTypeobject.
-
getType
public AttributeType getType()
The type of metric that the attribute represents.
- Specified by:
getTypein interfaceCollectionAttribute- Returns:
- a
AttributeTypeobject.
-
-