Module org.snmp4j
Package org.snmp4j

Class Snmp.PendingRequest<A extends Address>

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 Details

  • Constructor Details

  • Method Details

    • 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 class Object
      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 interface PduHandleCallback<A extends Address>
      Parameters:
      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.
    • run

      public void run()
      Process retries of a pending request.
      Specified by:
      run in interface Runnable
      Specified by:
      run in class TimerTask
    • setFinished

      public boolean setFinished()
    • setMaxRequestStatus

      public void setMaxRequestStatus(int maxRequestStatus)
    • getMaxRequestStatus

      public int getMaxRequestStatus()
    • isResponseReceived

      public boolean isResponseReceived()
    • getDurationNanos

      public long getDurationNanos()
      Gets the nanoseconds waited for a response for this pending request.
      Returns:
      a value greater than 0 represents the nanoseconds Snmp waited until a response was received.
      Since:
      3.7.5
    • cancel

      public boolean cancel()
      Cancels the request and clears all internal fields by setting them to null.
      Overrides:
      cancel in class TimerTask
      Returns:
      true if cancellation was successful.