Class AgentXVariableBindingPDU

All Implemented Interfaces:
Serializable
Direct Known Subclasses:
AgentXIndexAllocatePDU, AgentXIndexDeallocatePDU, AgentXNotifyPDU, AgentXTestSetPDU

public class AgentXVariableBindingPDU extends AgentXContextPDU
The AgentXVariableBindingPDU is the base class for all AgentX PDUs with a list of VariableBindings.
See Also:
  • Field Details

    • variableBindings

      protected org.snmp4j.smi.VariableBinding[] variableBindings
      The variable bindings in the PDU.
  • Constructor Details

    • AgentXVariableBindingPDU

      protected AgentXVariableBindingPDU(byte type, org.snmp4j.smi.OctetString context, org.snmp4j.smi.VariableBinding[] vbs)
      Creates a AgentXVariableBindingPDU from its type.
      Parameters:
      type - a AgentX PDU type.
      context - the context.
      vbs - an array of VariableBinding instances.
    • AgentXVariableBindingPDU

      protected AgentXVariableBindingPDU(AgentXMessageHeader header)
      Parameters:
      header - the message header.
    • AgentXVariableBindingPDU

      protected AgentXVariableBindingPDU(byte type, byte flags, int sessionID, int transactionID, int packetID)
      Creates a AgentXVariableBindingPDU from its type.
      Parameters:
      type - a AgentX PDU type.
      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.
  • 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.
    • encodeAfterContext

      public 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

      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).
    • getVariableBindings

      public org.snmp4j.smi.VariableBinding[] getVariableBindings()
      Gets the VariableBindings array.
      Returns:
      the VariableBindings array.
    • setVariableBindings

      public void setVariableBindings(org.snmp4j.smi.VariableBinding[] variableBindings)
      Sets the VariableBindings array.
      Parameters:
      variableBindings - a VariableBindings array.
    • size

      public int size()
      Gets the size of the VariableBindings array.
      Returns:
      the number of variable bindings in this PDU.
    • toStringExtMembers

      public 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.