com.amx.duet.tools.net.snmp.api
Class SNMPIPAddress

java.lang.Object
  extended bycom.amx.duet.tools.net.snmp.api.SNMPObject
      extended bycom.amx.duet.tools.net.snmp.api.SNMPOctetString
          extended bycom.amx.duet.tools.net.snmp.api.SNMPIPAddress

public class SNMPIPAddress
extends SNMPOctetString

Class to hold IP addresses; special case of SNMP Octet String.


Constructor Summary
SNMPIPAddress()
          Initialize to 0.0.0.0
SNMPIPAddress(byte[] enc)
          Used to initialize from the BER encoding, as received in a response from an SNMP device responding to an SNMPGetRequest, or from a supplied byte array containing the address components.
SNMPIPAddress(java.lang.String string)
          Used to initialize from a string containing a standard "dotted" IP address.
 
Method Summary
 void setValue(java.lang.Object newAddress)
          Used to set the value from a byte array containing the address.
 java.lang.String toString()
          Return pretty-printed IP address.
 
Methods inherited from class com.amx.duet.tools.net.snmp.api.SNMPOctetString
equals, getValue, hashCode, toHexString
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SNMPIPAddress

public SNMPIPAddress()
Initialize to 0.0.0.0


SNMPIPAddress

public SNMPIPAddress(java.lang.String string)
              throws SNMPBadValueException
Used to initialize from a string containing a standard "dotted" IP address.

Throws:
SNMPBadValueException - Indicates an invalid string supplied: more than 4 components, component values not between 0 and 255, etc.

SNMPIPAddress

public SNMPIPAddress(byte[] enc)
              throws SNMPBadValueException
Used to initialize from the BER encoding, as received in a response from an SNMP device responding to an SNMPGetRequest, or from a supplied byte array containing the address components.

Throws:
SNMPBadValueException - Indicates an invalid array supplied: must have length 4.
Method Detail

setValue

public void setValue(java.lang.Object newAddress)
              throws SNMPBadValueException
Used to set the value from a byte array containing the address.

Overrides:
setValue in class SNMPOctetString
Throws:
SNMPBadValueException - Indicates an incorrect object type supplied, or array of incorrect size.

toString

public java.lang.String toString()
Return pretty-printed IP address.

Overrides:
toString in class SNMPOctetString


Copyright © 2008 AMX LLC. All Rights Reserved.