Package org.snmp4j.agent.agentx.master
Class AgentXNode
java.lang.Object
org.snmp4j.agent.agentx.master.AgentXNode
- All Implemented Interfaces:
org.snmp4j.agent.ManagedObject<org.snmp4j.agent.request.SubRequest<?>>
,org.snmp4j.agent.mo.GenericManagedObject
A
AgentXNode
represents an atomic registration
region within the master agents ManagedObject
s.
There can be several AgentXNodes for a single AgentX
region registration.- Version:
- 3.0
- Author:
- Frank Fock
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
AgentXNode
(AgentXRegion region, TreeSet<AgentXRegEntry<?>> registrations) Creates anAgentXNode
for a region and corresponding registration.AgentXNode
(AgentXRegion region, AgentXRegEntry<?> registration) Creates anAgentXNode
for a region and corresponding registration. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addRegistration
(AgentXRegEntry<?> entry) Adds a registration.void
cleanup
(org.snmp4j.agent.request.SnmpRequest.SnmpSubRequest request) Processes an SNMP SETSubRequest
cleanup by sending a AgentX request to the appropriate sub-agent(s).void
cleanup
(org.snmp4j.agent.request.SubRequest<?> request) void
commit
(org.snmp4j.agent.request.SnmpRequest.SnmpSubRequest request) Processes an SNMP SETSubRequest
commit by sending a AgentX request to the appropriate sub-agent(s).void
commit
(org.snmp4j.agent.request.SubRequest<?> request) boolean
expand
(org.snmp4j.smi.OID upper, boolean inclusive) Expand a node's region the new upper bound.org.snmp4j.smi.OID
find
(org.snmp4j.agent.MOScope range) void
get
(org.snmp4j.agent.request.SnmpRequest.SnmpSubRequest request) Processes an SNMP GETSubRequest
by sending a AgentX request to the appropriate sub-agent(s).void
get
(org.snmp4j.agent.request.SubRequest<?> request) final AgentXRegEntry
<?> Gets the active (i.e.getClone
(AgentXRegion region) Gets a deep clone of this node but with a new region.int
Gets the number of registrations for this region/node.org.snmp4j.agent.MOScope
getScope()
boolean
next
(org.snmp4j.agent.request.SnmpRequest.SnmpSubRequest request) Processes an SNMP NEXTSubRequest
by sending a AgentX request to the appropriate sub-agent(s).boolean
next
(org.snmp4j.agent.request.SnmpRequest.SnmpSubRequest request, Function<org.snmp4j.smi.OID, Boolean> filter) boolean
next
(org.snmp4j.agent.request.SubRequest<?> request) boolean
void
prepare
(org.snmp4j.agent.request.SnmpRequest.SnmpSubRequest request) Processes an SNMP SETSubRequest
preparation by sending a AgentX request to the appropriate sub-agent(s).void
prepare
(org.snmp4j.agent.request.SubRequest<?> request) boolean
removeRegistration
(AgentXRegEntry<?> entry) Removes a registration.boolean
shrink
(org.snmp4j.smi.OID upper) Shrink a node's region the new upper bound.toString()
void
undo
(org.snmp4j.agent.request.SnmpRequest.SnmpSubRequest request) Processes an SNMP SETSubRequest
undo by sending a AgentX request to the appropriate sub-agent(s).void
undo
(org.snmp4j.agent.request.SubRequest<?> request) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.snmp4j.agent.ManagedObject
find
-
Constructor Details
-
AgentXNode
Creates anAgentXNode
for a region and corresponding registration.- Parameters:
region
- the region (scope) for the newAgentXNode
.registration
- the registration associated withregion
.
-
AgentXNode
Creates anAgentXNode
for a region and corresponding registration.- Parameters:
region
- the region (scope) for the newAgentXNode
.registrations
- the registrations associated withregion
.
-
-
Method Details
-
getClone
Gets a deep clone of this node but with a new region.- Parameters:
region
- the new region for this clone which will be copied into the new node.- Returns:
- a new
AgentXNode
with the provided region and its registrations. Both as a copy of the original references.
-
getRegistrationCount
public int getRegistrationCount()Gets the number of registrations for this region/node.- Returns:
- number of registrations.
-
shrink
public boolean shrink(org.snmp4j.smi.OID upper) Shrink a node's region the new upper bound.- Parameters:
upper
- the new upper bound.- Returns:
true
if the new upper bound is covered by the current region (thus shrinking had an effect).
-
expand
public boolean expand(org.snmp4j.smi.OID upper, boolean inclusive) Expand a node's region the new upper bound.- Parameters:
upper
- the new upper bound.inclusive
- determines ofupper
itself is included or not by the expanded region.- Returns:
true
if the new upper bound is not covered by the current region (thus shrinking had an effect).
-
addRegistration
Adds a registration.- Parameters:
entry
- a new registration to be added to the node.
-
removeRegistration
Removes a registration.- Parameters:
entry
- the registration to remove.- Returns:
true
if successfully removed.
-
find
public org.snmp4j.smi.OID find(org.snmp4j.agent.MOScope range) - Specified by:
find
in interfaceorg.snmp4j.agent.ManagedObject<org.snmp4j.agent.request.SubRequest<?>>
-
getActiveRegistration
Gets the active (i.e. with the highest precedence) registration.- Returns:
- the registration entry with the highest precedence or
null
if there is no registration for any active session left.
-
get
public void get(org.snmp4j.agent.request.SubRequest<?> request) - Specified by:
get
in interfaceorg.snmp4j.agent.ManagedObject<org.snmp4j.agent.request.SubRequest<?>>
-
get
public void get(org.snmp4j.agent.request.SnmpRequest.SnmpSubRequest request) Processes an SNMP GETSubRequest
by sending a AgentX request to the appropriate sub-agent(s).- Parameters:
request
- a GET sub-request.
-
getScope
public org.snmp4j.agent.MOScope getScope()- Specified by:
getScope
in interfaceorg.snmp4j.agent.ManagedObject<org.snmp4j.agent.request.SubRequest<?>>
-
next
public boolean next(org.snmp4j.agent.request.SubRequest<?> request) - Specified by:
next
in interfaceorg.snmp4j.agent.ManagedObject<org.snmp4j.agent.request.SubRequest<?>>
-
next
public boolean next(org.snmp4j.agent.request.SnmpRequest.SnmpSubRequest request) Processes an SNMP NEXTSubRequest
by sending a AgentX request to the appropriate sub-agent(s).- Parameters:
request
- a GETNEXT sub-request.- Returns:
true
if a AgentX request has been created.
-
next
public boolean next(org.snmp4j.agent.request.SubRequest<?> request, Function<org.snmp4j.smi.OID, Boolean> filter) - Specified by:
next
in interfaceorg.snmp4j.agent.ManagedObject<org.snmp4j.agent.request.SubRequest<?>>
-
next
-
prepare
public void prepare(org.snmp4j.agent.request.SubRequest<?> request) - Specified by:
prepare
in interfaceorg.snmp4j.agent.ManagedObject<org.snmp4j.agent.request.SubRequest<?>>
-
prepare
public void prepare(org.snmp4j.agent.request.SnmpRequest.SnmpSubRequest request) Processes an SNMP SETSubRequest
preparation by sending a AgentX request to the appropriate sub-agent(s).- Parameters:
request
- a SET sub-request.
-
undo
public void undo(org.snmp4j.agent.request.SubRequest<?> request) - Specified by:
undo
in interfaceorg.snmp4j.agent.ManagedObject<org.snmp4j.agent.request.SubRequest<?>>
-
undo
public void undo(org.snmp4j.agent.request.SnmpRequest.SnmpSubRequest request) Processes an SNMP SETSubRequest
undo by sending a AgentX request to the appropriate sub-agent(s).- Parameters:
request
- a SET sub-request.
-
cleanup
public void cleanup(org.snmp4j.agent.request.SubRequest<?> request) - Specified by:
cleanup
in interfaceorg.snmp4j.agent.ManagedObject<org.snmp4j.agent.request.SubRequest<?>>
-
cleanup
public void cleanup(org.snmp4j.agent.request.SnmpRequest.SnmpSubRequest request) Processes an SNMP SETSubRequest
cleanup by sending a AgentX request to the appropriate sub-agent(s).- Parameters:
request
- a SET sub-request.
-
commit
public void commit(org.snmp4j.agent.request.SubRequest<?> request) - Specified by:
commit
in interfaceorg.snmp4j.agent.ManagedObject<org.snmp4j.agent.request.SubRequest<?>>
-
commit
public void commit(org.snmp4j.agent.request.SnmpRequest.SnmpSubRequest request) Processes an SNMP SETSubRequest
commit by sending a AgentX request to the appropriate sub-agent(s).- Parameters:
request
- a SET sub-request.
-
toString
-