|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.management.snmp.SnmpEngineId
public class SnmpEngineId
This class is handling an SnmpEngineId
data. It copes with binary as well as String
representation of an engine Id. A string format engine is an hex string starting with 0x.
Method Summary | |
---|---|
static SnmpEngineId |
createEngineId()
Generates an engine Id that is unique to the host the agent is running on. |
static SnmpEngineId |
createEngineId(byte[] arr)
Generates an engine Id based on the passed array. |
static SnmpEngineId |
createEngineId(InetAddress addr)
Generates an engine Id based on an InetAddress. |
static SnmpEngineId |
createEngineId(InetAddress address,
int port)
Generates a unique engine Id. |
static SnmpEngineId |
createEngineId(InetAddress addr,
int port,
int iana)
Generates a unique engine Id. |
static SnmpEngineId |
createEngineId(int port)
Generates a unique engine Id. |
static SnmpEngineId |
createEngineId(int iana,
InetAddress addr)
Generates an engine Id based on an InetAddress. |
static SnmpEngineId |
createEngineId(int port,
int iana)
Generates a unique engine Id. |
static SnmpEngineId |
createEngineId(String str)
Generates a unique engine Id. |
static SnmpEngineId |
createEngineId(String str,
String separator)
Idem createEngineId(java.lang.String)
with the ability to provide your own separator. |
boolean |
equals(Object a)
Tests SnmpEngineId instance equality. |
byte[] |
getBytes()
Returns a binary engine Id. |
String |
getReadableId()
If a string of the format <address>:<port>:<IANA number> has been provided at creation time, this string is returned. |
int |
hashCode()
|
SnmpOid |
toOid()
Translates an engine Id in an SnmpOid format. |
String |
toString()
Returns a string format engine Id. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public String getReadableId()
public String toString()
toString
in class Object
public byte[] getBytes()
public static SnmpEngineId createEngineId(byte[] arr) throws IllegalArgumentException
IllegalArgumentException.
- Thrown when :
IllegalArgumentException
public static SnmpEngineId createEngineId()
public SnmpOid toOid()
public static SnmpEngineId createEngineId(String str) throws IllegalArgumentException, UnknownHostException
Generates a unique engine Id. Hexadecimal strings as well as a textual description are supported. The textual format is as follow:
<address>:<port>:<IANA number>
The allowed formats :
str
- The string to parse.
UnknownHostException.
- Thrown if the host name contained
in the textual format is unknown.
IllegalArgumentException.
- Thrown when :
IllegalArgumentException
UnknownHostException
public static SnmpEngineId createEngineId(String str, String separator) throws IllegalArgumentException, UnknownHostException
createEngineId(java.lang.String)
with the ability to provide your own separator. This allows IPv6
address format handling (e.g. providing @ as separator).
str
- The string to parse.separator
- the separator to use. If null is provided, the default
separator ":" is used.
UnknownHostException.
- Thrown if the host name contained
in the textual format is unknown.
IllegalArgumentException.
- Thrown when :
IllegalArgumentException
UnknownHostException
public static SnmpEngineId createEngineId(int port) throws UnknownHostException
port
- The TCP/IP port the SnmpV3AdaptorServer
is listening to.
UnknownHostException.
- Thrown if the local host name used to calculate the id is unknown.
UnknownHostException
public static SnmpEngineId createEngineId(InetAddress address, int port) throws IllegalArgumentException
address
- The IP address the SnmpV3AdaptorServer
is listening to.port
- The TCP/IP port the SnmpV3AdaptorServer
is listening to.
UnknownHostException.
- Thrown if the provided address is null.
IllegalArgumentException
public static SnmpEngineId createEngineId(int port, int iana) throws UnknownHostException
port
- The TCP/IP port the SnmpV3AdaptorServer
is listening to.iana
- Your enterprise IANA number.
UnknownHostException.
- Thrown if the local host name used to calculate the id is unknown.
UnknownHostException
public static SnmpEngineId createEngineId(InetAddress addr, int port, int iana)
addr
- The IP address the SnmpV3AdaptorServer
is listening to.port
- The TCP/IP port the SnmpV3AdaptorServer
is listening to.iana
- Your enterprise IANA number.
UnknownHostException.
- Thrown if the provided InetAddress
is null.public static SnmpEngineId createEngineId(int iana, InetAddress addr)
iana
- Your enterprise IANA number.addr
- The IP address the SnmpV3AdaptorServer
is listening to.
UnknownHostException.
- Thrown if the provided InetAddress
is null.public static SnmpEngineId createEngineId(InetAddress addr)
addr
- The IP address the SnmpV3AdaptorServer
is listening to.
UnknownHostException.
- Thrown if the provided
InetAddress
is null.public boolean equals(Object a)
SnmpEngineId
instance equality. Two SnmpEngineId
are equal if they have the same value.
equals
in class Object
true
if the two SnmpEngineId
are equals, false
otherwise.public int hashCode()
hashCode
in class Object
|
Open Source build 02 opendmk-1.0-b02 2007.10.01_19:17:46_MEST |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |