MySnmpCrawler API

snmp.message.datatype
Interface SnmpDatatype

All Superinterfaces:
org.opennms.protocols.snmp.SnmpSyntax
All Known Implementing Classes:
MySnmpCrawlerCounter32, MySnmpCrawlerCounter64, MySnmpCrawlerGauge32, MySnmpCrawlerInt32, MySnmpCrawlerIPAddress, MySnmpCrawlerNull, MySnmpCrawlerObjectId, MySnmpCrawlerOctetString, MySnmpCrawlerOpaque, MySnmpCrawlerTimeTicks

public interface SnmpDatatype
extends org.opennms.protocols.snmp.SnmpSyntax

This interface provides the methods to set the Java object value, get the Java object value, and check the expected Java datatype compatible to SnmpSyntax object. The implemented classes shall support these operations and also comply with the class hierarchy defined in the JoeSNMP API.

Version:
$Revision: 0.1 $ $Date: 2004/03/09 06:03:51 $
Author:
Scott Cheng

Method Summary
 java.lang.String getJavaDataType()
          Gets the string description of the expected java datatype.
 java.lang.Object getJavaDataValue()
          Gets the Java object value corresponding to the the SnmpSyntax object.
 boolean isValidJavaDatatype(java.lang.Class c)
          Checks if the exptected Class type equals to the passed Class object.
 boolean isValidJavaDatatype(java.lang.Object o)
          Checks if the expected datatype of the Java object value matches to the passed Java object value.
 void setSnmpDataValue(java.lang.Object o)
          Sets the Java object value into the SnmpSyntax object.
 
Methods inherited from interface org.opennms.protocols.snmp.SnmpSyntax
decodeASN, duplicate, encodeASN, typeId
 

Method Detail

setSnmpDataValue

public void setSnmpDataValue(java.lang.Object o)
                      throws SnmpException
Sets the Java object value into the SnmpSyntax object.

Parameters:
o - The Java object value.
Throws:
SnmpException - Thrown when the Java object value does not match to the expected datatype in the SnmpSyntax object.

getJavaDataValue

public java.lang.Object getJavaDataValue()
                                  throws SnmpException
Gets the Java object value corresponding to the the SnmpSyntax object.

Returns:
The Java object value corresponding to the the SnmpSyntax object.
Throws:
SnmpException - Thrown when any error occurs during converting the SnmpSyntax value to the Java object.

isValidJavaDatatype

public boolean isValidJavaDatatype(java.lang.Object o)
Checks if the expected datatype of the Java object value matches to the passed Java object value.

Parameters:
o - The Java object value.
Returns:
True if they are the same, otherwise false.

isValidJavaDatatype

public boolean isValidJavaDatatype(java.lang.Class c)
Checks if the exptected Class type equals to the passed Class object.

Parameters:
c - The Class object to be checked.
Returns:
True if matched to the expected type, otherwise false.

getJavaDataType

public java.lang.String getJavaDataType()
Gets the string description of the expected java datatype.

Returns:
The string description of the expected java datatype.

MySnmpCrawler API