Class AgentXClosePDU

java.lang.Object
org.snmp4j.agent.agentx.AgentXPDU
org.snmp4j.agent.agentx.AgentXClosePDU
All Implemented Interfaces:
Serializable

public class AgentXClosePDU extends AgentXPDU
The AgentXClosePDU represents the agentx-Close-PDU from RFC 2741.
See Also:
  • Constructor Details

  • Method Details

    • decodePayload

      public void decodePayload(ByteBuffer buf, int length) throws IOException
      Description copied from class: AgentXPDU
      Decode this PDU's payload.
      Specified by:
      decodePayload in class AgentXPDU
      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.
    • getReason

      public byte getReason()
      Gets the reason for the close.
      Returns:
      the close reason, AgentXProtocol.REASON_OTHER for example.
    • setReason

      public void setReason(byte reason)
      Sets the close reason, see AgentXProtocol.REASON_OTHER for example.
      Parameters:
      reason - a AgentX close reason.
    • getPayloadLength

      public int getPayloadLength()
      Description copied from class: AgentXPDU
      Gets the payload length.
      Specified by:
      getPayloadLength in class AgentXPDU
      Returns:
      the payload length.
    • encodePayload

      public void encodePayload(ByteBuffer buf)
      Description copied from class: AgentXPDU
      Encode the payload to the given byte buffer.
      Specified by:
      encodePayload in class AgentXPDU
      Parameters:
      buf - the buffer.
    • beforeEncode

      protected void beforeEncode()
      Description copied from class: AgentXPDU
      Initialize flags and other things before a PDU is encoded.
      Specified by:
      beforeEncode in class AgentXPDU