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

public class AgentXNode extends Object implements 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

    Constructors
    Modifier
    Constructor
    Description
    protected
    AgentXNode(AgentXRegion region, TreeSet<AgentXRegEntry<?>> registrations)
    Creates an AgentXNode for a region and corresponding registration.
     
    AgentXNode(AgentXRegion region, AgentXRegEntry<?> registration)
    Creates an AgentXNode for a region and corresponding registration.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Adds a registration.
    void
    cleanup(org.snmp4j.agent.request.SnmpRequest.SnmpSubRequest request)
    Processes an SNMP SET SubRequest 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 SET SubRequest 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 GET SubRequest by sending a AgentX request to the appropriate sub-agent(s).
    void
    get(org.snmp4j.agent.request.SubRequest<?> request)
     
    Gets the active (i.e.
    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
     
    boolean
    next(org.snmp4j.agent.request.SnmpRequest.SnmpSubRequest request)
    Processes an SNMP NEXT SubRequest 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
    next(org.snmp4j.agent.request.SubRequest<?> request, Function<org.snmp4j.smi.OID,Boolean> filter)
     
    void
    prepare(org.snmp4j.agent.request.SnmpRequest.SnmpSubRequest request)
    Processes an SNMP SET SubRequest preparation by sending a AgentX request to the appropriate sub-agent(s).
    void
    prepare(org.snmp4j.agent.request.SubRequest<?> request)
     
    boolean
    Removes a registration.
    boolean
    shrink(org.snmp4j.smi.OID upper)
    Shrink a node's region the new upper bound.
     
    void
    undo(org.snmp4j.agent.request.SnmpRequest.SnmpSubRequest request)
    Processes an SNMP SET SubRequest 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

      public AgentXNode(AgentXRegion region, AgentXRegEntry<?> registration)
      Creates an AgentXNode for a region and corresponding registration.
      Parameters:
      region - the region (scope) for the new AgentXNode.
      registration - the registration associated with region.
    • AgentXNode

      protected AgentXNode(AgentXRegion region, TreeSet<AgentXRegEntry<?>> registrations)
      Creates an AgentXNode for a region and corresponding registration.
      Parameters:
      region - the region (scope) for the new AgentXNode.
      registrations - the registrations associated with region.
  • Method Details

    • getClone

      public AgentXNode getClone(AgentXRegion region)
      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 of upper 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

      public void addRegistration(AgentXRegEntry<?> entry)
      Adds a registration.
      Parameters:
      entry - a new registration to be added to the node.
    • removeRegistration

      public boolean removeRegistration(AgentXRegEntry<?> entry)
      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 interface org.snmp4j.agent.ManagedObject<org.snmp4j.agent.request.SubRequest<?>>
    • getActiveRegistration

      public final AgentXRegEntry<?> 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 interface org.snmp4j.agent.ManagedObject<org.snmp4j.agent.request.SubRequest<?>>
    • get

      public void get(org.snmp4j.agent.request.SnmpRequest.SnmpSubRequest request)
      Processes an SNMP GET SubRequest 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 interface org.snmp4j.agent.ManagedObject<org.snmp4j.agent.request.SubRequest<?>>
    • next

      public boolean next(org.snmp4j.agent.request.SubRequest<?> request)
      Specified by:
      next in interface org.snmp4j.agent.ManagedObject<org.snmp4j.agent.request.SubRequest<?>>
    • next

      public boolean next(org.snmp4j.agent.request.SnmpRequest.SnmpSubRequest request)
      Processes an SNMP NEXT SubRequest 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 interface org.snmp4j.agent.ManagedObject<org.snmp4j.agent.request.SubRequest<?>>
    • next

      public boolean next(org.snmp4j.agent.request.SnmpRequest.SnmpSubRequest request, Function<org.snmp4j.smi.OID,Boolean> filter)
    • prepare

      public void prepare(org.snmp4j.agent.request.SubRequest<?> request)
      Specified by:
      prepare in interface org.snmp4j.agent.ManagedObject<org.snmp4j.agent.request.SubRequest<?>>
    • prepare

      public void prepare(org.snmp4j.agent.request.SnmpRequest.SnmpSubRequest request)
      Processes an SNMP SET SubRequest 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 interface org.snmp4j.agent.ManagedObject<org.snmp4j.agent.request.SubRequest<?>>
    • undo

      public void undo(org.snmp4j.agent.request.SnmpRequest.SnmpSubRequest request)
      Processes an SNMP SET SubRequest 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 interface org.snmp4j.agent.ManagedObject<org.snmp4j.agent.request.SubRequest<?>>
    • cleanup

      public void cleanup(org.snmp4j.agent.request.SnmpRequest.SnmpSubRequest request)
      Processes an SNMP SET SubRequest 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 interface org.snmp4j.agent.ManagedObject<org.snmp4j.agent.request.SubRequest<?>>
    • commit

      public void commit(org.snmp4j.agent.request.SnmpRequest.SnmpSubRequest request)
      Processes an SNMP SET SubRequest commit by sending a AgentX request to the appropriate sub-agent(s).
      Parameters:
      request - a SET sub-request.
    • toString

      public String toString()
      Overrides:
      toString in class Object