|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.opennms.bb.dp.capsd.snmp.IpNetToMediaTable
The IpNetToMediaTable uses a SnmpSession to collect the entries in the remote agent's ipNetToMedia table. It implements the SnmpHandler to receive notifications and handle errors associated with the data collection. Data is collected using a series of GETNEXT PDU request to walk multiple parts of the ipNetToMedia table at once. The number of SNMP packets should not exceed the number of media entries + 1, assuming no lost packets or error conditions occur.
Field Summary | |
private List |
m_entries
The list of media entries from the remote's interface table. |
private boolean |
m_error
Flag indicating if query was successful or if the collection failed. |
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 Summary | |
private |
IpNetToMediaTable()
The default constructor is marked as private and will always throw an exception. |
|
IpNetToMediaTable(SnmpSession session,
Signaler signaler)
Constructs an IpNetToMediaTable object that is used to collect the NetToMedia elements from the remote agent. |
Method Summary | |
boolean |
failed()
Returns the success or failure code for collection of the data. |
List |
getEntries()
Returns the list of entry maps that can be used to access all the information about the interface table. |
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. |
Methods inherited from class java.lang.Object |
|
Field Detail |
private List m_entries
The list of media entries from the remote's interface table. The list contains a set of IpNetToMediaTableEntry objects that were collected from the remote host.
IpNetToMediaTableEntry
private boolean m_error
Flag indicating if query was successful or if the collection failed.
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 IpNetToMediaTable() throws UnsupportedOperationException
The default constructor is marked as private and will always throw an exception. This is done to disallow the constructor to be called. Since any instance of this class must have an SnmpSession and Signaler to properly work, the correct constructor must be used.
UnsupportedOperationException
- Always thrown from
this method since it is not supported.IpNetToMediaTable(SnmpSession, Signaler)
public IpNetToMediaTable(SnmpSession session, Signaler signaler)
Constructs an IpNetToMediaTable object that is used to collect the NetToMedia elements from the remote agent. Once all the elements are collected, or there is an error in the collection the signaler object is notified to inform other threads.
session
- The session with the remote agent.signaler
- The object to notify waiters.IpNetToMediaTableEntry
Method Detail |
public boolean failed()
Returns the success or failure code for collection of the data.
public List getEntries()
Returns the list of entry maps that can be used to access all the information about the interface table.
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
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |