|
OpenNMS API 1.2.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.AbstractMap
java.util.TreeMap
org.opennms.netmgt.capsd.snmp.SystemGroup
SystemGroup holds the system group properties It implements the SnmpHandler to receive notifications when a reply is received/error occurs in the SnmpSession used to send requests /recieve replies.
Nested Class Summary |
Nested classes inherited from class java.util.TreeMap |
|
Nested classes inherited from class java.util.AbstractMap |
|
Field Summary | |
boolean |
m_error
Flag indicating the success or failure of the informational query. |
private Signaler |
m_signal
Used to synchronize the class to ensure that the session has finished collecting data before the value of success or failure is set, and control is returned to the caller. |
private static NamedSnmpVar[] |
ms_elemList
The keys that will be supported by default from the TreeMap base class. |
static SnmpObjectId |
ROOT
The SnmpObjectId that represents the root of the system tree. |
static java.lang.String |
SYS_CONTACT
|
static java.lang.String |
SYS_DESCR
|
static java.lang.String |
SYS_LOCATION
|
static java.lang.String |
SYS_NAME
|
static java.lang.String |
SYS_OBJECTID
|
static java.lang.String |
SYS_UPTIME
|
static java.lang.String |
SYSTEM_OID
The SYSTEM_OID is the object identifier that represents the root of the system information in the MIB forest. |
Fields inherited from class java.util.TreeMap |
|
Fields inherited from class java.util.AbstractMap |
|
Constructor Summary | |
private |
SystemGroup()
The default constructor is marked private and will always throw an exception. |
|
SystemGroup(SnmpSession session,
Signaler signaler)
The class constructor is used to initialize the collector and send out the initial SNMP packet requesting data. |
Method Summary | |
boolean |
failed()
Returns the success or failure code for collection of the data. |
static SnmpPduRequest |
getPdu()
This method is used to build the initial SNMP PDU that is sent to the remote host. |
static java.lang.String |
getPrintableString(SnmpOctetString octetString)
This method takes an SnmpOctetString and replaces any unprintable characters with ASCII period ('.') and returns the resulting character string. |
void |
snmpInternalError(SnmpSession session,
int error,
SnmpSyntax pdu)
This method is part of the SnmpHandler interface and called when an internal error happens in a session. |
void |
snmpReceivedPdu(SnmpSession session,
int command,
SnmpPduPacket pdu)
This method is used to process received SNMP PDU packets from the remote agent. |
void |
snmpTimeoutError(SnmpSession session,
SnmpSyntax pdu)
This method is part of the SnmpHandler interface and is invoked when the SnmpSession does not receive a reply after exhausting the retransmission attempts. |
void |
update(SnmpVarBind[] vars)
This method is used to update the map with the current information from the agent. |
Methods inherited from class java.util.TreeMap |
clear, clone, comparator, containsKey, containsValue, entrySet, firstKey, get, headMap, keySet, lastKey, put, putAll, remove, size, subMap, tailMap, values |
Methods inherited from class java.util.AbstractMap |
equals, hashCode, isEmpty, toString |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.Map |
equals, hashCode, isEmpty |
Field Detail |
public static final java.lang.String SYS_OBJECTID
public static final java.lang.String SYS_UPTIME
public static final java.lang.String SYS_NAME
public static final java.lang.String SYS_DESCR
public static final java.lang.String SYS_LOCATION
public static final java.lang.String SYS_CONTACT
private static NamedSnmpVar[] ms_elemList
The keys that will be supported by default from the TreeMap base class. Each of the elements in the list are an instance of the SNMP Interface table. Objects in this list should be used by multiple instances of this class.
public boolean m_error
Flag indicating the success or failure of the informational query. If the flag is set to false then either part of all of the information was unable to be retreived. If it is set to true then all of the data was received from the remote host.
public static final java.lang.String SYSTEM_OID
The SYSTEM_OID is the object identifier that represents the root of the system information in the MIB forest. Each of the system elements can be retreived by adding their specific index to the string, and an additional Zero(0) to signify the single instance item.
public static final SnmpObjectId ROOT
The SnmpObjectId that represents the root of the system tree. It is created at initilization time and is the converted value of SYSTEM_OID.
SYSTEM_OID
private Signaler m_signal
Used to synchronize the class to ensure that the session has finished collecting data before the value of success or failure is set, and control is returned to the caller.
Constructor Detail |
private SystemGroup() throws java.lang.UnsupportedOperationException
The default constructor is marked private and will always throw an exception. This is done to disallow the default constructor. The reason is that this object requires an SNMP session and a synchronization object to perform it's duties.
java.lang.UnsupportedOperationException
- Always thrown from this method since it is not supported.SystemGroup(SnmpSession, Signaler)
public SystemGroup(SnmpSession session, Signaler signaler)
The class constructor is used to initialize the collector and send out the initial SNMP packet requesting data. The data is then received and store by the object. When all the data has been collected the passed signaler object is notified using the notifyAll() method.
session
- The SNMP session with the remote agent.signaler
- The object signaled when data collection is done.Method Detail |
public void update(SnmpVarBind[] vars)
This method is used to update the map with the current information from the agent.
This does not clear out any column in the actual row that does not have a definition.
vars
- The variables in the interface row.public static SnmpPduRequest getPdu()
This method is used to build the initial SNMP PDU that is sent to the remote host. The PDU contains as many variable bindings as needed by the object. The varbinds are SnmpNull objects that have been initialized each with one instance of a required variable. The PDU type is marked as GET so that only a single Request/Response is required to get all the data.
SnmpNull
,
SnmpPduRequest
public void snmpReceivedPdu(SnmpSession session, int command, SnmpPduPacket pdu)
This method is used to process received SNMP PDU packets from the remote agent. The method is part of the SnmpHandler interface and will be invoked when a PDU is successfully decoded. The method is passed the receiving session, the PDU command, and the actual PDU packet.
When all the data has been received from the session the signaler object, initialized in the constructor, is signaled. In addition, the receiving instance will call notifyAll() on itself at the same time.
snmpReceivedPdu
in interface SnmpHandler
session
- The SNMP Session that received the PDUcommand
- The command contained in the received pdupdu
- The actual received PDU.public void snmpInternalError(SnmpSession session, int error, SnmpSyntax pdu)
This method is part of the SnmpHandler interface and called when an internal error happens in a session. This is usually the result of an I/O error. This method will not be called if the session times out sending a packet, see snmpTimeoutError for timeout handling.
snmpInternalError
in interface SnmpHandler
session
- The session that had an unexpected errorerror
- The error conditionpdu
- The PDU being sent when the error occuredsnmpTimeoutError(org.opennms.protocols.snmp.SnmpSession, org.opennms.protocols.snmp.SnmpSyntax)
,
SnmpHandler
public void snmpTimeoutError(SnmpSession session, SnmpSyntax pdu)
This method is part of the SnmpHandler interface and is invoked when the SnmpSession does not receive a reply after exhausting the retransmission attempts.
snmpTimeoutError
in interface SnmpHandler
session
- The session invoking the error handlerpdu
- The PDU that the remote failed to respond to.SnmpHandler
public boolean failed()
Returns the success or failure code for collection of the data.
public static java.lang.String getPrintableString(SnmpOctetString octetString)
octetString
- SnmpOctetString from which to generate the String
|
OpenNMS API 1.2.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |