net.sf.snmpadaptor4j.object
Class SnmpOid

java.lang.Object
  extended by net.sf.snmpadaptor4j.object.SnmpOid
All Implemented Interfaces:
Serializable, Comparable<SnmpOid>

public final class SnmpOid
extends Object
implements Comparable<SnmpOid>, Serializable

Object representing an object identifier in a SNMP Management Information Base (MIB).

Author:
Jean-Philippe MINETTI
See Also:
Serialized Form

Field Summary
static SnmpOid SYSCONTACT_OID
          OID: system.sysContact.0
static SnmpOid SYSDESCR_OID
          OID: system.sysDescr.0
static SnmpOid SYSLOCATION_OID
          OID: system.sysLocation.0
static SnmpOid SYSNAME_OID
          OID: system.sysName.0
static SnmpOid SYSUPTIME_OID
          OID: system.sysUpTime.0
 
Method Summary
 int compareTo(SnmpOid obj)
           
 boolean equals(Object obj)
           
 boolean equalsWithoutIndex(SnmpOid other)
          Returns TRUE if the OID without its index is equals to another OID.
 int getIndex()
          Returns the index part of the object identifier.
 int[] getOid()
          Returns the object identifier as numeric sequence.
 int hashCode()
           
 boolean isRootOf(SnmpOid other)
          Returns TRUE if the OID is the root of another OID passed as parameter.
static SnmpOid newInstance(int[] oid)
          Creates and returns a new instance of SnmpOid by its numeric sequence.
static SnmpOid newInstance(int[] oid, int index)
          Creates and returns a new instance of SnmpOid by its numeric sequence.
static SnmpOid newInstance(SnmpOid oid, int nodeNum, int index)
          Creates and returns a new instance of SnmpOid by an another SnmpOid.
static SnmpOid newInstance(String oid)
          Creates and returns a new instance of SnmpOid by its string value.
static SnmpOid newInstance(String oid, int nodeNum, int index)
          Creates and returns a new instance of SnmpOid by its string value.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

SYSNAME_OID

public static SnmpOid SYSNAME_OID
OID: system.sysName.0


SYSDESCR_OID

public static SnmpOid SYSDESCR_OID
OID: system.sysDescr.0


SYSLOCATION_OID

public static SnmpOid SYSLOCATION_OID
OID: system.sysLocation.0


SYSCONTACT_OID

public static SnmpOid SYSCONTACT_OID
OID: system.sysContact.0


SYSUPTIME_OID

public static SnmpOid SYSUPTIME_OID
OID: system.sysUpTime.0

Method Detail

newInstance

public static SnmpOid newInstance(String oid,
                                  int nodeNum,
                                  int index)
Creates and returns a new instance of SnmpOid by its string value.

Parameters:
oid - Object identifier as string.
nodeNum - Node number to insert at the last position of object identifier.
index - Index to insert at the last position of object identifier.
Returns:
New instance of SnmpOid.

newInstance

public static SnmpOid newInstance(SnmpOid oid,
                                  int nodeNum,
                                  int index)
Creates and returns a new instance of SnmpOid by an another SnmpOid.

Parameters:
oid - Object identifier as SnmpOid.
nodeNum - Node number to insert at the last position of object identifier.
index - Index to insert at the last position of object identifier.
Returns:
New instance of SnmpOid.

newInstance

public static SnmpOid newInstance(String oid)
Creates and returns a new instance of SnmpOid by its string value.

Parameters:
oid - Object identifier as string.
Returns:
New instance of SnmpOid.

newInstance

public static SnmpOid newInstance(int[] oid,
                                  int index)
Creates and returns a new instance of SnmpOid by its numeric sequence.

Parameters:
oid - Object identifier as numeric sequence.
index - Index to insert at the last position of object identifier.
Returns:
New instance of SnmpOid.

newInstance

public static SnmpOid newInstance(int[] oid)
Creates and returns a new instance of SnmpOid by its numeric sequence.

Parameters:
oid - Object identifier as numeric sequence.
Returns:
New instance of SnmpOid.

getOid

public int[] getOid()
Returns the object identifier as numeric sequence.

Returns:
Object identifier.

getIndex

public int getIndex()
Returns the index part of the object identifier.

Returns:
Index part of the object identifier.

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

equalsWithoutIndex

public boolean equalsWithoutIndex(SnmpOid other)
Returns TRUE if the OID without its index is equals to another OID.

Parameters:
other - Another OID.
Returns:
TRUE if the OID without its index is equals to another OID.

isRootOf

public boolean isRootOf(SnmpOid other)
Returns TRUE if the OID is the root of another OID passed as parameter.

Parameters:
other - Another OID.
Returns:
TRUE if the OID is the root of another OID passed as parameter.

compareTo

public int compareTo(SnmpOid obj)
Specified by:
compareTo in interface Comparable<SnmpOid>

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2012-2013 snmpAdaptor4j. All Rights Reserved.