org.opennms.netmgt.collectd
Class SnmpAttributeType

java.lang.Object
  extended by org.opennms.netmgt.collectd.SnmpAttributeType
All Implemented Interfaces:
AttributeDefinition, CollectionAttributeType
Direct Known Subclasses:
NumericAttributeType, StringAttributeType

public abstract class SnmpAttributeType
extends Object
implements AttributeDefinition, CollectionAttributeType

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 concreate classes that represent specific types of data to be stored such as numeric data ((NumericAttributeType)) or string data ((StringAttributeType)).

Version:
$Id: $
Author:
ranger

Constructor Summary
protected SnmpAttributeType(ResourceType resourceType, String collectionName, MibObject mibObj, AttributeGroupType groupType)
          Constructor for SnmpAttributeType.
 
Method Summary
static SnmpAttributeType create(ResourceType resourceType, String collectionName, MibObject mibObj, AttributeGroupType groupType)
          create
 boolean equals(Object obj)
          equals
 String getAlias()
          getAlias
protected  String getCollectionName()
          getCollectionName
static List<Collectable> getCollectionTrackers(Collection<SnmpAttributeType> objList)
          getCollectionTrackers
 String getGroupIfType()
          getGroupIfType
 String getGroupName()
          getGroupName
 AttributeGroupType getGroupType()
          getGroupType
 String getInstance()
          getInstance
 String getMaxval()
           
 String getMinval()
           
 String getName()
          getName
 String getOid()
          getOid
 ResourceType getResourceType()
          getResourceType
 String getType()
          getType
 int hashCode()
          hashCode
 ThreadCategory log()
          log
 boolean matches(SnmpObjId base, SnmpInstId inst)
          matches
abstract  void storeAttribute(CollectionAttribute attribute, Persister persister)
          storeAttribute
 void storeResult(SnmpCollectionSet collectionSet, SNMPCollectorEntry entry, SnmpResult res)
          storeResult
 String toString()
          toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SnmpAttributeType

protected SnmpAttributeType(ResourceType resourceType,
                            String collectionName,
                            MibObject mibObj,
                            AttributeGroupType groupType)

Constructor for SnmpAttributeType.

Parameters:
resourceType - a ResourceType object.
collectionName - a String object.
mibObj - a MibObject object.
groupType - a AttributeGroupType object.
Method Detail

getCollectionName

protected String getCollectionName()

getCollectionName

Returns:
a String object.

getCollectionTrackers

public static List<Collectable> getCollectionTrackers(Collection<SnmpAttributeType> objList)

getCollectionTrackers

Parameters:
objList - a Collection object.
Returns:
a List object.

create

public static SnmpAttributeType create(ResourceType resourceType,
                                       String collectionName,
                                       MibObject mibObj,
                                       AttributeGroupType groupType)

create

Parameters:
resourceType - a ResourceType object.
collectionName - a String object.
mibObj - a MibObject object.
groupType - a AttributeGroupType object.
Returns:
a SnmpAttributeType object.

getResourceType

public ResourceType getResourceType()

getResourceType

Returns:
a ResourceType object.

getGroupType

public AttributeGroupType getGroupType()

getGroupType

Specified by:
getGroupType in interface CollectionAttributeType
Returns:
a AttributeGroupType object.

getGroupName

public String getGroupName()

getGroupName

Returns:
a String object.

getMaxval

public String getMaxval()

getMinval

public String getMinval()

getAlias

public String getAlias()

getAlias

Returns:
a String object.

getOid

public String getOid()

getOid

Returns:
a String object.

getInstance

public String getInstance()

getInstance

Returns:
a String object.

getType

public String getType()

getType

Specified by:
getType in interface AttributeDefinition
Returns:
a String object.

getName

public String getName()

getName

Specified by:
getName in interface AttributeDefinition
Returns:
a String object.

storeAttribute

public abstract void storeAttribute(CollectionAttribute attribute,
                                    Persister persister)

storeAttribute

Specified by:
storeAttribute in interface CollectionAttributeType
Parameters:
attribute - a CollectionAttribute object.
persister - a Persister object.

storeResult

public void storeResult(SnmpCollectionSet collectionSet,
                        SNMPCollectorEntry entry,
                        SnmpResult res)

storeResult

Parameters:
collectionSet - a SnmpCollectionSet object.
entry - a SNMPCollectorEntry object.
res - a SnmpResult object.

toString

public String toString()

toString

Overrides:
toString in class Object
Returns:
a String object.

equals

public boolean equals(Object obj)

equals

Specified by:
equals in interface AttributeDefinition
Overrides:
equals in class Object
Parameters:
obj - a Object object.
Returns:
a boolean.

hashCode

public int hashCode()

hashCode

Specified by:
hashCode in interface AttributeDefinition
Overrides:
hashCode in class Object
Returns:
a int.

log

public ThreadCategory log()

log

Returns:
a ThreadCategory object.

getGroupIfType

public String getGroupIfType()

getGroupIfType

Returns:
a String object.

matches

public boolean matches(SnmpObjId base,
                       SnmpInstId inst)

matches

Parameters:
base - a SnmpObjId object.
inst - a SnmpInstId object.
Returns:
a boolean.


Copyright © 2011. All Rights Reserved.