Class AgentXNodeQuery

java.lang.Object
org.snmp4j.agent.DefaultMOQuery
org.snmp4j.agent.agentx.master.AgentXNodeQuery
All Implemented Interfaces:
org.snmp4j.agent.MOContextScope, org.snmp4j.agent.MOQuery, org.snmp4j.agent.MOScope

public class AgentXNodeQuery extends org.snmp4j.agent.DefaultMOQuery
The AgentXNodeQuery extends the DefaultMOQuery to allow on-the-fly query modifications and special matchesQuery(ManagedObject) support for explicitly match or not match AgentXNodes only.
Author:
Frank Fock
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    Query AgentXNodes only.
    static final int
    Query all ManagedObjects.
    static final int
    Query non-AgentXNodes only.
  • Constructor Summary

    Constructors
    Constructor
    Description
    AgentXNodeQuery(org.snmp4j.smi.OctetString context, org.snmp4j.agent.MOScope scope, int queryMode)
    Creates a AgentXNodeQuery with query mode.
  • Method Summary

    Modifier and Type
    Method
    Description
    org.snmp4j.agent.DefaultMOContextScope
    Returns its scope as mutable, to allow query modification on-the-fly.
    boolean
    matchesQuery(org.snmp4j.agent.ManagedObject<?> managedObject)
    Check if the provided ManagedObject matches this query type.
    void
    subtractScope(org.snmp4j.agent.MOScope scope)
    Subtract the given scope from the query scope, i.e.

    Methods inherited from class org.snmp4j.agent.DefaultMOQuery

    covers, getContext, getLowerBound, getScope, getSource, getUpperBound, isCovered, isLowerIncluded, isOverlapping, isUpperIncluded, isWriteAccessQuery, toString

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

  • Constructor Details

    • AgentXNodeQuery

      public AgentXNodeQuery(org.snmp4j.smi.OctetString context, org.snmp4j.agent.MOScope scope, int queryMode)
      Creates a AgentXNodeQuery with query mode.
      Parameters:
      context - the SNMPv3 context for the query.
      scope - the scope of the query.
      queryMode - an integer value specifying the search mode: QUERY_NON_AGENTX_NODES..QUERY_ALL.
  • Method Details

    • getMutableScope

      public org.snmp4j.agent.DefaultMOContextScope getMutableScope()
      Returns its scope as mutable, to allow query modification on-the-fly.
      Returns:
      the internal DefaultMOContextScope for modification.
    • matchesQuery

      public boolean matchesQuery(org.snmp4j.agent.ManagedObject<?> managedObject)
      Check if the provided ManagedObject matches this query type.
      Specified by:
      matchesQuery in interface org.snmp4j.agent.MOQuery
      Overrides:
      matchesQuery in class org.snmp4j.agent.DefaultMOQuery
      Parameters:
      managedObject - a ManagedObject
      Returns:
      true if managedObject is matching the query mode QUERY_NON_AGENTX_NODES or QUERY_AGENTX_NODES. If mode is QUERY_ALL, true is returned always.
    • subtractScope

      public void subtractScope(org.snmp4j.agent.MOScope scope)
      Subtract the given scope from the query scope, i.e. reducing the scope by already done regions.
      Specified by:
      subtractScope in interface org.snmp4j.agent.MOQuery
      Overrides:
      subtractScope in class org.snmp4j.agent.DefaultMOQuery
      Parameters:
      scope - the scope to subtract.