class Snmp.PendingRequest extends java.util.TimerTask implements PduHandleCallback<PDU>, java.lang.Cloneable
Modifier and Type | Field and Description |
---|---|
private boolean |
cancelled |
private boolean |
finished |
private PduHandle |
key |
protected ResponseListener |
listener |
private int |
maxRequestStatus |
private PDU |
nextPDU
The
nextPDU field holds a PDU that has to be sent
when the response of the pdu has been received. |
protected PDU |
pdu |
private boolean |
pendingRetry |
private int |
requestStatus |
private boolean |
responseReceived |
protected int |
retryCount |
protected Target |
target |
protected TransportMapping |
transport |
protected java.lang.Object |
userObject |
Modifier | Constructor and Description |
---|---|
|
PendingRequest(ResponseListener listener,
java.lang.Object userObject,
PDU pdu,
Target target,
TransportMapping transport) |
private |
PendingRequest(Snmp.PendingRequest other) |
Modifier and Type | Method and Description |
---|---|
boolean |
cancel()
Cancels the request and clears all internal fields by setting them
to
null . |
java.lang.Object |
clone() |
private void |
discoverContextEngineID() |
int |
getMaxRequestStatus() |
PDU |
getNextPDU() |
void |
insertFirstPDU(PDU firstPDU) |
boolean |
isResponseReceived() |
void |
pduHandleAssigned(PduHandle handle,
PDU pdu)
A new PduHandle has been created for a PDU.
|
protected void |
registerRequest(PduHandle handle) |
void |
responseReceived() |
void |
run()
Process retries of a pending request.
|
boolean |
setFinished() |
void |
setMaxRequestStatus(int maxRequestStatus) |
void |
setNextPDU(PDU nextPDU) |
boolean |
useNextPDU() |
private PduHandle key
protected int retryCount
protected ResponseListener listener
protected java.lang.Object userObject
protected PDU pdu
protected Target target
protected TransportMapping transport
private int requestStatus
private int maxRequestStatus
private volatile boolean finished
private volatile boolean responseReceived
private volatile boolean pendingRetry
private volatile boolean cancelled
private PDU nextPDU
nextPDU
field holds a PDU that has to be sent
when the response of the pdu
has been received.
Usually, this is used for (context) engine ID discovery.public PendingRequest(ResponseListener listener, java.lang.Object userObject, PDU pdu, Target target, TransportMapping transport)
private PendingRequest(Snmp.PendingRequest other)
private void discoverContextEngineID()
protected void registerRequest(PduHandle handle)
public boolean useNextPDU()
public void insertFirstPDU(PDU firstPDU)
public void responseReceived()
public PDU getNextPDU()
public void setNextPDU(PDU nextPDU)
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in class java.lang.Object
java.lang.CloneNotSupportedException
public void pduHandleAssigned(PduHandle handle, PDU pdu)
PduHandleCallback
pduHandleAssigned
in interface PduHandleCallback<PDU>
handle
- a PduHandle
instance that uniquely identifies a request -
thus in most cases the request ID.pdu
- the request PDU for which the handle has been created.public void run()
run
in interface java.lang.Runnable
run
in class java.util.TimerTask
public boolean setFinished()
public void setMaxRequestStatus(int maxRequestStatus)
public int getMaxRequestStatus()
public boolean isResponseReceived()
public boolean cancel()
null
.cancel
in class java.util.TimerTask
true
if cancellation was successful.