- java.lang.Object
-
- java.util.TimerTask
-
- org.snmp4j.Snmp.PendingRequest<A>
-
- All Implemented Interfaces:
Cloneable
,Runnable
,PduHandleCallback<PDU>
- Enclosing class:
- Snmp
protected class Snmp.PendingRequest<A extends Address> extends TimerTask implements PduHandleCallback<PDU>, Cloneable
-
-
Field Summary
Fields Modifier and Type Field Description protected ResponseListener
listener
protected PDU
pdu
protected int
retryCount
protected Target<A>
target
protected TransportMapping<? super A>
transport
protected Object
userObject
-
Constructor Summary
Constructors Constructor Description PendingRequest(ResponseListener listener, Object userObject, PDU pdu, Target<A> target, TransportMapping<? super A> transport)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
cancel()
Cancels the request and clears all internal fields by setting them tonull
.Object
clone()
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()
-
Methods inherited from class java.util.TimerTask
scheduledExecutionTime
-
-
-
-
Field Detail
-
retryCount
protected int retryCount
-
listener
protected ResponseListener listener
-
userObject
protected Object userObject
-
pdu
protected PDU pdu
-
transport
protected TransportMapping<? super A extends Address> transport
-
-
Constructor Detail
-
PendingRequest
public PendingRequest(ResponseListener listener, Object userObject, PDU pdu, Target<A> target, TransportMapping<? super A> transport)
-
-
Method Detail
-
registerRequest
protected void registerRequest(PduHandle handle)
-
useNextPDU
public boolean useNextPDU()
-
insertFirstPDU
public void insertFirstPDU(PDU firstPDU)
-
responseReceived
public void responseReceived()
-
getNextPDU
public PDU getNextPDU()
-
setNextPDU
public void setNextPDU(PDU nextPDU)
-
clone
public Object clone() throws CloneNotSupportedException
- Overrides:
clone
in classObject
- Throws:
CloneNotSupportedException
-
pduHandleAssigned
public void pduHandleAssigned(PduHandle handle, PDU pdu)
Description copied from interface:PduHandleCallback
A new PduHandle has been created for a PDU. This event callback notification can be used to get informed about a new PduHandle (just) before a PDU has been sent out.- Specified by:
pduHandleAssigned
in interfacePduHandleCallback<A extends Address>
- Parameters:
handle
- aPduHandle
instance that uniquely identifies a request - thus in most cases the request ID.pdu
- the request PDU for which the handle has been created.
-
run
public void run()
Process retries of a pending request.
-
setFinished
public boolean setFinished()
-
setMaxRequestStatus
public void setMaxRequestStatus(int maxRequestStatus)
-
getMaxRequestStatus
public int getMaxRequestStatus()
-
isResponseReceived
public boolean isResponseReceived()
-
-