- java.lang.Object
-
- org.snmp4j.agent.DefaultMOQuery
-
- org.snmp4j.agent.MOQueryWithSource
-
- All Implemented Interfaces:
MOContextScope
,MOQuery
,MOScope
public class MOQueryWithSource extends DefaultMOQuery
TheMOQueryWithSource
class is the implementation of a managed object query for aRequest
. It is used to lookup managed objects, for example in aMOServer
repository.- Since:
- 2.0
- Version:
- 2.0
- Author:
- Frank Fock
-
-
Constructor Summary
Constructors Constructor Description MOQueryWithSource(MOContextScope scope, boolean isWriteAccessIntended, Object source)
Creates a context aware query from a context aware OID scope.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
getSource()
Gets the source (Request
) object on whose behalf this query is executed.static boolean
isSameSource(MOQuery query, Object source)
This method checks whether the supplied query and the given source reference refer to the same source (request).-
Methods inherited from class org.snmp4j.agent.DefaultMOQuery
covers, getContext, getLowerBound, getScope, getUpperBound, isCovered, isLowerIncluded, isOverlapping, isUpperIncluded, isWriteAccessQuery, matchesQuery, substractScope, toString
-
-
-
-
Constructor Detail
-
MOQueryWithSource
public MOQueryWithSource(MOContextScope scope, boolean isWriteAccessIntended, Object source)
Creates a context aware query from a context aware OID scope.- Parameters:
scope
- a scope that defines the possible result set of OIDs from a specific context for this query.isWriteAccessIntended
- indicates whether this query serves a write access onManagedObject
s or not.source
- theRequest
on whose behalf this query is being executed.- Since:
- 2.0
-
-
Method Detail
-
getSource
public Object getSource()
Gets the source (Request
) object on whose behalf this query is executed. This object reference can be used to determine whether a query needs to updateManagedObject
content or not. When the reference is the same as those from the last query then an update is not necessary.- Overrides:
getSource
in classDefaultMOQuery
- Returns:
- an Object on whose behalf this query is executed which will be in most
cases a
Request
instance, but code should not rely on that. Ifnull
is returned, the query source cannot be determined. - Since:
- 1.1
-
isSameSource
public static boolean isSameSource(MOQuery query, Object source)
This method checks whether the supplied query and the given source reference refer to the same source (request).- Parameters:
query
- aMOQuery
instance.source
- any source object reference.- Returns:
true
only ifquery
is aDefaultMOQuery
instance andgetSource()
== source
and source is notnull
.- Since:
- 1.1
-
-