Package org.snmp4j.agent.agentx.master
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 AgentXNode
s only.- Author:
- Frank Fock
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
QueryAgentXNode
s only.static final int
Query allManagedObject
s.static final int
Query non-AgentXNode
s only. -
Constructor Summary
ConstructorDescriptionAgentXNodeQuery
(org.snmp4j.smi.OctetString context, org.snmp4j.agent.MOScope scope, int queryMode) Creates aAgentXNodeQuery
with query mode. -
Method Summary
Modifier and TypeMethodDescriptionorg.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 providedManagedObject
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
-
Field Details
-
QUERY_AGENTX_NODES
public static final int QUERY_AGENTX_NODESQueryAgentXNode
s only.- See Also:
-
QUERY_NON_AGENTX_NODES
public static final int QUERY_NON_AGENTX_NODESQuery non-AgentXNode
s only.- See Also:
-
QUERY_ALL
public static final int QUERY_ALLQuery allManagedObject
s.- See Also:
-
-
Constructor Details
-
AgentXNodeQuery
public AgentXNodeQuery(org.snmp4j.smi.OctetString context, org.snmp4j.agent.MOScope scope, int queryMode) Creates aAgentXNodeQuery
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 providedManagedObject
matches this query type.- Specified by:
matchesQuery
in interfaceorg.snmp4j.agent.MOQuery
- Overrides:
matchesQuery
in classorg.snmp4j.agent.DefaultMOQuery
- Parameters:
managedObject
- aManagedObject
- Returns:
true
ifmanagedObject
is matching the query modeQUERY_NON_AGENTX_NODES
orQUERY_AGENTX_NODES
. If mode isQUERY_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 interfaceorg.snmp4j.agent.MOQuery
- Overrides:
subtractScope
in classorg.snmp4j.agent.DefaultMOQuery
- Parameters:
scope
- the scope to subtract.
-