Class CollectionAttributeWrapper
- java.lang.Object
-
- org.opennms.netmgt.collection.support.CollectionAttributeWrapper
-
- All Implemented Interfaces:
CollectionAttribute
,CollectionVisitable
,Persistable
public class CollectionAttributeWrapper extends java.lang.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 CollectionAttributeType
getAttributeType()
Return the attribute type for this attribute.java.lang.String
getMetricIdentifier()
Get the metric identifier for the attribute to be used for NRTG collectionjava.lang.String
getName()
Gets the name of the attributejava.lang.Number
getNumericValue()
Get the numeric value of the attribute.CollectionResource
getResource()
getResourcejava.lang.String
getStringValue()
Get the value of the attribute as a String.AttributeType
getType()
The type of metric that the attribute represents.boolean
shouldPersist(ServiceParameters params)
Determines whether the attribute should be persisted.void
storeAttribute(Persister persister)
Stores the attribute using the persister.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)
-
-
-
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:
visit
in interfaceCollectionVisitable
- Parameters:
visitor
- aCollectionSetVisitor
object.
-
shouldPersist
public boolean shouldPersist(ServiceParameters params)
Determines whether the attribute should be persisted.- Specified by:
shouldPersist
in interfacePersistable
- Parameters:
params
- aServiceParameters
object.- Returns:
- a boolean.
-
getResource
public CollectionResource getResource()
getResource
- Specified by:
getResource
in interfaceCollectionAttribute
- Returns:
- a
org.opennms.netmgt.config.collector.CollectionResource
object.
-
getStringValue
public java.lang.String getStringValue()
Get the value of the attribute as a String.- Specified by:
getStringValue
in interfaceCollectionAttribute
- Returns:
- a String representing the attribute value
-
getNumericValue
public java.lang.Number getNumericValue()
Get the numeric value of the attribute.- Specified by:
getNumericValue
in interfaceCollectionAttribute
- Returns:
- a
Number
object.
-
getName
public java.lang.String getName()
Gets the name of the attribute- Specified by:
getName
in interfaceCollectionAttribute
- Returns:
- a name
-
getMetricIdentifier
public java.lang.String getMetricIdentifier()
Get the metric identifier for the attribute to be used for NRTG collection- Specified by:
getMetricIdentifier
in 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:
storeAttribute
in interfaceCollectionAttribute
- Parameters:
persister
- aorg.opennms.netmgt.collectd.Persister
object.
-
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:
getAttributeType
in interfaceCollectionAttribute
- Returns:
- a
org.opennms.netmgt.collectd.CollectionAttributeType
object.
-
getType
public AttributeType getType()
The type of metric that the attribute represents.
- Specified by:
getType
in interfaceCollectionAttribute
- Returns:
- a
AttributeType
object.
-
-