- java.lang.Object
-
- java.util.TimerTask
-
- org.snmp4j.Snmp.PendingRequest<A>
-
- All Implemented Interfaces:
java.lang.Cloneable
,java.lang.Runnable
,PduHandleCallback<PDU>
- Enclosing class:
- Snmp
protected class Snmp.PendingRequest<A extends Address> extends java.util.TimerTask implements PduHandleCallback<PDU>, java.lang.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 java.lang.Object
userObject
-
Constructor Summary
Constructors Constructor Description PendingRequest(ResponseListener listener, java.lang.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
.java.lang.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()
-
-
-
Field Detail
-
retryCount
protected int retryCount
-
listener
protected ResponseListener listener
-
userObject
protected java.lang.Object userObject
-
pdu
protected PDU pdu
-
transport
protected TransportMapping<? super A extends Address> transport
-
-
Constructor Detail
-
PendingRequest
public PendingRequest(ResponseListener listener, java.lang.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 java.lang.Object clone() throws java.lang.CloneNotSupportedException
- Overrides:
clone
in classjava.lang.Object
- Throws:
java.lang.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.- Specified by:
run
in interfacejava.lang.Runnable
- Specified by:
run
in classjava.util.TimerTask
-
setFinished
public boolean setFinished()
-
setMaxRequestStatus
public void setMaxRequestStatus(int maxRequestStatus)
-
getMaxRequestStatus
public int getMaxRequestStatus()
-
isResponseReceived
public boolean isResponseReceived()
-
cancel
public boolean cancel()
Cancels the request and clears all internal fields by setting them tonull
.- Overrides:
cancel
in classjava.util.TimerTask
- Returns:
true
if cancellation was successful.
-
-