SourceForge.net Logo

org.netsnmp
Class DefaultOID

java.lang.Object
  |
  +--org.netsnmp.NativeOID
        |
        +--org.netsnmp.DefaultOID
All Implemented Interfaces:
Comparable, OID, Serializable
Direct Known Subclasses:
InstanceOID

public class DefaultOID
extends NativeOID
implements Serializable

See Also:
Serialized Form

Field Summary
protected  int[] oids
           
 
Constructor Summary
DefaultOID()
          Creates an Empty OID
DefaultOID(int[] descriptor)
          Creates and OID from an array of integer identifiers
DefaultOID(OID srcOid)
          Creates a new DefaultOID from an existing one
DefaultOID(OID oid, int inst)
          Creates an OID from another OID and a specific instance
DefaultOID(String descriptor)
          Creates a new instance of OID Creates an OID from a text descriptor.
DefaultOID(String descriptor, int instance)
          Creates a new oid from a text descriptor and a integer instance.
 
Method Summary
 int length()
          length of the OID
 int[] oids()
          Get the path elements of the OID
 
Methods inherited from class org.netsnmp.NativeOID
append, compareTo, compareTo, toString, toText
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

oids

protected final int[] oids
Constructor Detail

DefaultOID

public DefaultOID(String descriptor)
           throws MIBItemNotFound
Creates a new instance of OID Creates an OID from a text descriptor. The identifier is a '.' separated list of mib leaves. The identifier may also consist of the integer equivalents for any given leaf.
  Example:

             oid = new OID("iso.org.dod.internet.mgmt.mib-2.system.sysDescr.0") ;

   or

             oid = new OID("1.3.6.1.2.1.1.1.0") ;

 

Throws:
MIBItemNotFound - if the Item was not found in the currently loaded mibs. NOTE: Finding an item within the locally installed MIBs does not guarantee that it will be found on a remote agent.

DefaultOID

public DefaultOID()
Creates an Empty OID


DefaultOID

public DefaultOID(OID srcOid)
Creates a new DefaultOID from an existing one

Parameters:
srcOid -

DefaultOID

public DefaultOID(String descriptor,
                  int instance)
           throws MIBItemNotFound
Creates a new oid from a text descriptor and a integer instance. Useful for creating instances of separate entries in tables: Example:
  String ifSpeedDescr = "iso.org.dod.internet.mgmt.mib-2.interfaces.ifTable.ifEntry.ifSpeed" ;
  OID ifSpeeds[2] = new OID[2] ;

  ifSpeeds[0] = new OID(ifSpeedDescr, 1) ;
  ifSpeeds[1] = new OID(ifSpeedDescr, 2) ;
  

Parameters:
descriptor - OID of Object
instance - specific instance

DefaultOID

public DefaultOID(OID oid,
                  int inst)
Creates an OID from another OID and a specific instance

Parameters:
oid - Object Identifier
inst - Specific instance

DefaultOID

public DefaultOID(int[] descriptor)
Creates and OID from an array of integer identifiers
 Example:

 int sysDescrInts[] = { 1,3,6,1,2,1,1,1,0 } ;
 OID oid = new OID(sysDescrInts) ;

  equivalent to:

  oid = new OID("iso.org.dod.internet.mgmt.mib-2.system.sysDescr.0") ;
  

Method Detail

oids

public int[] oids()
Get the path elements of the OID

Specified by:
oids in interface OID
Returns:
the individual elements of the OID as an array of integers

length

public int length()
length of the OID

Specified by:
length in interface OID

SourceForge.net Logo