public class

SnmpIpAddress

extends SnmpOid
java.lang.Object
   ↳ com.sun.jmx.snmp.SnmpValue
     ↳ com.sun.jmx.snmp.SnmpOid
       ↳ com.sun.jmx.snmp.SnmpIpAddress

Class Overview

Represents an SNMP IpAddress.

This API is a Sun Microsystems internal API and is subject to change without notice.

Summary

[Expand]
Inherited Constants
From interface com.sun.jmx.snmp.SnmpDataTypeEnums
[Expand]
Inherited Fields
From class com.sun.jmx.snmp.SnmpOid
Public Constructors
SnmpIpAddress(byte[] bytes)
Constructs a new SnmpIpAddress from the specified bytes array.
SnmpIpAddress(long addr)
Constructs a new SnmpIpAddress from the specified long value.
SnmpIpAddress(String dotAddress)
Constructs a new SnmpIpAddress from a dot-formatted String.
SnmpIpAddress(long b1, long b2, long b3, long b4)
Constructs a new SnmpIpAddress from four long values.
Public Methods
static void appendToOid(SnmpOid source, SnmpOid dest)
Appends an SnmpOid representing an SnmpIpAddress to another OID.
byte[] byteValue()
Converts the address value to its byte array form.
final String getTypeName()
Returns a textual description of the type object.
static int nextOid(long[] index, int start)
Scans an index OID, skips the address value and returns the position of the next value.
String stringValue()
Converts the address to its String form.
static SnmpOid toOid(long[] index, int start)
Extracts the ip address from an index OID and returns its value converted as an SnmpOid.
[Expand]
Inherited Methods
From class com.sun.jmx.snmp.SnmpOid
From class com.sun.jmx.snmp.SnmpValue
From class java.lang.Object

Public Constructors

public SnmpIpAddress (byte[] bytes)

Constructs a new SnmpIpAddress from the specified bytes array.

Parameters
bytes The four bytes composing the address.
Throws
IllegalArgumentException The length of the array is not equal to four.

public SnmpIpAddress (long addr)

Constructs a new SnmpIpAddress from the specified long value.

Parameters
addr The initialization value.

public SnmpIpAddress (String dotAddress)

Constructs a new SnmpIpAddress from a dot-formatted String. The dot-formatted String is formulated x.x.x.x .

Parameters
dotAddress The initialization value.
Throws
IllegalArgumentException The string does not correspond to an ip address.

public SnmpIpAddress (long b1, long b2, long b3, long b4)

Constructs a new SnmpIpAddress from four long values.

Parameters
b1 Byte 1.
b2 Byte 2.
b3 Byte 3.
b4 Byte 4.
Throws
IllegalArgumentException A value is outside of [0-255].

Public Methods

public static void appendToOid (SnmpOid source, SnmpOid dest)

Appends an SnmpOid representing an SnmpIpAddress to another OID.

Parameters
source An OID representing an SnmpIpAddress value.
dest Where source should be appended.

public byte[] byteValue ()

Converts the address value to its byte array form.

Returns
  • The byte array representation of the value.

public final String getTypeName ()

Returns a textual description of the type object.

Returns
  • ASN.1 textual description.

public static int nextOid (long[] index, int start)

Scans an index OID, skips the address value and returns the position of the next value.

Parameters
index The index array.
start The position in the index array.
Returns
  • The position of the next value.
Throws
SnmpStatusException There is no address value available at the start position.

public String stringValue ()

Converts the address to its String form. Same as toString(). Exists only to follow a naming scheme.

Returns
  • The String representation of the value.

public static SnmpOid toOid (long[] index, int start)

Extracts the ip address from an index OID and returns its value converted as an SnmpOid.

Parameters
index The index array.
start The position in the index array.
Returns
  • The OID representing the ip address value.
Throws
SnmpStatusException There is no ip address value available at the start position.