Class AgentXIndexRegistry

java.lang.Object
org.snmp4j.agent.agentx.master.index.AgentXIndexRegistry
Direct Known Subclasses:
SubAgentXIndexRegistry

public class AgentXIndexRegistry extends Object
The AgentXIndexRegistry stores INDEX values reserved by sub-agents at the master agent.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates new AgentXIndexRegistry.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    allocate(int sessionID, org.snmp4j.smi.OctetString context, org.snmp4j.smi.VariableBinding vb, boolean testOnly)
    Allocate a new INDEX from an AgentX index allocation request.
    int
    anyIndex(int sessionID, org.snmp4j.smi.OctetString context, org.snmp4j.smi.VariableBinding vb, boolean testOnly)
    Allocate any index (if released is available, re-allocate it, otherwise create a new one).
    int
    newIndex(int sessionID, org.snmp4j.smi.OctetString context, org.snmp4j.smi.VariableBinding vb, boolean testOnly)
    Allocate a new index that has not been used yet.
    newIndexRegistryEntry(org.snmp4j.smi.OctetString context, org.snmp4j.smi.VariableBinding vb)
    Creates a new index type.
    void
    release(int sessionID)
    Release all indexes of the specified session ID.
    int
    release(int sessionID, org.snmp4j.smi.OctetString context, org.snmp4j.smi.VariableBinding vb, boolean testOnly)
    Release a previously allocated INDEX.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • newIndexRegistryEntry

      protected IndexRegistryEntry newIndexRegistryEntry(org.snmp4j.smi.OctetString context, org.snmp4j.smi.VariableBinding vb)
      Creates a new index type.
      Parameters:
      context - the SNMPv3 context.
      vb - the index type identifier.
      Returns:
      a new IndexRegistryEntry representing an index type.
    • allocate

      public int allocate(int sessionID, org.snmp4j.smi.OctetString context, org.snmp4j.smi.VariableBinding vb, boolean testOnly)
      Allocate a new INDEX from an AgentX index allocation request.
      Parameters:
      sessionID - the session allocating the index.
      context - the SNMPv3 context.
      vb - the variable binding with the requested index.
      testOnly - if true, only test if allocation could be done, otherwise directly allocate the index.
      Returns:
      AgentXProtocol.AGENTX_SUCCESS if the allocation was successful, AgentXProtocol.AGENTX_INDEX_WRONG_TYPE, AgentXProtocol.AGENTX_INDEX_NONE_AVAILABLE, and AgentXProtocol.AGENTX_INDEX_ALREADY_ALLOCATED on error.
    • release

      public int release(int sessionID, org.snmp4j.smi.OctetString context, org.snmp4j.smi.VariableBinding vb, boolean testOnly)
      Release a previously allocated INDEX.
      Parameters:
      sessionID - the session allocating the index.
      context - the SNMPv3 context.
      vb - the variable binding with the requested index.
      testOnly - if true, only test if release could be done, otherwise directly release the index.
      Returns:
      AgentXProtocol.AGENTX_SUCCESS if the allocation was successful, AgentXProtocol.AGENTX_INDEX_NOT_ALLOCATED on error.
    • release

      public void release(int sessionID)
      Release all indexes of the specified session ID.
      Parameters:
      sessionID - the session to release indexes for.
    • newIndex

      public int newIndex(int sessionID, org.snmp4j.smi.OctetString context, org.snmp4j.smi.VariableBinding vb, boolean testOnly)
      Allocate a new index that has not been used yet.
      Parameters:
      sessionID - the session allocating the index.
      context - the SNMPv3 context.
      vb - the variable binding with the requested index.
      testOnly - if true, only test if allocation could be done, otherwise directly allocate the index.
      Returns:
      AgentXProtocol.AGENTX_SUCCESS if the allocation was successful, AgentXProtocol.AGENTX_INDEX_NONE_AVAILABLE on error.
    • anyIndex

      public int anyIndex(int sessionID, org.snmp4j.smi.OctetString context, org.snmp4j.smi.VariableBinding vb, boolean testOnly)
      Allocate any index (if released is available, re-allocate it, otherwise create a new one).
      Parameters:
      sessionID - the session allocating the index.
      context - the SNMPv3 context.
      vb - the variable binding with the requested index.
      testOnly - if true, only test if allocation could be done, otherwise directly allocate the index.
      Returns:
      AgentXProtocol.AGENTX_SUCCESS if the allocation was successful, AgentXProtocol.AGENTX_INDEX_NONE_AVAILABLE on error.