Package org.snmp4j.agent.agentx
Class AgentXRegion
java.lang.Object
org.snmp4j.agent.DefaultMOScope
org.snmp4j.agent.agentx.AgentXRegion
- All Implemented Interfaces:
Serializable
,Comparable<AgentXRegion>
,org.snmp4j.agent.MOScope
,org.snmp4j.agent.MutableMOScope
public class AgentXRegion
extends org.snmp4j.agent.DefaultMOScope
implements Comparable<AgentXRegion>, Serializable
The
AgentXRegion
represents a MIB region which can be an entire MIB or a single object-instance.- See Also:
-
Field Summary
Fields inherited from class org.snmp4j.agent.DefaultMOScope
lowerBound, lowerIncluded, upperBound, upperIncluded
-
Constructor Summary
ConstructorDescriptionAgentXRegion
(AgentXRegion other) Creates a copy of anAgentXRegion
.AgentXRegion
(org.snmp4j.smi.OID lowerBound, org.snmp4j.smi.OID upperBound) Creates a newAgentXRegion
from lower and upper bound. -
Method Summary
Modifier and TypeMethodDescriptionint
compareTo
(AgentXRegion other) int
Gets the lower bound sub-ID of a range.byte
Gets the range sub-id (i.e.int
Gets the upper bound of the region.boolean
isEmpty()
Checks if there is at least a singleOID
contained in this MIB region.boolean
isRange()
Checks if this region is a object instance range.boolean
Checks if the MIB region represents a single object-instance.void
setRangeSubID
(byte rangeSubID) Sets the range sub-id (i.e.void
setSingleOID
(boolean singleOID) Indicates if the MIB region represents a single object-instance.toString()
Methods inherited from class org.snmp4j.agent.DefaultMOScope
covers, covers, covers, equals, getLowerBound, getUpperBound, hashCode, isCovered, isLowerIncluded, isOverlapping, isUpperIncluded, overlaps, setLowerBound, setLowerIncluded, setUpperBound, setUpperIncluded, subtractScope
-
Constructor Details
-
AgentXRegion
public AgentXRegion(org.snmp4j.smi.OID lowerBound, org.snmp4j.smi.OID upperBound) Creates a newAgentXRegion
from lower and upper bound.- Parameters:
lowerBound
- the lower bound of the region (including).upperBound
- the upper bound of the region (excluding).
-
AgentXRegion
Creates a copy of anAgentXRegion
.- Parameters:
other
- the original region.
-
-
Method Details
-
getRangeSubID
public byte getRangeSubID()Gets the range sub-id (i.e. the "wildcard" sub-identifier index).- Returns:
- the range sub ID index.
-
isSingleOID
public boolean isSingleOID()Checks if the MIB region represents a single object-instance.- Returns:
true
if this region represents a single object-instance.
-
setRangeSubID
public void setRangeSubID(byte rangeSubID) Sets the range sub-id (i.e. the "wildcard" sub-identifier index).- Parameters:
rangeSubID
- the range sub ID index.
-
setSingleOID
public void setSingleOID(boolean singleOID) Indicates if the MIB region represents a single object-instance.- Parameters:
singleOID
-true
if this region represents a single object-instance.
-
getUpperBoundSubID
public int getUpperBoundSubID()Gets the upper bound of the region.- Returns:
0
if this is not a range region, and the upper bound range-sub-identifier otherwise.
-
isRange
public boolean isRange()Checks if this region is a object instance range.- Returns:
true
ifgetRangeSubID()
is greater than zero.
-
isEmpty
public boolean isEmpty()Checks if there is at least a singleOID
contained in this MIB region.- Overrides:
isEmpty
in classorg.snmp4j.agent.DefaultMOScope
- Returns:
true
if upper bound is greater or equals lower bound.
-
getLowerBoundSubID
public int getLowerBoundSubID()Gets the lower bound sub-ID of a range.- Returns:
0
if this is not a range region, and the lower bound range-sub-identifier otherwise.
-
compareTo
- Specified by:
compareTo
in interfaceComparable<AgentXRegion>
-
toString
- Overrides:
toString
in classorg.snmp4j.agent.DefaultMOScope
-