Class AgentXRegisterPDU

All Implemented Interfaces:
Serializable
Direct Known Subclasses:
AgentXUnregisterPDU

public class AgentXRegisterPDU extends AgentXContextPDU
The AgentXRegisterPDU represents the agentx-Register-PDU defined by RFC 2741.
See Also:
  • Constructor Details

    • AgentXRegisterPDU

      public AgentXRegisterPDU(byte flags, int sessionID, int transactionID, int packetID)
      Parameters:
      flags - a set of AgentX flags, see AgentXProtocol.FLAG_ALLOCATE_INDEX for example.
      sessionID - a session ID.
      transactionID - a transaction ID.
      packetID - a packet ID.
    • AgentXRegisterPDU

      public AgentXRegisterPDU(AgentXMessageHeader header)
      Parameters:
      header - the message header.
    • AgentXRegisterPDU

      public AgentXRegisterPDU(org.snmp4j.smi.OctetString context, org.snmp4j.smi.OID subtree, byte priority, byte rangeSubID, int upperBound)
      Creates a AgentXRegisterPDU from payload values.
      Parameters:
      context - the SNMPv3 context.
      subtree - the sub-tree OID.
      priority - the registration priority
      rangeSubID - the index within the subtree OID that represents the range of objects ("wildcard").
      upperBound - the upper bound of the region.
    • AgentXRegisterPDU

      protected AgentXRegisterPDU(byte type, org.snmp4j.smi.OctetString context, org.snmp4j.smi.OID subtree, byte priority, byte rangeSubID, int upperBound)
      Creates a AgentXRegisterPDU from payload values.
      Parameters:
      type - the PDU type.
      context - the SNMPv3 context.
      subtree - the sub-tree OID.
      priority - the registration priority
      rangeSubID - the index within the subtree OID that represents the range of objects ("wildcard").
      upperBound - the upper bound of the region.
  • Method Details

    • decodeAfterContext

      public void decodeAfterContext(ByteBuffer buf, int length) throws IOException
      Description copied from class: AgentXContextPDU
      Decode this PDU after the end of the encoded context.
      Specified by:
      decodeAfterContext in class AgentXContextPDU
      Parameters:
      buf - the buffer positioned at the end of the encoded context.
      length - the length of the PDU to be decoded.
      Throws:
      IOException - if the buffer contains less data than expected.
    • getContext

      public org.snmp4j.smi.OctetString getContext()
      Description copied from class: AgentXContextPDU
      Gets the context.
      Overrides:
      getContext in class AgentXContextPDU
      Returns:
      an OctetString representing the context.
    • getPriority

      public byte getPriority()
      Gets the region registration priority.
      Returns:
      the priority - smaller values of priority take precedence over larger values.
    • getRangeSubID

      public byte getRangeSubID()
      Gets the range sub-identifier.
      Returns:
      0 if this registration is not a range or the sub-identifier index within lower and upper bound.
    • getSubtree

      public org.snmp4j.smi.OID getSubtree()
      Gets the sub-tree OID.
      Returns:
      the sub-tree OID.
    • getTimeout

      public byte getTimeout()
      Gets the region timeout.
      Returns:
      the timeout in seconds.
    • getUpperBound

      public int getUpperBound()
      Gets the upper bound.
      Returns:
      the upper bound of the region.
    • setContext

      public void setContext(org.snmp4j.smi.OctetString context)
      Sets the SNMPv3 context.
      Overrides:
      setContext in class AgentXContextPDU
      Parameters:
      context - the context.
    • setPriority

      public void setPriority(byte priority)
      Sets the priority of the registration.
      Parameters:
      priority - the region priority (lower value = precedence)
    • setRangeSubID

      public void setRangeSubID(byte rangeSubID)
      Sets the range sub-identifier index (one-based).
      Parameters:
      rangeSubID - the range sub-identifier starting from 1 for the first sub-identifier.
    • setSubtree

      public void setSubtree(org.snmp4j.smi.OID subtree)
      Sets the sub-tree OID.
      Parameters:
      subtree - the sub-tree OID.
    • setTimeout

      public void setTimeout(byte timeout)
      Sets the region timeout.
      Parameters:
      timeout - the timeout in seconds.
    • setUpperBound

      public void setUpperBound(int upperBound)
      Sets the upper bound.
      Parameters:
      upperBound - the upper bound of the region.
    • getAfterContextLength

      public int getAfterContextLength()
      Description copied from class: AgentXContextPDU
      Gets the encoded length after an already encoded context.
      Specified by:
      getAfterContextLength in class AgentXContextPDU
      Returns:
      the BER encoded length (without context).
    • getRegion

      public AgentXRegion getRegion()
      Gets the registered region.
      Returns:
      the effective registered region.
    • encodeAfterContext

      protected void encodeAfterContext(ByteBuffer buf)
      Description copied from class: AgentXContextPDU
      Encode this PDU after already encoded context (thus context will not be encoded by this operation).
      Specified by:
      encodeAfterContext in class AgentXContextPDU
      Parameters:
      buf - the target buffer.
    • toStringExtMembers

      protected String toStringExtMembers()
      Description copied from class: AgentXPDU
      Returns a string representation of the PDU members. An empty string is returned by this base class.
      Overrides:
      toStringExtMembers in class AgentXContextPDU
      Returns:
      a string representation of the PDU members.