Class AgentXRequestPDU

All Implemented Interfaces:
Serializable
Direct Known Subclasses:
AgentXGetBulkPDU, AgentXGetNextPDU, AgentXGetPDU

public abstract class AgentXRequestPDU extends AgentXContextPDU
The AgentXRequestPDU represents the base class for all agentx-Get*Request-PDUs defined by RFC 2741.
See Also:
  • Field Details

    • ranges

      protected org.snmp4j.agent.MOScope[] ranges
      The request ranges.
  • Constructor Details

    • AgentXRequestPDU

      protected AgentXRequestPDU(byte type, org.snmp4j.smi.OctetString context)
      Creates a AgentXRequestPDU from payload values.
      Parameters:
      type - the PDU type.
      context - the SNMPv3 context.
    • AgentXRequestPDU

      protected AgentXRequestPDU(byte type, org.snmp4j.smi.OctetString context, org.snmp4j.agent.MOScope[] ranges)
      Creates a AgentXRequestPDU from payload values.
      Parameters:
      type - the PDU type.
      context - the SNMPv3 context.
      ranges - the requested ranges.
    • AgentXRequestPDU

      protected AgentXRequestPDU(AgentXMessageHeader header)
      Parameters:
      header - the message header.
  • Method Details

    • decodeAfterContext

      protected 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.
    • 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.
    • getAfterContextLength

      protected 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).
    • size

      public int size()
      Gets the size of the ranges array.
      Returns:
      the number of ranges in this request.
    • getRanges

      public org.snmp4j.agent.MOScope[] getRanges()
      Gets the ranges of this request.
      Returns:
      an array of MOScope instances.
    • 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.