|
||||||||||
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.IpRouteTable
The IpRouteTable uses an SnmpSesion to collect the entries that are contained in an agents MIB-II routing table. The passes SnmpSession is used to retreive all the routing entries known by the agent. This is done using a GETNEXT PDU. The PDU is filled in a way that means that only N+1 packets must be sent, where N is equal to the number of routing entries.
The success or failure of the collection can be determined by the m_success member variable. It is safe to check the values of the object when the signaler object has be notified.
Field Summary | |
private List |
m_entries
The list of interfaces from the remote's route 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 |
IpRouteTable()
The default constructor is marked as private and will always throw an exception. |
|
IpRouteTable(SnmpSession session,
Signaler signaler)
Constructs an IpRouteTable object that is used to collect the routing 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 interfaces from the remote's route table. The list contains a set of IpRouteTableEntry objects that were collected from the remote host.
IpRouteTableEntry
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 IpRouteTable() 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.IpRouteTable(SnmpSession, Signaler)
public IpRouteTable(SnmpSession session, Signaler signaler)
Constructs an IpRouteTable object that is used to collect the routing elements from the remote agent. Once all the routing information is collected, or if 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.IpRouteTableEntry
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 |