org.opennms.netmgt.collectd
Class SnmpAttribute

java.lang.Object
  extended by org.opennms.netmgt.collectd.AbstractCollectionAttribute
      extended by org.opennms.netmgt.collectd.SnmpAttribute
All Implemented Interfaces:
CollectionAttribute
Direct Known Subclasses:
AliasedAttribute

public class SnmpAttribute
extends AbstractCollectionAttribute


Constructor Summary
SnmpAttribute(CollectionResource resource, SnmpAttributeType type, SnmpValue val)
           
 
Method Summary
 boolean equals(Object obj)
           
 SnmpAttributeType getAttributeType()
          Return the attribute type for this attribute.
 String getName()
          Gets the name of the attribute
 String getNumericValue()
          Get the numeric value of the attribute, as a String.
 CollectionResource getResource()
           
 String getStringValue()
          Get the value of the attribute as a String.
 String getType()
          Returns type of value (typically one of "counter", "gauge", "timeticks", "integer", "octetstring" - see NumericAttributeType)
 SnmpValue getValue()
           
 int hashCode()
           
 Category log()
           
 boolean shouldPersist(ServiceParameters params)
          Determines whether the attribute should be persisted.
 void storeAttribute(Persister persister)
          Stores the attribute using the persister.
 String toString()
           
 void visit(CollectionSetVisitor visitor)
          Visit this attribute
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SnmpAttribute

public SnmpAttribute(CollectionResource resource,
                     SnmpAttributeType type,
                     SnmpValue val)
Method Detail

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

visit

public void visit(CollectionSetVisitor visitor)
Description copied from interface: CollectionAttribute
Visit this attribute

Specified by:
visit in interface CollectionAttribute
Overrides:
visit in class AbstractCollectionAttribute

getAttributeType

public SnmpAttributeType getAttributeType()
Description copied from interface: CollectionAttribute
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 interface CollectionAttribute
Specified by:
getAttributeType in class AbstractCollectionAttribute
Returns:

log

public Category log()
Overrides:
log in class AbstractCollectionAttribute

getResource

public CollectionResource getResource()
Specified by:
getResource in interface CollectionAttribute
Specified by:
getResource in class AbstractCollectionAttribute

getValue

public SnmpValue getValue()

storeAttribute

public void storeAttribute(Persister persister)
Description copied from interface: CollectionAttribute
Stores the attribute using the persister. Not sure this should be here...

Specified by:
storeAttribute in interface CollectionAttribute
Overrides:
storeAttribute in class AbstractCollectionAttribute

toString

public String toString()
Overrides:
toString in class Object

getType

public String getType()
Description copied from interface: CollectionAttribute
Returns type of value (typically one of "counter", "gauge", "timeticks", "integer", "octetstring" - see NumericAttributeType)

Returns:
type of value stored in this attribute (SNMP semantics)

shouldPersist

public boolean shouldPersist(ServiceParameters params)
Description copied from interface: CollectionAttribute
Determines whether the attribute should be persisted.

Specified by:
shouldPersist in interface CollectionAttribute
Specified by:
shouldPersist in class AbstractCollectionAttribute
Returns:

getName

public String getName()
Description copied from interface: CollectionAttribute
Gets the name of the attribute

Specified by:
getName in interface CollectionAttribute
Specified by:
getName in class AbstractCollectionAttribute
Returns:
a name

getNumericValue

public String getNumericValue()
Description copied from interface: CollectionAttribute
Get the numeric value of the attribute, as a String. Assumes the underlying value is actually numeric, and will return null if it is not parseable.

Specified by:
getNumericValue in interface CollectionAttribute
Specified by:
getNumericValue in class AbstractCollectionAttribute
Returns:
a string representation of the numeric value of this attribute

getStringValue

public String getStringValue()
Description copied from interface: CollectionAttribute
Get the value of the attribute as a String.

Specified by:
getStringValue in interface CollectionAttribute
Specified by:
getStringValue in class AbstractCollectionAttribute
Returns:
a String representing the attribute value


Copyright © 2009. All Rights Reserved.