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
Constructors -
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(AgentXSearchRange searchRange, AgentXRegEntry<A> entry, boolean repeater, Function<org.snmp4j.smi.OID, Boolean> filter) 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 theMOServerinstances used for GETBULK optimization.protected voidoptimizeSearchRange(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.voidremoveAll(int transactionID) Remove all AgentX request entries for the supplied transaction ID.voidsetServer4BulkOptimization(org.snmp4j.agent.MOServer[] servers) Sets theMOServerinstances for GETBULK optimization.
-
Constructor Details
-
AgentXQueue
public AgentXQueue()Creates a newAgentXQueue.
-
-
Method Details
-
setServer4BulkOptimization
public void setServer4BulkOptimization(org.snmp4j.agent.MOServer[] servers) Sets theMOServerinstances for GETBULK optimization.- Parameters:
servers- an array ofMOServerinstances.
-
getServer4BulkOptimization
public org.snmp4j.agent.MOServer[] getServer4BulkOptimization()Gets theMOServerinstances used for GETBULK optimization.- Returns:
MOServerinstances 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:
trueif 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-trueif the added search Range is a repeating range.- Returns:
trueif the request has been added.
-
add
public <A extends org.snmp4j.smi.Address> boolean add(AgentXSearchRange searchRange, AgentXRegEntry<A> entry, boolean repeater, Function<org.snmp4j.smi.OID, Boolean> filter) 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-trueif the added search Range is a repeating range.filter- an optional filter that accepts only certain OIDs returned by a subagent, for example used by VACM or for skipping known implementation errors in subagents. SeeAgentXPendingGet.oidFilter.- Returns:
trueif the request has been added.- Since:
- 4.1.0
-
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
AgentXPendinginstance ornullif 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
AgentXPendinginstance ornullif 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.
-