class SnmpRequest
extends java.lang.Object
implements java.lang.Runnable
Implements a way to track outstanding SNMP pdu request. The object tracks the pdu, it's sending parameters, the number of times send, and the last time sent.
The SnmpRequest implements the Runnable interface and its run method is invoked by the corresponding SnmpTimer when the request effectively expires. The member m_expires refers the the expiretion of the request and pdu, not to the failed response.
Modifier and Type | Field and Description |
---|---|
private boolean |
m_expired
When set the request as a whole has expired and
should no longer be process by any methods.
|
private SnmpHandler |
m_handler
The SnmpHandler to invoke for this request
|
private boolean |
m_isTrap
True is this request represents a trap
|
private SnmpSyntax |
m_pdu
The pdu transemited to the SnmpPeer.
|
private java.lang.Integer |
m_requestID |
private SnmpSession |
m_session
The session that created this request
|
private int |
m_timesSent
The number of times this request has been
transmitted.
|
Constructor and Description |
---|
SnmpRequest(SnmpSession session,
java.lang.Integer requestID,
SnmpPduPacket pdu,
SnmpHandler handler)
Used to create an SnmpRequest object.
|
SnmpRequest(SnmpSession session,
SnmpPduTrap pdu,
SnmpHandler handler)
Used to create an SnmpRequest object.
|
Modifier and Type | Method and Description |
---|---|
SnmpHandler |
getHandler() |
SnmpSyntax |
getPdu() |
java.lang.Integer |
getRequestID() |
boolean |
isExpired() |
boolean |
isTrap() |
void |
run()
Used to process the timeout of an SnmpRequest.
|
void |
setExpired(boolean expired) |
private java.lang.Integer m_requestID
private SnmpSession m_session
private SnmpSyntax m_pdu
private SnmpHandler m_handler
private int m_timesSent
private boolean m_expired
private boolean m_isTrap
SnmpRequest(SnmpSession session, java.lang.Integer requestID, SnmpPduPacket pdu, SnmpHandler handler)
session
- The sending sessionpdu
- The pdu to send to the remotehandler
- The handler to invoke!SnmpRequest(SnmpSession session, SnmpPduTrap pdu, SnmpHandler handler)
session
- The sending sessionpdu
- The pdu to send to the remotehandler
- The handler to invoke!public void run()
run
in interface java.lang.Runnable
SnmpHandler
,
SnmpPduRequest
,
SnmpSession
public boolean isTrap()
public boolean isExpired()
public void setExpired(boolean expired)
public SnmpHandler getHandler()
public SnmpSyntax getPdu()
public java.lang.Integer getRequestID()
Generated by iurt on 2015.