public abstract class

SnmpMibNode

extends Object
implements Serializable
java.lang.Object
   ↳ com.sun.jmx.snmp.agent.SnmpMibNode
Known Direct Subclasses
Known Indirect Subclasses

Class Overview

The SnmpMibNode class represents a node in an SNMP MIB.

This class is used internally and by the class generated by mibgen. You should not need to use this class directly.

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

Summary

Fields
protected static final SnmpStatusException noSuchInstanceException Contains a predefined exception that is often fired when an object is not found in the MIB.
protected static final SnmpStatusException noSuchNameException
protected static final SnmpStatusException noSuchObjectException
protected int[] varList Contains the list of variable identifiers.
Public Constructors
SnmpMibNode()
Public Methods
abstract void check(SnmpMibSubRequest req, int depth)
Generic handling of the check operation.
abstract void get(SnmpMibSubRequest req, int depth)
Generic handling of the get operation.
long getNextVarId(long id, Object userData, int pduVersion)
Get the next OID arc corresponding to a readable scalar variable, a branch leading to a subgroub, or a table, possibly skipping over those arcs that must not or cannot be returned.
long getNextVarId(long id, Object userData)
Get the next OID arc corresponding to a readable scalar variable, a branch leading to a subgroub, or a table.
void getRootOid(Vector<Integer> result)
Computes the root OID of the MIB.
abstract void set(SnmpMibSubRequest req, int depth)
Generic handling of the set operation.
static void sort(int[] array)
Sorts the specified integer array.
Protected Methods
final static int getNextIdentifier(int[] table, long value)
This will give the first element greater than value in a sorted array.
boolean skipVariable(long id, Object userData, int pduVersion)
Hook for subclasses.
[Expand]
Inherited Methods
From class java.lang.Object

Fields

protected static final SnmpStatusException noSuchInstanceException

Contains a predefined exception that is often fired when an object is not found in the MIB.

protected static final SnmpStatusException noSuchNameException

protected static final SnmpStatusException noSuchObjectException

protected int[] varList

Contains the list of variable identifiers.

Public Constructors

public SnmpMibNode ()

Public Methods

public abstract void check (SnmpMibSubRequest req, int depth)

Generic handling of the check operation.

You can override this method if you need to implement some specific policies for minimizing the accesses made to some remote underlying resources, or if you need to implement some consistency checks between the different values provided in the varbind list.

Parameters
req The sub-request that must be handled by this node.
depth The depth reached in the OID tree.
Throws
SnmpStatusException An error occurred while accessing the MIB node.

public abstract void get (SnmpMibSubRequest req, int depth)

Generic handling of the get operation.

You can override this method if you need to implement some specific policies for minimizing the accesses made to some remote underlying resources.

Parameters
req The sub-request that must be handled by this node.
depth The depth reached in the OID tree.
Throws
SnmpStatusException An error occurred while accessing the MIB node.

public long getNextVarId (long id, Object userData, int pduVersion)

Get the next OID arc corresponding to a readable scalar variable, a branch leading to a subgroub, or a table, possibly skipping over those arcs that must not or cannot be returned. Calls getNextVarId(long, java.lang.Object) until skipVariable(long, java.lang.Object, int) returns false.

Parameters
id Id we start from looking for the next.
userData A contextual object containing user-data. This object is allocated through the SnmpUserDataFactory for each incoming SNMP request.
pduVersion Protocol version of the original request PDU.
Returns
  • The next id in this group which can be returned using the given PDU's protocol version.
Throws
SnmpStatusException If no id is found after the given id.

public long getNextVarId (long id, Object userData)

Get the next OID arc corresponding to a readable scalar variable, a branch leading to a subgroub, or a table.

Parameters
id Id we start from looking for the next.
userData A contextual object containing user-data. This object is allocated through the SnmpUserDataFactory for each incoming SNMP request.
Returns
  • The next id in this group.
Throws
SnmpStatusException If no id is found after the given id.

public void getRootOid (Vector<Integer> result)

Computes the root OID of the MIB.

public abstract void set (SnmpMibSubRequest req, int depth)

Generic handling of the set operation.

You can override this method if you need to implement some specific policies for minimizing the accesses made to some remote underlying resources.

Parameters
req The sub-request that must be handled by this node.
depth The depth reached in the OID tree.
Throws
SnmpStatusException An error occurred while accessing the MIB node.

public static void sort (int[] array)

Sorts the specified integer array.

Parameters
array An integer array.

Protected Methods

protected static final int getNextIdentifier (int[] table, long value)

This will give the first element greater than value in a sorted array. If there is no element of the array greater than value, the method will throw a SnmpStatusException.

Parameters
table A sorted integer array.
value The greatest value.
Throws
SnmpStatusException If there is no element greater than value.

protected boolean skipVariable (long id, Object userData, int pduVersion)

Hook for subclasses. The default implementation of this method is to always return false. Subclasses should redefine this method so that it returns true when:

  • the variable is a leaf that is not instantiated,
  • or the variable is a leaf whose type cannot be returned by that version of the protocol (e.g. an Counter64 with SNMPv1).

Parameters
id Id we start from looking for the next.
userData A contextual object containing user-data. This object is allocated through the SnmpUserDataFactory for each incoming SNMP request.
pduVersion Protocol version of the original request PDU.
Returns
  • true if the variable must be skipped by the get-next algorithm.