net.sf.snmpadaptor4j.core
Class JvmSnmpMib

java.lang.Object
  extended by net.sf.snmpadaptor4j.core.JvmSnmpMib
All Implemented Interfaces:
SnmpMib

public class JvmSnmpMib
extends Object
implements SnmpMib

Object representing the Management Information Base (MIB) for attributes of JVM.

Author:
Jean-Philippe MINETTI

Constructor Summary
JvmSnmpMib(SnmpMib other)
          Constructor.
 
Method Summary
 void close()
          Closes the connection with the JMX agent.
 AttributeAccessor find(SnmpOid oid)
          Finds a AttributeAccessor by its OID.
 AttributeAccessor next(SnmpOid oid)
          Finds the next AttributeAccessor from an OID
 SortedMap<SnmpOid,AttributeAccessor> nextSet(SnmpOid oid)
          Finds the list of next AttributeAccessor from an OID
 void open(MBeanServer server)
          Opens the connection with the JMX agent.
 void putAttribute(MBeanServer server, String oidAsStr, SnmpDataType snmpDataType, String mBeanName, String attributeName, Class<?> jmxDataType, boolean readonly)
          Adds a new JVM attribute.
 void putCompositeDataAttribute(MBeanServer server, String oidAsStr, String mBeanName, String attributeName, String attributeKey, SnmpDataType snmpDataType, Class<?> jmxDataType)
          Adds a new JVM attribute to CompositeData.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JvmSnmpMib

public JvmSnmpMib(SnmpMib other)
Constructor.

Parameters:
other - Other object representing the MIB.
Method Detail

open

public void open(MBeanServer server)
          throws Exception
Opens the connection with the JMX agent.

Parameters:
server - JMX agent.
Throws:
Exception - Exception if an error occurred.

close

public void close()
Closes the connection with the JMX agent.


putAttribute

public final void putAttribute(MBeanServer server,
                               String oidAsStr,
                               SnmpDataType snmpDataType,
                               String mBeanName,
                               String attributeName,
                               Class<?> jmxDataType,
                               boolean readonly)
                        throws Exception
Adds a new JVM attribute.

Parameters:
server - JMX agent.
oidAsStr - Object Identifier of attribute as String.
snmpDataType - SNMP data type of MIB node.
mBeanName - MBean name.
attributeName - Attribute name.
jmxDataType - Data type of JMX attribute.
readonly - TRUE if the attribute is read only.
Throws:
Exception - Exception if an error occurred.

putCompositeDataAttribute

public final void putCompositeDataAttribute(MBeanServer server,
                                            String oidAsStr,
                                            String mBeanName,
                                            String attributeName,
                                            String attributeKey,
                                            SnmpDataType snmpDataType,
                                            Class<?> jmxDataType)
                                     throws Exception
Adds a new JVM attribute to CompositeData.

Parameters:
server - JMX agent.
oidAsStr - Object Identifier of attribute as String.
mBeanName - MBean name.
attributeName - Attribute name of CompositeData.
attributeKey - Attribute key of value.
snmpDataType - SNMP data type of MIB node.
jmxDataType - Data type of JMX attribute.
Throws:
Exception - Exception if an error occurred.

find

public final AttributeAccessor find(SnmpOid oid)
Description copied from interface: SnmpMib
Finds a AttributeAccessor by its OID.

Specified by:
find in interface SnmpMib
Parameters:
oid - OID of AttributeAccessor to find.
Returns:
AttributeAccessor found or NULL if not found.

next

public final AttributeAccessor next(SnmpOid oid)
Description copied from interface: SnmpMib
Finds the next AttributeAccessor from an OID

Specified by:
next in interface SnmpMib
Parameters:
oid - OID not included in the research but from which it begins.
Returns:
AttributeAccessor found or NULL if not found.

nextSet

public final SortedMap<SnmpOid,AttributeAccessor> nextSet(SnmpOid oid)
Description copied from interface: SnmpMib
Finds the list of next AttributeAccessor from an OID

Specified by:
nextSet in interface SnmpMib
Parameters:
oid - OID not included in the research but from which it begins.
Returns:
List of AttributeAccessor found (never NULL).

toString

public final String toString()
Overrides:
toString in class Object


Copyright © 2012-2013 snmpAdaptor4j. All Rights Reserved.