Package org.opennms.netmgt.collectd
Class SnmpAttributeType
- java.lang.Object
-
- org.opennms.netmgt.collection.support.AbstractCollectionAttributeType
-
- org.opennms.netmgt.collectd.SnmpAttributeType
-
- All Implemented Interfaces:
CollectionAttributeType
- Direct Known Subclasses:
HexStringAttributeType
,MibPropertyAttributeType
,NumericAttributeType
,StringAttributeType
public abstract class SnmpAttributeType extends AbstractCollectionAttributeType
Represents an OID to be collected (it might be specific or an indexed object). Also specific to a collection (e.g.: "default"), resource type (e.g.: node or interface), and attribute group (data collection group name, e.g.: "mib2-interfaces"). This is extended to create concrete classes that represent specific types of data to be stored such as numeric data ({@link (NumericAttributeType)}) or string data ({@link (StringAttributeType)}).- Version:
- $Id: $
- Author:
- ranger
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
SnmpAttributeType(ResourceType resourceType, java.lang.String collectionName, MibObject mibObj, AttributeGroupType groupType)
Constructor for SnmpAttributeType.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static SnmpAttributeType
create(ResourceType resourceType, java.lang.String collectionName, MibObject mibObj, AttributeGroupType groupType)
createboolean
equals(java.lang.Object obj)
equalsjava.lang.String
getAlias()
getAliasprotected java.lang.String
getCollectionName()
getCollectionNamestatic java.util.List<Collectable>
getCollectionTrackers(java.util.Collection<SnmpAttributeType> objList)
getCollectionTrackersjava.lang.String
getGroupIfType()
getGroupIfTypejava.lang.String
getGroupName()
getGroupNamejava.lang.String
getInstance()
getInstancejava.lang.String
getName()
getNamejava.lang.String
getOid()
getOidResourceType
getResourceType()
getResourceTypeint
hashCode()
hashCodeboolean
matches(SnmpObjId base, SnmpInstId inst)
matchesabstract void
storeAttribute(CollectionAttribute attribute, Persister persister)
storeAttributevoid
storeResult(SnmpCollectionSet collectionSet, SNMPCollectorEntry entry, SnmpResult res)
storeResultjava.lang.String
toString()
toString-
Methods inherited from class org.opennms.netmgt.collection.support.AbstractCollectionAttributeType
getGroupType
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.opennms.netmgt.collection.api.CollectionAttributeType
getType
-
-
-
-
Field Detail
-
m_mibObj
protected final MibObject m_mibObj
-
-
Constructor Detail
-
SnmpAttributeType
protected SnmpAttributeType(ResourceType resourceType, java.lang.String collectionName, MibObject mibObj, AttributeGroupType groupType)
Constructor for SnmpAttributeType.
- Parameters:
resourceType
- aResourceType
object.collectionName
- aString
object.mibObj
- aMibObject
object.groupType
- aAttributeGroupType
object.
-
-
Method Detail
-
getCollectionName
protected java.lang.String getCollectionName()
getCollectionName
- Returns:
- a
String
object.
-
getCollectionTrackers
public static java.util.List<Collectable> getCollectionTrackers(java.util.Collection<SnmpAttributeType> objList)
getCollectionTrackers
- Parameters:
objList
- aCollection
object.- Returns:
- a
List
object.
-
create
public static SnmpAttributeType create(ResourceType resourceType, java.lang.String collectionName, MibObject mibObj, AttributeGroupType groupType)
create
- Parameters:
resourceType
- aResourceType
object.collectionName
- aString
object.mibObj
- aMibObject
object.groupType
- aAttributeGroupType
object.- Returns:
- a
SnmpAttributeType
object.
-
getResourceType
public ResourceType getResourceType()
getResourceType
- Returns:
- a
ResourceType
object.
-
getGroupName
public java.lang.String getGroupName()
getGroupName
- Returns:
- a
String
object.
-
getAlias
public java.lang.String getAlias()
getAlias
- Returns:
- a
String
object.
-
getOid
public java.lang.String getOid()
getOid
- Returns:
- a
String
object.
-
getInstance
public java.lang.String getInstance()
getInstance
- Returns:
- a
String
object.
-
getName
public java.lang.String getName()
getName
- Returns:
- a
String
object.
-
storeAttribute
public abstract void storeAttribute(CollectionAttribute attribute, Persister persister)
storeAttribute
- Parameters:
attribute
- aCollectionAttribute
object.persister
- aPersister
object.
-
storeResult
public void storeResult(SnmpCollectionSet collectionSet, SNMPCollectorEntry entry, SnmpResult res)
storeResult
- Parameters:
collectionSet
- aSnmpCollectionSet
object.entry
- aSNMPCollectorEntry
object.res
- aSnmpResult
object.
-
toString
public java.lang.String toString()
toString
- Overrides:
toString
in classjava.lang.Object
- Returns:
- a
String
object.
-
equals
public boolean equals(java.lang.Object obj)
equals
- Specified by:
equals
in interfaceCollectionAttributeType
- Overrides:
equals
in classjava.lang.Object
- Parameters:
obj
- aObject
object.- Returns:
- a boolean.
-
hashCode
public int hashCode()
hashCode
- Specified by:
hashCode
in interfaceCollectionAttributeType
- Overrides:
hashCode
in classjava.lang.Object
- Returns:
- a int.
-
getGroupIfType
public java.lang.String getGroupIfType()
getGroupIfType
- Returns:
- a
String
object.
-
matches
public boolean matches(SnmpObjId base, SnmpInstId inst)
matches
- Parameters:
base
- aSnmpObjId
object.inst
- aSnmpInstId
object.- Returns:
- a boolean.
-
-