Class AbstractCollectionAttribute
- java.lang.Object
-
- org.opennms.netmgt.collection.support.AbstractCollectionAttribute
-
- All Implemented Interfaces:
CollectionAttribute
,CollectionVisitable
,Persistable
- Direct Known Subclasses:
SnmpAttribute
public abstract class AbstractCollectionAttribute extends java.lang.Object implements CollectionAttribute
Abstract AbstractCollectionAttribute class.
- Version:
- $Id: $
- Author:
- ranger
-
-
Field Summary
Fields Modifier and Type Field Description protected CollectionAttributeType
m_attribType
protected CollectionResource
m_resource
-
Constructor Summary
Constructors Constructor Description AbstractCollectionAttribute(CollectionAttributeType attribType, CollectionResource resource)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description CollectionAttributeType
getAttributeType()
getAttributeTypejava.lang.String
getName()
Gets the name of the attributeabstract java.lang.Number
getNumericValue()
getNumericValueCollectionResource
getResource()
getResourceabstract java.lang.String
getStringValue()
getStringValueAttributeType
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)
Since aCollectionAttribute
is a terminal value, we just visit and complete it since it doesn't have any "children".-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.opennms.netmgt.collection.api.CollectionAttribute
getMetricIdentifier
-
-
-
-
Field Detail
-
m_attribType
protected final CollectionAttributeType m_attribType
-
m_resource
protected final CollectionResource m_resource
-
-
Constructor Detail
-
AbstractCollectionAttribute
public AbstractCollectionAttribute(CollectionAttributeType attribType, CollectionResource resource)
-
-
Method Detail
-
getAttributeType
public final CollectionAttributeType getAttributeType()
getAttributeType
- Specified by:
getAttributeType
in interfaceCollectionAttribute
- Returns:
- a
CollectionAttributeType
object.
-
getResource
public final CollectionResource getResource()
Description copied from interface:CollectionAttribute
getResource
- Specified by:
getResource
in interfaceCollectionAttribute
- Returns:
- a
org.opennms.netmgt.config.collector.CollectionResource
object.
-
getName
public final java.lang.String getName()
Description copied from interface:CollectionAttribute
Gets the name of the attribute- Specified by:
getName
in interfaceCollectionAttribute
- Returns:
- a name
-
getType
public final AttributeType getType()
Description copied from interface:CollectionAttribute
The type of metric that the attribute represents.
- Specified by:
getType
in interfaceCollectionAttribute
- Returns:
- a
AttributeType
object.
-
getNumericValue
public abstract java.lang.Number getNumericValue()
getNumericValue
- Specified by:
getNumericValue
in interfaceCollectionAttribute
- Returns:
- a
Number
object.
-
getStringValue
public abstract java.lang.String getStringValue()
getStringValue
- Specified by:
getStringValue
in interfaceCollectionAttribute
- Returns:
- a
String
object.
-
shouldPersist
public boolean shouldPersist(ServiceParameters params)
Description copied from interface:Persistable
Determines whether the attribute should be persisted.- Specified by:
shouldPersist
in interfacePersistable
- Parameters:
params
- aServiceParameters
object.- Returns:
- a boolean.
-
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.
-
visit
public final void visit(CollectionSetVisitor visitor)
Since aCollectionAttribute
is a terminal value, we just visit and complete it since it doesn't have any "children".- Specified by:
visit
in interfaceCollectionVisitable
- Parameters:
visitor
- aCollectionSetVisitor
object.
-
-