Class AbstractAgentXPending<A extends org.snmp4j.smi.Address>

java.lang.Object
org.snmp4j.agent.agentx.master.AbstractAgentXPending<A>
Type Parameters:
A - the adress type.
All Implemented Interfaces:
Serializable, AgentXPending<A>
Direct Known Subclasses:
AgentXPendingClose, AgentXPendingGet, AgentXPendingSet

public abstract class AbstractAgentXPending<A extends org.snmp4j.smi.Address> extends Object implements AgentXPending<A>
The AbstractAgentXPending implements an abstract class for pending AgentX requests.
See Also:
  • Field Details

    • registration

      protected AgentXRegEntry<A extends org.snmp4j.smi.Address> registration
      The region entry of the affected region by this pending request.
  • Constructor Details

    • AbstractAgentXPending

      public AbstractAgentXPending(AgentXRegEntry<A> registration, org.snmp4j.agent.request.SnmpRequest request)
      Creates a new pending request based on affected region and request.
      Parameters:
      registration - the affected registration region.
      request - the pending request.
  • Method Details

    • updateTimestamp

      public void updateTimestamp()
      Sets the timestamp to the current system time milliseconds.
      Specified by:
      updateTimestamp in interface AgentXPending<A extends org.snmp4j.smi.Address>
    • getTimestamp

      public long getTimestamp()
      Gets the system time milliseconds when the response has been received.
      Specified by:
      getTimestamp in interface AgentXPending<A extends org.snmp4j.smi.Address>
      Returns:
      the latest timestamp in current system time milliseconds.
    • setTimeout

      public void setTimeout(int timeoutSeconds)
      Sets the timeout seconds.
      Specified by:
      setTimeout in interface AgentXPending<A extends org.snmp4j.smi.Address>
      Parameters:
      timeoutSeconds - timeout seconds.
    • setPending

      public void setPending(boolean pending)
      Sets the pending flag.
      Specified by:
      setPending in interface AgentXPending<A extends org.snmp4j.smi.Address>
      Parameters:
      pending - false if the response for the request has been received or the request timed out.
    • getTimeout

      public int getTimeout()
      Gets the request timeout in seconds.
      Specified by:
      getTimeout in interface AgentXPending<A extends org.snmp4j.smi.Address>
      Returns:
      a timeout in seconds.
    • getRegistration

      public AgentXRegEntry<A> getRegistration()
      The registration region affected by this request.
      Specified by:
      getRegistration in interface AgentXPending<A extends org.snmp4j.smi.Address>
      Returns:
      the registration region affected by this request.
    • isPending

      public boolean isPending()
      Checks if the request is still pending.
      Specified by:
      isPending in interface AgentXPending<A extends org.snmp4j.smi.Address>
      Returns:
      true if the request is still pending.
    • getRequest

      public org.snmp4j.agent.request.SnmpRequest getRequest()
      Gets the request.
      Specified by:
      getRequest in interface AgentXPending<A extends org.snmp4j.smi.Address>
      Returns:
      a SnmpRequest.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • toStringMembers

      protected final String toStringMembers()
      Returns a string representation of the class members to be overridden by subclasses.
      Returns:
      a string representation of the sub-class members.