org.snmp4j.agent.mo.jmx
Class MBeanAttributeMOScalarSupport

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

public class MBeanAttributeMOScalarSupport
extends AbstractMBeanSupport
implements JMXScalarSupport

MBeanAttributeMOScalarSupport objects map zero or more MBean attributes to their corresponding MOScalar instance.

Version:
1.0
Author:
Frank Fock

Field Summary
 
Fields inherited from class org.snmp4j.agent.mo.jmx.AbstractMBeanSupport
oid2MBeanMap, server
 
Constructor Summary
MBeanAttributeMOScalarSupport(javax.management.MBeanServerConnection server)
           
 
Method Summary
 void add(org.snmp4j.smi.OID oid, MBeanAttributeMOInfo mBean)
          Adds a scalar to MBean attribute mapping.
 void addAll(javax.management.ObjectName mBeanName, java.lang.Object[][] mBeanScalarAttributeDescriptions)
          Adds a list of scalar to attribute mappings for the specified 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

MBeanAttributeMOScalarSupport

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

add

public void add(org.snmp4j.smi.OID oid,
                MBeanAttributeMOInfo mBean)
Adds a scalar to MBean attribute mapping.

Parameters:
oid - the instance OID (including the .0) of the SNMP scalar object.
mBean - an attribute description of a MBean.

addAll

public void addAll(javax.management.ObjectName mBeanName,
                   java.lang.Object[][] mBeanScalarAttributeDescriptions)
Adds a list of scalar to attribute mappings for the specified MBean.

Parameters:
mBeanName - the name of the MBean providing the attributes.
mBeanScalarAttributeDescriptions - an two dimensional array of scalar descriptions. Each description contains three elements:
  1. the OID of the scalar SNMP instance,
  2. the name of the attribute as String, and
  3. the Class of the attributes value.

checkScalarValue

public int checkScalarValue(org.snmp4j.smi.OID scalarInstanceOID,
                            org.snmp4j.smi.Variable value)
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 would fail.

getScalarValue

public int getScalarValue(org.snmp4j.smi.OID scalarInstanceOID,
                          org.snmp4j.smi.Variable value)
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)
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)