Class AbstractAgentXPending<A extends org.snmp4j.smi.Address>
java.lang.Object
org.snmp4j.agent.agentx.master.AbstractAgentXPending<A>
- Type Parameters:
A- the address 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 Summary
FieldsModifier and TypeFieldDescriptionprotected AgentXRegEntry<A> The region entry of the affected region by this pending request. -
Constructor Summary
ConstructorsConstructorDescriptionAbstractAgentXPending(AgentXRegEntry<A> registration, org.snmp4j.agent.request.SnmpRequest request) Creates a new pending request based on affected region and request. -
Method Summary
Modifier and TypeMethodDescriptionThe registration region affected by this request.org.snmp4j.agent.request.SnmpRequestGets the request.intGets the request timeout in seconds.longGets the system time milliseconds when the response has been received.booleanChecks if the request is still pending.voidsetPending(boolean pending) Sets the pending flag.voidsetTimeout(int timeoutSeconds) Sets the timeout seconds.toString()protected final StringReturns a string representation of the class members to be overridden by subclasses.voidSets the timestamp to the current system time milliseconds.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface AgentXPending
getAgentXPDU, getReferences, getSession
-
Field Details
-
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:
updateTimestampin interfaceAgentXPending<A extends org.snmp4j.smi.Address>
-
getTimestamp
public long getTimestamp()Gets the system time milliseconds when the response has been received.- Specified by:
getTimestampin interfaceAgentXPending<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:
setTimeoutin interfaceAgentXPending<A extends org.snmp4j.smi.Address>- Parameters:
timeoutSeconds- timeout seconds.
-
setPending
public void setPending(boolean pending) Sets the pending flag.- Specified by:
setPendingin interfaceAgentXPending<A extends org.snmp4j.smi.Address>- Parameters:
pending-falseif 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:
getTimeoutin interfaceAgentXPending<A extends org.snmp4j.smi.Address>- Returns:
- a timeout in seconds.
-
getRegistration
The registration region affected by this request.- Specified by:
getRegistrationin interfaceAgentXPending<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:
isPendingin interfaceAgentXPending<A extends org.snmp4j.smi.Address>- Returns:
trueif the request is still pending.
-
getRequest
public org.snmp4j.agent.request.SnmpRequest getRequest()Gets the request.- Specified by:
getRequestin interfaceAgentXPending<A extends org.snmp4j.smi.Address>- Returns:
- a
SnmpRequest.
-
toString
-
toStringMembers
Returns a string representation of the class members to be overridden by subclasses.- Returns:
- a string representation of the sub-class members.
-