Package org.snmp4j.agent.agentx.master
Class AgentXQueue
java.lang.Object
org.snmp4j.agent.agentx.master.AgentXQueue
- All Implemented Interfaces:
Serializable
The
AgentXQueue
holds AgentX requests that are processed by the master agent by sending the requests
to the sub-agents and waiting for responses.- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription<A extends org.snmp4j.smi.Address>
booleanadd
(AgentXSearchRange searchRange, AgentXRegEntry<A> entry, boolean repeater) Adds a search range to a GET request.<A extends org.snmp4j.smi.Address>
booleanadd
(org.snmp4j.smi.VariableBinding vb, org.snmp4j.agent.request.SnmpRequest.SnmpSubRequest subRequest, AgentXRegEntry<A> entry) Adds a variable binding to a pending SET request (if not in progress yet) or creating a new SET request.org.snmp4j.agent.agentx.master.AgentXQueue.AgentXQueueEntry
<?> get
(int transactionID) Return all pending AgentX requests for the specified transaction ID.get
(int sessionID, int transactionID) Returns the AgentX request in the queue identified by an AgentX session ID and a transaction ID.org.snmp4j.agent.MOServer[]
Gets theMOServer
instances used for GETBULK optimization.protected void
optimizeSearchRange
(AgentXSearchRange searchRange, AgentXRegEntry<?> entry) Optimizes the search range to limit sub-agent request to upper bounds know in the master apriori.remove
(int sessionID, int transactionID) Returns the AgentX request in the queue identified by an AgentX session ID and a transaction ID and removes that request from the queue.void
removeAll
(int transactionID) Remove all AgentX request entries for the supplied transaction ID.void
setServer4BulkOptimization
(org.snmp4j.agent.MOServer[] servers) Sets theMOServer
instances for GETBULK optimization.
-
Constructor Details
-
AgentXQueue
public AgentXQueue()Creates a newAgentXQueue
.
-
-
Method Details
-
setServer4BulkOptimization
public void setServer4BulkOptimization(org.snmp4j.agent.MOServer[] servers) Sets theMOServer
instances for GETBULK optimization.- Parameters:
servers
- an array ofMOServer
instances.
-
getServer4BulkOptimization
public org.snmp4j.agent.MOServer[] getServer4BulkOptimization()Gets theMOServer
instances used for GETBULK optimization.- Returns:
MOServer
instances for GETBULK optimization.
-
add
public <A extends org.snmp4j.smi.Address> boolean add(org.snmp4j.smi.VariableBinding vb, org.snmp4j.agent.request.SnmpRequest.SnmpSubRequest subRequest, AgentXRegEntry<A> entry) Adds a variable binding to a pending SET request (if not in progress yet) or creating a new SET request.- Type Parameters:
A
- address type.- Parameters:
vb
- the variable binding.subRequest
- the SNMP sub-requestentry
- the registration entry on whose behalf this request is being processed.- Returns:
true
if the request has been added.
-
add
public <A extends org.snmp4j.smi.Address> boolean add(AgentXSearchRange searchRange, AgentXRegEntry<A> entry, boolean repeater) Adds a search range to a GET request.- Type Parameters:
A
- address type.- Parameters:
searchRange
- the search range to add.entry
- the registration entry.repeater
-true
if the added search Range is a repeating range.- Returns:
true
if the request has been added.
-
optimizeSearchRange
Optimizes the search range to limit sub-agent request to upper bounds know in the master apriori.- Parameters:
searchRange
- the search range to optimize.entry
- the registration entry for the search.
-
get
Returns the AgentX request in the queue identified by an AgentX session ID and a transaction ID.- Parameters:
sessionID
- the session ID.transactionID
- the transaction ID.- Returns:
- the associated
AgentXPending
instance ornull
if no such request exists.
-
remove
Returns the AgentX request in the queue identified by an AgentX session ID and a transaction ID and removes that request from the queue.- Parameters:
sessionID
- the session ID.transactionID
- the transaction ID.- Returns:
- the associated
AgentXPending
instance ornull
if no such request exists.
-
get
public org.snmp4j.agent.agentx.master.AgentXQueue.AgentXQueueEntry<?> get(int transactionID) Return all pending AgentX requests for the specified transaction ID.- Parameters:
transactionID
- a transcation ID.- Returns:
- a possibly empty List of pending requests.
-
removeAll
public void removeAll(int transactionID) Remove all AgentX request entries for the supplied transaction ID.- Parameters:
transactionID
- a transaction ID.
-