com.sun.management.snmp.agent
Class SnmpMibGroup

java.lang.Object
  extended by com.sun.management.snmp.agent.SnmpMibNode
      extended by com.sun.management.snmp.agent.SnmpMibOid
          extended by com.sun.management.snmp.agent.SnmpMibGroup
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
UsmStatsMeta, UsmUserMeta

public abstract class SnmpMibGroup
extends SnmpMibOid
implements Serializable

Represents a node in an SNMP MIB which corresponds to a group. This class allows subnodes to be registered below a group, providing support for nested groups. The subnodes are registered at run time when registering the nested groups in the global MIB OID tree.

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

Since:
Java DMK 5.1
See Also:
Serialized Form

Field Summary
protected  Hashtable subgroups
           
 
Fields inherited from class com.sun.management.snmp.agent.SnmpMibNode
noSuchInstanceException, noSuchNameException, noSuchObjectException, varList
 
Constructor Summary
SnmpMibGroup()
           
 
Method Summary
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.
 void getRootOid(Vector result)
          Computes the root OID of the MIB.
abstract  SnmpMibTable getTable(long arc)
          Gets the table identified by the given `arc'.
 boolean isNestedArc(long arc)
          Tell whether the given OID arc identifies a sub-tree leading to a nested SNMP sub-group.
abstract  boolean isReadable(long arc)
          Tells whether the given arc identifies a readable scalar object in this group.
abstract  boolean isTable(long arc)
          Tells whether the given arc identifies a table in this group.
abstract  boolean isVariable(long arc)
          Tells whether the given arc identifies a variable (scalar object) in this group.
protected  void registerObject(long arc)
          Register an OID arc that identifies a scalar object or a table.
abstract  void set(SnmpMibSubRequest req, int depth)
          Generic handling of the set operation.
 void validateVarId(long arc, Object userData)
          Checks whether the given OID arc identifies a variable (scalar object).
 
Methods inherited from class com.sun.management.snmp.agent.SnmpMibOid
registerNode
 
Methods inherited from class com.sun.management.snmp.agent.SnmpMibNode
getNextIdentifier, getNextVarId, getNextVarId, skipVariable, sort
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

subgroups

protected Hashtable subgroups
Constructor Detail

SnmpMibGroup

public SnmpMibGroup()
Method Detail

isTable

public abstract boolean isTable(long arc)
Tells whether the given arc identifies a table in this group.

Parameters:
arc - An OID arc.
Returns:
true if `arc' leads to a table.

isVariable

public abstract boolean isVariable(long arc)
Tells whether the given arc identifies a variable (scalar object) in this group.

Parameters:
arc - An OID arc.
Returns:
true if `arc' leads to a variable.

isReadable

public abstract boolean isReadable(long arc)
Tells whether the given arc identifies a readable scalar object in this group.

Parameters:
arc - An OID arc.
Returns:
true if `arc' leads to a readable variable.

getTable

public abstract SnmpMibTable getTable(long arc)
Gets the table identified by the given `arc'.

Parameters:
arc - An OID arc.
Returns:
The SnmpMibTable identified by `arc', or null if `arc' does not identify any table.

validateVarId

public void validateVarId(long arc,
                          Object userData)
                   throws SnmpStatusException
Checks whether the given OID arc identifies a variable (scalar object).

Throws:
If - the given `arc' does not identify any variable in this group, throws an SnmpStatusException.
SnmpStatusException

isNestedArc

public boolean isNestedArc(long arc)
Tell whether the given OID arc identifies a sub-tree leading to a nested SNMP sub-group. This method is used internally. You shouldn't need to call it directly.

Parameters:
arc - An OID arc.
Returns:
true if the given OID arc identifies a subtree leading to a nested SNMP sub-group.

get

public abstract void get(SnmpMibSubRequest req,
                         int depth)
                  throws SnmpStatusException
Generic handling of the get operation.

The actual implementation of this method will be generated by mibgen. Usually, this implementation only delegates the job to some other provided runtime class, which knows how to access the MBean. The current toolkit thus provides two implementations:

Both implementations rely upon specific - and distinct, set of mibgen generated methods.

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

Overrides:
get in class SnmpMibOid
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.

set

public abstract void set(SnmpMibSubRequest req,
                         int depth)
                  throws SnmpStatusException
Generic handling of the set operation.

The actual implementation of this method will be generated by mibgen. Usually, this implementation only delegates the job to some other provided runtime class, which knows how to access the MBean. The current toolkit thus provides two implementations:

Both implementations rely upon specific - and distinct, set of mibgen generated methods.

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

Overrides:
set in class SnmpMibOid
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.

check

public abstract void check(SnmpMibSubRequest req,
                           int depth)
                    throws SnmpStatusException
Generic handling of the check operation.

The actual implementation of this method will be generated by mibgen. Usually, this implementation only delegates the job to some other provided runtime class, which knows how to access the MBean. The current toolkit thus provides two implementations:

Both implementations rely upon specific - and distinct, set of mibgen generated methods.

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.

Overrides:
check in class SnmpMibOid
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.

getRootOid

public void getRootOid(Vector result)
Description copied from class: SnmpMibOid
Computes the root OID of the MIB.

Overrides:
getRootOid in class SnmpMibOid

registerObject

protected void registerObject(long arc)
                       throws IllegalAccessException
Register an OID arc that identifies a scalar object or a table. This method is used internally. You shouldn't ever call it directly.

Parameters:
arc - An OID arc.
Throws:
IllegalAccessException

Open Source build 02
opendmk-1.0-b02 2007.10.01_19:17:46_MEST

Copyright 1998-2007 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.