com.sun.management.snmp.usm.usmmib
Class UsmStatsMeta

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
              extended by com.sun.management.snmp.usm.usmmib.UsmStatsMeta
All Implemented Interfaces:
SnmpStandardMetaServer, Serializable

public class UsmStatsMeta
extends SnmpMibGroup
implements Serializable, SnmpStandardMetaServer

The class is used for representing SNMP metadata for the "UsmStats" group. The group is defined with the following oid: 1.3.6.1.6.3.15.1.1.

Since:
Java DMK 5.1
See Also:
Serialized Form

Field Summary
protected  UsmStatsMBean node
           
protected  SnmpStandardObjectServer objectserver
           
 
Fields inherited from class com.sun.management.snmp.agent.SnmpMibGroup
subgroups
 
Fields inherited from class com.sun.management.snmp.agent.SnmpMibNode
noSuchInstanceException, noSuchNameException, noSuchObjectException, varList
 
Constructor Summary
UsmStatsMeta(SnmpMib myMib, SnmpStandardObjectServer objserv)
          Constructor for the metadata associated to "UsmStats".
 
Method Summary
 void check(SnmpMibSubRequest req, int depth)
          Generic handling of the check operation.
 void check(SnmpValue x, long var, Object data)
          Check the value of a scalar variable
 SnmpValue get(long var, Object data)
          Get the value of a scalar variable
 void get(SnmpMibSubRequest req, int depth)
          Generic handling of the get operation.
 String getAttributeName(long id)
          Return the name of the attribute corresponding to the SNMP variable identified by "id".
 SnmpMibTable getTable(long arc)
          Returns the table object identified by "arc".
 boolean isReadable(long arc)
          Returns true if "arc" identifies a readable scalar object.
 boolean isTable(long arc)
          Returns true if "arc" identifies a table object.
 boolean isVariable(long arc)
          Returns true if "arc" identifies a scalar object.
 void registerTableNodes(SnmpMib mib, MBeanServer server)
          Register the group's SnmpMibTable objects with the meta-data.
 void set(SnmpMibSubRequest req, int depth)
          Generic handling of the set operation.
 SnmpValue set(SnmpValue x, long var, Object data)
          Set the value of a scalar variable
protected  void setInstance(UsmStatsMBean var)
          Allow to bind the metadata description to a specific object.
 
Methods inherited from class com.sun.management.snmp.agent.SnmpMibGroup
getRootOid, isNestedArc, registerObject, validateVarId
 
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

node

protected UsmStatsMBean node

objectserver

protected SnmpStandardObjectServer objectserver
Constructor Detail

UsmStatsMeta

public UsmStatsMeta(SnmpMib myMib,
                    SnmpStandardObjectServer objserv)
Constructor for the metadata associated to "UsmStats".

Method Detail

get

public SnmpValue get(long var,
                     Object data)
              throws SnmpStatusException
Get the value of a scalar variable

Specified by:
get in interface SnmpStandardMetaServer
Parameters:
var - OID arc of the queried scalar object.
data - A contextual object containing user-data. This object is allocated through the SnmpUserDataFactory for each incoming SNMP request.
Returns:
The SnmpValue of the scalar object identified by arc.
Throws:
SnmpStatusException - If the arc is not valid, or if access is denied.

set

public SnmpValue set(SnmpValue x,
                     long var,
                     Object data)
              throws SnmpStatusException
Set the value of a scalar variable

Specified by:
set in interface SnmpStandardMetaServer
Parameters:
x - New value for the scalar object identified by arc
var - OID arc of the scalar object whose value is set.
data - A contextual object containing user-data. This object is allocated through the SnmpUserDataFactory for each incoming SNMP request.
Returns:
The new SnmpValue of the scalar object identified by arc.
Throws:
SnmpStatusException - If the arc is not valid, or if access is denied.

check

public void check(SnmpValue x,
                  long var,
                  Object data)
           throws SnmpStatusException
Check the value of a scalar variable

Specified by:
check in interface SnmpStandardMetaServer
Parameters:
x - New value for the scalar object identified by arc
var - OID arc of the scalar object whose value is set.
data - A contextual object containing user-data. This object is allocated through the SnmpUserDataFactory for each incoming SNMP request.
Throws:
SnmpStatusException - If the arc is not valid, or if access is denied, or if the new desired value is not valid.

setInstance

protected void setInstance(UsmStatsMBean var)
Allow to bind the metadata description to a specific object.


get

public void get(SnmpMibSubRequest req,
                int depth)
         throws SnmpStatusException
Description copied from class: SnmpMibGroup
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.

Specified by:
get in class SnmpMibGroup
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 void set(SnmpMibSubRequest req,
                int depth)
         throws SnmpStatusException
Description copied from class: SnmpMibGroup
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.

Specified by:
set in class SnmpMibGroup
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 void check(SnmpMibSubRequest req,
                  int depth)
           throws SnmpStatusException
Description copied from class: SnmpMibGroup
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.

Specified by:
check in class SnmpMibGroup
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.

isVariable

public boolean isVariable(long arc)
Returns true if "arc" identifies a scalar object.

Specified by:
isVariable in class SnmpMibGroup
Parameters:
arc - An OID arc.
Returns:
true if `arc' leads to a variable.

isReadable

public boolean isReadable(long arc)
Returns true if "arc" identifies a readable scalar object.

Specified by:
isReadable in class SnmpMibGroup
Parameters:
arc - An OID arc.
Returns:
true if `arc' leads to a readable variable.

getAttributeName

public String getAttributeName(long id)
                        throws SnmpStatusException
Return the name of the attribute corresponding to the SNMP variable identified by "id".

Throws:
SnmpStatusException

isTable

public boolean isTable(long arc)
Returns true if "arc" identifies a table object.

Specified by:
isTable in class SnmpMibGroup
Parameters:
arc - An OID arc.
Returns:
true if `arc' leads to a table.

getTable

public SnmpMibTable getTable(long arc)
Returns the table object identified by "arc".

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

registerTableNodes

public void registerTableNodes(SnmpMib mib,
                               MBeanServer server)
Register the group's SnmpMibTable objects with the meta-data.


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.