HOME

com.ireasoning.protocol.snmp
Class SnmpVarBind

java.lang.Object
  extended bycom.ireasoning.protocol.snmp.SnmpVarBind
All Implemented Interfaces:
Msg, Serializable, SnmpDataType

public class SnmpVarBind
extends Object
implements SnmpDataType

This class represents Snmp Variable binding object.

See Also:
Serialized Form

Field Summary
protected  SnmpOID _name
          The object identifier that uniquely identifies the "value".
protected  SnmpDataType _value
          The actual value object associated with the object identifier.
 
Fields inherited from interface com.ireasoning.protocol.snmp.SnmpDataType
BITS, BITSTRING, COUNTER32, COUNTER64, END_OF_MIB_VIEW, END_OF_MIB_VIEW_OBJECT, GAUGE32, INTEGER, IPADDRESS, NO_SUCH_INSTANCE, NO_SUCH_INSTANCE_OBJECT, NO_SUCH_OBJECT, NO_SUCH_OBJECT_OBJECT, NULL, OCTETSTRING, OID, OPAQUE, PDU, SEQUENCE, SEQUENCEOF, serialVersionUID, TIMETICKS, UNSIGNED32, VARBIND
 
Fields inherited from interface com.ireasoning.protocol.Msg
ERROR_TYPE
 
Constructor Summary
SnmpVarBind()
          Default constructor
SnmpVarBind(SnmpOID name)
          Constructs an SnmpVarBind object with passed SnmpOID object
SnmpVarBind(SnmpOID name, SnmpDataType value)
          Constructs an SnmpVarBind object with passed SnmpOID, SnmpDataType objects
SnmpVarBind(SnmpVarBind vb)
          Makes a copy of passed SnmpVarBind object
SnmpVarBind(String name)
          Constructs an SnmpVarBind object with passed SnmpOID, SnmpDataType objects
SnmpVarBind(String name, SnmpDataType value)
          Constructs an SnmpVarBind object with passed SnmpOID, SnmpDataType objects
 
Method Summary
 SnmpDataType copy()
          Makes a copy of itself
 int encode(com.ireasoning.protocol.snmp.SnmpEncoder encoder)
          For internal use
 boolean equals(Object obj)
          Indicates whether some other object is "equal to" this one.
 SnmpOID getName()
          Returns name.
 int getType()
          Returns SnmpDataType.VARBIND
 String getTypeString()
          Returns "VarBind"
 SnmpDataType getValue()
           
 int hashCode()
          Returns a hash code value for the object
 void setName(SnmpOID name)
          Sets a new oid
 void setName(String name)
          Sets a new oid
 void setValue(SnmpDataType value)
          Sets a new value
 String toString()
          Returns a string representation in following format:
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

_name

protected SnmpOID _name
The object identifier that uniquely identifies the "value".


_value

protected SnmpDataType _value
The actual value object associated with the object identifier.

Constructor Detail

SnmpVarBind

public SnmpVarBind()
Default constructor


SnmpVarBind

public SnmpVarBind(SnmpOID name)
Constructs an SnmpVarBind object with passed SnmpOID object

Parameters:
name - oid of this object

SnmpVarBind

public SnmpVarBind(String name,
                   SnmpDataType value)
Constructs an SnmpVarBind object with passed SnmpOID, SnmpDataType objects

Parameters:
name - oid of this object
value - the value corresponding to the name

SnmpVarBind

public SnmpVarBind(SnmpOID name,
                   SnmpDataType value)
Constructs an SnmpVarBind object with passed SnmpOID, SnmpDataType objects

Parameters:
name - oid of this object
value - the value corresponding to the name

SnmpVarBind

public SnmpVarBind(String name)
Constructs an SnmpVarBind object with passed SnmpOID, SnmpDataType objects

Parameters:
name - oid of this object

SnmpVarBind

public SnmpVarBind(SnmpVarBind vb)
Makes a copy of passed SnmpVarBind object

Method Detail

getName

public SnmpOID getName()
Returns name.

Returns:
OID name

setName

public void setName(SnmpOID name)
Sets a new oid


setName

public void setName(String name)
Sets a new oid


getValue

public SnmpDataType getValue()

setValue

public void setValue(SnmpDataType value)
Sets a new value


getType

public int getType()
Returns SnmpDataType.VARBIND

Specified by:
getType in interface SnmpDataType
Returns:
the object data type

getTypeString

public String getTypeString()
Returns "VarBind"

Specified by:
getTypeString in interface SnmpDataType

toString

public String toString()
Returns a string representation in following format:
 Variable:  OID
 Value (Data type): value
 


copy

public SnmpDataType copy()
Description copied from interface: SnmpDataType
Makes a copy of itself

Specified by:
copy in interface SnmpDataType
Returns:
a deep copy of this object

encode

public int encode(com.ireasoning.protocol.snmp.SnmpEncoder encoder)
           throws SnmpEncodingException
Description copied from interface: SnmpDataType
For internal use

Specified by:
encode in interface SnmpDataType
Throws:
SnmpEncodingException

equals

public boolean equals(Object obj)
Description copied from interface: SnmpDataType
Indicates whether some other object is "equal to" this one.

Specified by:
equals in interface SnmpDataType

hashCode

public int hashCode()
Description copied from interface: SnmpDataType
Returns a hash code value for the object

Specified by:
hashCode in interface SnmpDataType

HOME

Copyright © 2002 iReasoning Inc. All Rights Reserved.