Package org.snmp4j.agent.agentx.master
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 Summary
Modifier and TypeFieldDescriptionprotected AgentXRegEntry
<A> The region entry of the affected region by this pending request. -
Constructor Summary
ConstructorDescriptionAbstractAgentXPending
(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.SnmpRequest
Gets the request.int
Gets the request timeout in seconds.long
Gets the system time milliseconds when the response has been received.boolean
Checks if the request is still pending.void
setPending
(boolean pending) Sets the pending flag.void
setTimeout
(int timeoutSeconds) Sets the timeout seconds.toString()
protected final String
Returns a string representation of the class members to be overridden by subclasses.void
Sets the timestamp to the current system time milliseconds.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.snmp4j.agent.agentx.master.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:
updateTimestamp
in interfaceAgentXPending<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 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:
setTimeout
in interfaceAgentXPending<A extends org.snmp4j.smi.Address>
- Parameters:
timeoutSeconds
- timeout seconds.
-
setPending
public void setPending(boolean pending) Sets the pending flag.- Specified by:
setPending
in interfaceAgentXPending<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 interfaceAgentXPending<A extends org.snmp4j.smi.Address>
- Returns:
- a timeout in seconds.
-
getRegistration
The registration region affected by this request.- Specified by:
getRegistration
in 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:
isPending
in interfaceAgentXPending<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 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.
-