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 Object implements CollectionAttribute
Abstract AbstractCollectionAttribute class.
- Version:
- $Id: $
- Author:
- ranger
-
-
Field Summary
Fields Modifier and Type Field Description protected CollectionAttributeTypem_attribTypeprotected CollectionResourcem_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 CollectionAttributeTypegetAttributeType()getAttributeTypeStringgetName()Gets the name of the attributeabstract NumbergetNumericValue()getNumericValueCollectionResourcegetResource()getResourceabstract StringgetStringValue()getStringValueAttributeTypegetType()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)Since aCollectionAttributeis 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:
getAttributeTypein interfaceCollectionAttribute- Returns:
- a
CollectionAttributeTypeobject.
-
getResource
public final CollectionResource getResource()
Description copied from interface:CollectionAttributegetResource
- Specified by:
getResourcein interfaceCollectionAttribute- Returns:
- a
org.opennms.netmgt.config.collector.CollectionResourceobject.
-
getName
public final String getName()
Description copied from interface:CollectionAttributeGets the name of the attribute- Specified by:
getNamein interfaceCollectionAttribute- Returns:
- a name
-
getType
public final AttributeType getType()
Description copied from interface:CollectionAttributeThe type of metric that the attribute represents.
- Specified by:
getTypein interfaceCollectionAttribute- Returns:
- a
AttributeTypeobject.
-
getNumericValue
public abstract Number getNumericValue()
getNumericValue
- Specified by:
getNumericValuein interfaceCollectionAttribute- Returns:
- a
Numberobject.
-
getStringValue
public abstract String getStringValue()
getStringValue
- Specified by:
getStringValuein interfaceCollectionAttribute- Returns:
- a
Stringobject.
-
shouldPersist
public boolean shouldPersist(ServiceParameters params)
Description copied from interface:PersistableDetermines whether the attribute should be persisted.- Specified by:
shouldPersistin interfacePersistable- Parameters:
params- aServiceParametersobject.- Returns:
- a boolean.
-
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.
-
visit
public final void visit(CollectionSetVisitor visitor)
Since aCollectionAttributeis a terminal value, we just visit and complete it since it doesn't have any "children".- Specified by:
visitin interfaceCollectionVisitable- Parameters:
visitor- aCollectionSetVisitorobject.
-
-