Class AgentXQueue

java.lang.Object
org.snmp4j.agent.agentx.master.AgentXQueue
All Implemented Interfaces:
Serializable

public class AgentXQueue extends Object implements Serializable
The AgentXQueue holds AgentX requests that are processed by the master agent by sending the requests to the subagents and waiting for responses.
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a new AgentXQueue.
  • Method Summary

    Modifier and Type
    Method
    Description
    <A extends org.snmp4j.smi.Address>
    boolean
    add(AgentXSearchRange searchRange, AgentXRegEntry<A> entry, boolean repeater)
    Adds a search range to a GET request.
    <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.
    <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.
    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 the MOServer instances used for GETBULK optimization.
    protected void
    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 the MOServer instances for GETBULK optimization.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • AgentXQueue

      public AgentXQueue()
      Creates a new AgentXQueue.
  • Method Details

    • setServer4BulkOptimization

      public void setServer4BulkOptimization(org.snmp4j.agent.MOServer[] servers)
      Sets the MOServer instances for GETBULK optimization.
      Parameters:
      servers - an array of MOServer instances.
    • getServer4BulkOptimization

      public org.snmp4j.agent.MOServer[] getServer4BulkOptimization()
      Gets the MOServer 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-request
      entry - 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.
    • 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 - true if 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. See AgentXPendingGet.oidFilter.
      Returns:
      true if the request has been added.
      Since:
      4.1.0
    • optimizeSearchRange

      protected void optimizeSearchRange(AgentXSearchRange searchRange, AgentXRegEntry<?> entry)
      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

      public AgentXPending<?> get(int sessionID, int transactionID)
      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 or null if no such request exists.
    • remove

      public AgentXPending<?> 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.
      Parameters:
      sessionID - the session ID.
      transactionID - the transaction ID.
      Returns:
      the associated AgentXPending instance or null 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.