java.lang.Object
org.snmp4j.agent.DefaultMOScope
- All Implemented Interfaces:
MOScope,MutableMOScope
- Direct Known Subclasses:
DefaultMOContextScope
- Version:
- 3.5.2
- Author:
- Frank Fock
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.snmp4j.smi.OIDprotected booleanprotected org.snmp4j.smi.OIDprotected boolean -
Constructor Summary
ConstructorsConstructorDescriptionDefaultMOScope(MOScope other) Creates a scope from another scope by referencing its bound values.DefaultMOScope(org.snmp4j.smi.OID lowerBound, boolean lowerIncluded, org.snmp4j.smi.OID upperBound, boolean upperIncluded) Creates an OID scope from lower and upper bound. -
Method Summary
Modifier and TypeMethodDescriptionbooleanIndicates whether this scope covers by the supplied one, that is whether the lower bound of this scope is less or equal to the lower bound of the covered scope and if the upper bound is greater or equal to the upper bound of the covered scope.static booleanIndicates whether the first supplied scope covers by second one.booleancovers(org.snmp4j.smi.OID oid) Checks if this scope covers the supplied OID.booleanorg.snmp4j.smi.OIDGets the lower bound OID of the scope.org.snmp4j.smi.OIDGets the upper bound OID of the scope.inthashCode()booleanChecks whether the supplied scope is covered by this scope.booleanisEmpty()Checks if this scope is empty or not.booleanIndicates whether the lower bound OID is included in the scope or not.booleanisOverlapping(MOScope other) Checks whether the supplied scope overlap with this one, thus sharing at least one OID with the supplied one.booleanIndicates whether the upper bound OID is included in the scope or not.static booleanIndicates whether the first scope supplied overlaps with the second one.voidsetLowerBound(org.snmp4j.smi.OID lowerBound) Sets the lower bound OID of the scope.voidsetLowerIncluded(boolean lowerIncluded) Sets the flag specifying whether the lower bound OID is included in the scope or not.voidsetUpperBound(org.snmp4j.smi.OID upperBound) Sets the upper bound OID of the scope (can benullfor an unbounded scope.voidsetUpperIncluded(boolean upperIncluded) Sets the flag specifying whether the upper bound OID is included in the scope or not.voidsubtractScope(MOScope scope) Changes the scope to no longer cover any elements in covered by the specified scope.toString()
-
Field Details
-
lowerBound
protected org.snmp4j.smi.OID lowerBound -
upperBound
protected org.snmp4j.smi.OID upperBound -
lowerIncluded
protected boolean lowerIncluded -
upperIncluded
protected boolean upperIncluded
-
-
Constructor Details
-
DefaultMOScope
public DefaultMOScope(org.snmp4j.smi.OID lowerBound, boolean lowerIncluded, org.snmp4j.smi.OID upperBound, boolean upperIncluded) Creates an OID scope from lower and upper bound.- Parameters:
lowerBound- the lower bound of the scope.lowerIncluded- indicates whether the lower bound is included in the scope or not.upperBound- the upper bound of the scope,nullcan be specified to set no upper limit.upperIncluded- indicates whether the upper bound is included in the scope or not.
-
DefaultMOScope
Creates a scope from another scope by referencing its bound values.- Parameters:
other- another scope.
-
-
Method Details
-
getLowerBound
public org.snmp4j.smi.OID getLowerBound()Description copied from interface:MOScopeGets the lower bound OID of the scope. Whether the lower bound is included or excluded from the scope's region is determined byMOScope.isLowerIncluded().- Specified by:
getLowerBoundin interfaceMOScope- Returns:
- an OID.
-
getUpperBound
public org.snmp4j.smi.OID getUpperBound()Description copied from interface:MOScopeGets the upper bound OID of the scope. Whether the upper bound is included or excluded from the scope's region is determined byMOScope.isUpperIncluded().- Specified by:
getUpperBoundin interfaceMOScope- Returns:
- OID
-
isLowerIncluded
public boolean isLowerIncluded()Description copied from interface:MOScopeIndicates whether the lower bound OID is included in the scope or not.- Specified by:
isLowerIncludedin interfaceMOScope- Returns:
trueif the lower bound is included.
-
isUpperIncluded
public boolean isUpperIncluded()Description copied from interface:MOScopeIndicates whether the upper bound OID is included in the scope or not.- Specified by:
isUpperIncludedin interfaceMOScope- Returns:
trueif the upper bound is included.
-
isCovered
Description copied from interface:MOScopeChecks whether the supplied scope is covered by this scope. -
isOverlapping
Description copied from interface:MOScopeChecks whether the supplied scope overlap with this one, thus sharing at least one OID with the supplied one.- Specified by:
isOverlappingin interfaceMOScope- Parameters:
other- aMOScope.- Returns:
trueif there exists at least one OID that is included in both scopes.
-
setLowerBound
public void setLowerBound(org.snmp4j.smi.OID lowerBound) Description copied from interface:MutableMOScopeSets the lower bound OID of the scope.- Specified by:
setLowerBoundin interfaceMutableMOScope- Parameters:
lowerBound- an OID.
-
setLowerIncluded
public void setLowerIncluded(boolean lowerIncluded) Description copied from interface:MutableMOScopeSets the flag specifying whether the lower bound OID is included in the scope or not.- Specified by:
setLowerIncludedin interfaceMutableMOScope- Parameters:
lowerIncluded-trueif the lower bound is included,falseotherwise.
-
setUpperBound
public void setUpperBound(org.snmp4j.smi.OID upperBound) Description copied from interface:MutableMOScopeSets the upper bound OID of the scope (can benullfor an unbounded scope.- Specified by:
setUpperBoundin interfaceMutableMOScope- Parameters:
upperBound- an OID ornull.
-
setUpperIncluded
public void setUpperIncluded(boolean upperIncluded) Description copied from interface:MutableMOScopeSets the flag specifying whether the upper bound OID is included in the scope or not. This flag has no effect ifupperBoundisnull.- Specified by:
setUpperIncludedin interfaceMutableMOScope- Parameters:
upperIncluded-trueif the upper bound is included,falseotherwise.
-
equals
-
hashCode
public int hashCode() -
covers
Indicates whether this scope covers by the supplied one, that is whether the lower bound of this scope is less or equal to the lower bound of the covered scope and if the upper bound is greater or equal to the upper bound of the covered scope.- Parameters:
covered- a MOScope instance.- Returns:
trueif this OID scope covers the supplied one.
-
covers
Indicates whether the first supplied scope covers by second one.- Parameters:
scope- the covering scope.covered- the covered scope.- Returns:
trueif the lower bound ofscopeis less or equal to the lower bound ofcoveredand if the upper bound is greater or equal to the upper bound ofcovered.
-
overlaps
Indicates whether the first scope supplied overlaps with the second one. If both scopes are instances of MOContextScope their context must match- Parameters:
scope- a MOScope instance.intersected- the presumable intersected MOScope.- Returns:
trueifscopeoverlaps any bound ofintersected. This is always the case, if the upper bound of both scopes isnull.
-
subtractScope
Description copied from interface:MutableMOScopeChanges the scope to no longer cover any elements in covered by the specified scope.- Specified by:
subtractScopein interfaceMutableMOScope- Parameters:
scope- aMOScopeinstance that defines the range of OIDs that should be no longer in this scope.
-
covers
public boolean covers(org.snmp4j.smi.OID oid) Description copied from interface:MOScopeChecks if this scope covers the supplied OID. -
isEmpty
public boolean isEmpty()Checks if this scope is empty or not. An empty scope cannot cover any OID (i.e. lower bound is greater than upper bound).- Returns:
trueif lower bound is greater than upper bound or if both bounds equal but one of the bounds is not-included.
-
toString
-