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 ManagedObjects.
There can be several AgentXNodes for a single AgentX
region registration.- Version:
- 3.0
- Author:
- Frank Fock
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAgentXNode(AgentXRegion region, TreeSet<AgentXRegEntry<?>> registrations) Creates anAgentXNodefor a region and corresponding registration.AgentXNode(AgentXRegion region, AgentXRegEntry<?> registration) Creates anAgentXNodefor a region and corresponding registration. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddRegistration(AgentXRegEntry<?> entry) Adds a registration.voidcleanup(org.snmp4j.agent.request.SnmpRequest.SnmpSubRequest request) Processes an SNMP SETSubRequestcleanup by sending a AgentX request to the appropriate sub-agent(s).voidcleanup(org.snmp4j.agent.request.SubRequest<?> request) voidcommit(org.snmp4j.agent.request.SnmpRequest.SnmpSubRequest request) Processes an SNMP SETSubRequestcommit by sending a AgentX request to the appropriate sub-agent(s).voidcommit(org.snmp4j.agent.request.SubRequest<?> request) booleanexpand(org.snmp4j.smi.OID upper, boolean inclusive) Expand a node's region the new upper bound.org.snmp4j.smi.OIDfind(org.snmp4j.agent.MOScope range) voidget(org.snmp4j.agent.request.SnmpRequest.SnmpSubRequest request) Processes an SNMP GETSubRequestby sending a AgentX request to the appropriate sub-agent(s).voidget(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.intGets the number of registrations for this region/node.org.snmp4j.agent.MOScopegetScope()booleannext(org.snmp4j.agent.request.SnmpRequest.SnmpSubRequest request) Processes an SNMP NEXTSubRequestby sending a AgentX request to the appropriate sub-agent(s).booleannext(org.snmp4j.agent.request.SnmpRequest.SnmpSubRequest request, Function<org.snmp4j.smi.OID, Boolean> filter) booleannext(org.snmp4j.agent.request.SubRequest<?> request) booleanvoidprepare(org.snmp4j.agent.request.SnmpRequest.SnmpSubRequest request) Processes an SNMP SETSubRequestpreparation by sending a AgentX request to the appropriate sub-agent(s).voidprepare(org.snmp4j.agent.request.SubRequest<?> request) booleanremoveRegistration(AgentXRegEntry<?> entry) Removes a registration.booleanshrink(org.snmp4j.smi.OID upper) Shrink a node's region the new upper bound.toString()voidundo(org.snmp4j.agent.request.SnmpRequest.SnmpSubRequest request) Processes an SNMP SETSubRequestundo by sending a AgentX request to the appropriate sub-agent(s).voidundo(org.snmp4j.agent.request.SubRequest<?> request) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.snmp4j.agent.ManagedObject
find
-
Constructor Details
-
AgentXNode
Creates anAgentXNodefor a region and corresponding registration.- Parameters:
region- the region (scope) for the newAgentXNode.registration- the registration associated withregion.
-
AgentXNode
Creates anAgentXNodefor 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
AgentXNodewith 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:
trueif 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 ofupperitself is included or not by the expanded region.- Returns:
trueif 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:
trueif successfully removed.
-
find
public org.snmp4j.smi.OID find(org.snmp4j.agent.MOScope range) - Specified by:
findin 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
nullif there is no registration for any active session left.
-
get
public void get(org.snmp4j.agent.request.SubRequest<?> request) - Specified by:
getin interfaceorg.snmp4j.agent.ManagedObject<org.snmp4j.agent.request.SubRequest<?>>
-
get
public void get(org.snmp4j.agent.request.SnmpRequest.SnmpSubRequest request) Processes an SNMP GETSubRequestby 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:
getScopein interfaceorg.snmp4j.agent.ManagedObject<org.snmp4j.agent.request.SubRequest<?>>
-
next
public boolean next(org.snmp4j.agent.request.SubRequest<?> request) - Specified by:
nextin interfaceorg.snmp4j.agent.ManagedObject<org.snmp4j.agent.request.SubRequest<?>>
-
next
public boolean next(org.snmp4j.agent.request.SnmpRequest.SnmpSubRequest request) Processes an SNMP NEXTSubRequestby sending a AgentX request to the appropriate sub-agent(s).- Parameters:
request- a GETNEXT sub-request.- Returns:
trueif 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:
nextin interfaceorg.snmp4j.agent.ManagedObject<org.snmp4j.agent.request.SubRequest<?>>
-
next
-
prepare
public void prepare(org.snmp4j.agent.request.SubRequest<?> request) - Specified by:
preparein interfaceorg.snmp4j.agent.ManagedObject<org.snmp4j.agent.request.SubRequest<?>>
-
prepare
public void prepare(org.snmp4j.agent.request.SnmpRequest.SnmpSubRequest request) Processes an SNMP SETSubRequestpreparation 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:
undoin interfaceorg.snmp4j.agent.ManagedObject<org.snmp4j.agent.request.SubRequest<?>>
-
undo
public void undo(org.snmp4j.agent.request.SnmpRequest.SnmpSubRequest request) Processes an SNMP SETSubRequestundo 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:
cleanupin interfaceorg.snmp4j.agent.ManagedObject<org.snmp4j.agent.request.SubRequest<?>>
-
cleanup
public void cleanup(org.snmp4j.agent.request.SnmpRequest.SnmpSubRequest request) Processes an SNMP SETSubRequestcleanup 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:
commitin interfaceorg.snmp4j.agent.ManagedObject<org.snmp4j.agent.request.SubRequest<?>>
-
commit
public void commit(org.snmp4j.agent.request.SnmpRequest.SnmpSubRequest request) Processes an SNMP SETSubRequestcommit by sending a AgentX request to the appropriate sub-agent(s).- Parameters:
request- a SET sub-request.
-
toString
-