net.sf.snmpadaptor4j.core
Class SystemSnmpMib

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

public class SystemSnmpMib
extends Object
implements SnmpMib

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

Author:
Jean-Philippe MINETTI

Nested Class Summary
protected  class SystemSnmpMib.ExternalNode
          External node of the SNMP Management Information Base (MIB).
protected  class SystemSnmpMib.SysObjectIDExternalNode
          External node of the SNMP Management Information Base (MIB) for system.sysObjectID attribute.
 
Constructor Summary
  SystemSnmpMib(SnmpAppContext mainAppContext, Map<ClassLoader,SnmpAppContext> appContextMap, SystemInfo systemInfo)
          Constructor.
protected SystemSnmpMib(SystemInfo systemInfo)
          Constructor (only used by tests).
 
Method Summary
 AttributeAccessor find(SnmpOid oid)
          Finds a AttributeAccessor by its OID.
protected  Class<?> getJmxDataType(int index)
          Returns the data type of JMX attribute.
protected  SortedMap<SnmpOid,AttributeAccessor> getMib()
          Returns the Management Information Base (MIB).
protected  SnmpDataType getSnmpDataType(int index)
          Returns the SNMP data type of attribute.
 Object getValue(int index)
          Returns the value of attribute.
 void initSysObjectIDSet()
          Initializes the set of system.sysObjectID values with their 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
protected  void putExternalNode(int index, SnmpOid oid)
          Puts an external node of an attribute in the MIB.
protected  void putExternalNode(SnmpOid oid, SnmpOid value)
          Puts an external node of an attribute in the MIB.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SystemSnmpMib

protected SystemSnmpMib(SystemInfo systemInfo)
Constructor (only used by tests).

Parameters:
systemInfo - Informations on the system.

SystemSnmpMib

public SystemSnmpMib(SnmpAppContext mainAppContext,
                     Map<ClassLoader,SnmpAppContext> appContextMap,
                     SystemInfo systemInfo)
Constructor.

Parameters:
mainAppContext - Context of main application (must not be NULL).
appContextMap - Application context map.
systemInfo - Informations on the system.
Method Detail

getMib

protected final SortedMap<SnmpOid,AttributeAccessor> getMib()
Returns the Management Information Base (MIB).

Returns:
Management Information Base (MIB).

initSysObjectIDSet

public void initSysObjectIDSet()
Initializes the set of system.sysObjectID values with their OID.


putExternalNode

protected final void putExternalNode(int index,
                                     SnmpOid oid)
Puts an external node of an attribute in the MIB.

Parameters:
index - Index of attribute.
oid - Object IDentifier (OID) of MIB node.

putExternalNode

protected final void putExternalNode(SnmpOid oid,
                                     SnmpOid value)
Puts an external node of an attribute in the MIB.

Parameters:
oid - Object IDentifier (OID) of MIB node.
value - Value of MIB node.

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).

getSnmpDataType

protected final SnmpDataType getSnmpDataType(int index)
Returns the SNMP data type of attribute.

Parameters:
index - Index of attribute.
Returns:
SNMP data type of attribute.

getJmxDataType

protected final Class<?> getJmxDataType(int index)
Returns the data type of JMX attribute.

Parameters:
index - Index of attribute.
Returns:
Data type of JMX attribute.

getValue

public final Object getValue(int index)
Returns the value of attribute.

Parameters:
index - Index of attribute.
Returns:
Value of attribute.

toString

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


Copyright © 2012-2013 snmpAdaptor4j. All Rights Reserved.