com.tivoli.twg.snmputils
Class OidVbl

java.lang.Object
  extended bycom.tivoli.twg.snmputils.VariableBinding
      extended bycom.tivoli.twg.snmputils.OidVbl

public class OidVbl
extends VariableBinding

Oid variable binding.


Field Summary
 
Fields inherited from class com.tivoli.twg.snmputils.VariableBinding
oid
 
Constructor Summary
OidVbl(java.lang.String oid, java.lang.String value)
          Constructor using object type for value
 
Method Summary
 void addToPdu(SNMPPDU pdu)
          Adds the variable binding to the specified PDU
 byte[] getBytes()
          Returns a byte array of the string I'm holding.
static int getMIBType()
          Describes the type of MIB I represent.
 java.lang.String getString()
          Returns the String I'm holding.
static int getType()
          Describes the type of variable binding I represent.
 java.lang.String getValue()
          Returns the value for this variable binding as a primitive
 java.lang.Object getValueAsObject()
          Returns the value for this variable binding as an Object
 int size()
          Returns the size of the variable binding
static java.lang.String toAsciiString(java.lang.String oidString)
          Returns an ASCII string equivalent of the dotted decimal OID.
static java.lang.String toAsciiString(java.lang.String oidString, int offset)
          Returns an ASCII string equivalent of the dotted decimal OID.
 
Methods inherited from class com.tivoli.twg.snmputils.VariableBinding
getOid, setOid
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OidVbl

public OidVbl(java.lang.String oid,
              java.lang.String value)
Constructor using object type for value

Parameters:
oid - string for the OID of this variable binding
Method Detail

getType

public static int getType()
Describes the type of variable binding I represent.

Returns:
SNMP_SYNTAX_OID
See Also:
SNMPPDU

getMIBType

public static int getMIBType()
Describes the type of MIB I represent.

Returns:
TWGMIBItem2.TYPE_OI
See Also:
TWGMIBItem2

getString

public java.lang.String getString()
Returns the String I'm holding.

Returns:

getBytes

public byte[] getBytes()
Returns a byte array of the string I'm holding.

Returns:

getValue

public java.lang.String getValue()
Returns the value for this variable binding as a primitive

Returns:
variable binding value as a primitive type

getValueAsObject

public java.lang.Object getValueAsObject()
Returns the value for this variable binding as an Object

Specified by:
getValueAsObject in class VariableBinding
Returns:
variable binding value as an Object

addToPdu

public void addToPdu(SNMPPDU pdu)
Adds the variable binding to the specified PDU

Specified by:
addToPdu in class VariableBinding
Parameters:
pdu - SNMPPDU to add variable binding to

size

public int size()
Returns the size of the variable binding

Overrides:
size in class VariableBinding
Returns:
size of the variable binding
See Also:
VariableBinding

toAsciiString

public static java.lang.String toAsciiString(java.lang.String oidString)
Returns an ASCII string equivalent of the dotted decimal OID. For example, 104.101.108.108.111 would return "hello". This method will automatically check the oid to find the starting position. This is to prevent converting real object id numbers, like 1.3.6.1.4.1.

Parameters:
oidString - the OID to convert into
Returns:
the ASCII string

toAsciiString

public static java.lang.String toAsciiString(java.lang.String oidString,
                                             int offset)
Returns an ASCII string equivalent of the dotted decimal OID. For example, 104.101.108.108.111 would return "hello". This method takes an offset in the string to start from.

Parameters:
oidString - the OID to convert into
offset - offset to start from
Returns:
the ASCII string