org.snmp4j.agent.mo.jmx
Class MBeanActionMOScalarSupport

java.lang.Object
  extended by org.snmp4j.agent.mo.jmx.AbstractMBeanSupport
      extended by org.snmp4j.agent.mo.jmx.MBeanActionMOScalarSupport
All Implemented Interfaces:
JMXScalarSupport

public class MBeanActionMOScalarSupport
extends AbstractMBeanSupport
implements JMXScalarSupport

A MBean action is basically a method call on an MBean. An action in SNMP is normally modeled as an enumeration where each value specifies a possible action or a parameter set for an action. On the other hand, SNMP enumerations are also used to indicate the states of a managed object.

The MBeanActionMOScalarSupport class provides a mapping between these two action models for an arbitrary number of scalar instances and corresponding actions.

Version:
1.0
Author:
Frank Fock

Field Summary
 
Fields inherited from class org.snmp4j.agent.mo.jmx.AbstractMBeanSupport
oid2MBeanMap, server
 
Constructor Summary
MBeanActionMOScalarSupport(javax.management.MBeanServerConnection server)
           
 
Method Summary
 void add(org.snmp4j.smi.OID oid, MBeanActionMOInfo mBean)
          Adds an action mapping to the supported mappings.
 void addAll(javax.management.ObjectName mBeanName, java.lang.Object[][] mBeanScalarAttributeDescriptions)
          Adds a list of action mappings related to a single MBean.
 int checkScalarValue(org.snmp4j.smi.OID scalarInstanceOID, org.snmp4j.smi.Variable value)
          Checks the value of the specified object instance and type.
 int getScalarValue(org.snmp4j.smi.OID scalarInstanceOID, org.snmp4j.smi.Variable value)
          Gets the actual value for the specified object instance and type.
 int setScalarValue(org.snmp4j.smi.OID scalarInstanceOID, org.snmp4j.smi.Variable value)
          Sets the value of the specified object instance and type.
 
Methods inherited from class org.snmp4j.agent.mo.jmx.AbstractMBeanSupport
getMBeanMOInfo, removeMBean
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MBeanActionMOScalarSupport

public MBeanActionMOScalarSupport(javax.management.MBeanServerConnection server)
Method Detail

add

public void add(org.snmp4j.smi.OID oid,
                MBeanActionMOInfo mBean)
Adds an action mapping to the supported mappings.

Parameters:
oid - the instance OID of a scalar SNMP variable.
mBean - the action mapping information of the MBean actions/states.

addAll

public void addAll(javax.management.ObjectName mBeanName,
                   java.lang.Object[][] mBeanScalarAttributeDescriptions)
Adds a list of action mappings related to a single MBean.

Parameters:
mBeanName - the ObjectName of the MBean providing the actions.
mBeanScalarAttributeDescriptions - an two dimensional array of action descriptions. Each description contains three elements:
  1. the OID of the scalar SNMP instance that manages the action,
  2. an array of MBeanStateInfo instances, and
  3. an array of MBeanActionInfo instances.

checkScalarValue

public int checkScalarValue(org.snmp4j.smi.OID scalarInstanceOID,
                            org.snmp4j.smi.Variable value)
Description copied from interface: JMXScalarSupport
Checks the value of the specified object instance and type.

Specified by:
checkScalarValue in interface JMXScalarSupport
Parameters:
scalarInstanceOID - the instance OID of the target object.
value - the instance's new value.
Returns:
zero on success or a SNMP error status value if setting the value fails.

getScalarValue

public int getScalarValue(org.snmp4j.smi.OID scalarInstanceOID,
                          org.snmp4j.smi.Variable value)
Description copied from interface: JMXScalarSupport
Gets the actual value for the specified object instance and type.

Specified by:
getScalarValue in interface JMXScalarSupport
Parameters:
scalarInstanceOID - the instance OID of the target object.
value - the instance to hold the return value.
Returns:
zero on success or a SNMP error status value if fetching the value fails.

setScalarValue

public int setScalarValue(org.snmp4j.smi.OID scalarInstanceOID,
                          org.snmp4j.smi.Variable value)
Description copied from interface: JMXScalarSupport
Sets the value of the specified object instance and type.

Specified by:
setScalarValue in interface JMXScalarSupport
Parameters:
scalarInstanceOID - the instance OID of the target object.
value - the instance's new value.
Returns:
zero on success or a SNMP error status value if setting the value fails.

Copyright 2006-2007 Frank Fock (SNMP4J.org)