Package org.snmp4j.agent.agentx
Class AgentXClosePDU
java.lang.Object
org.snmp4j.agent.agentx.AgentXPDU
org.snmp4j.agent.agentx.AgentXClosePDU
- All Implemented Interfaces:
Serializable
The
AgentXClosePDU
represents the agentx-Close-PDU from RFC 2741.- See Also:
-
Field Summary
Fields inherited from class org.snmp4j.agent.agentx.AgentXPDU
AGENTX_ADDAGENTCAPS_PDU, AGENTX_CLEANUPSET_PDU, AGENTX_CLOSE_PDU, AGENTX_COMMITSET_PDU, AGENTX_GET_PDU, AGENTX_GETBULK_PDU, AGENTX_GETNEXT_PDU, AGENTX_INDEXALLOCATE_PDU, AGENTX_INDEXDEALLOCATE_PDU, AGENTX_NOTIFY_PDU, AGENTX_OPEN_PDU, AGENTX_PING_PDU, AGENTX_REGISTER_PDU, AGENTX_REMOVEAGENTCAPS_PDU, AGENTX_RESPONSE_PDU, AGENTX_TESTSET_PDU, AGENTX_UNDOSET_PDU, AGENTX_UNREGISTER_PDU, byteOrder, flags, packetID, RESERVED, sessionID, transactionID, type, version
-
Constructor Summary
ConstructorDescriptionAgentXClosePDU
(byte reason) Creates aAgentXClosePDU
from a close reason.AgentXClosePDU
(AgentXMessageHeader header) Creates aAgentXClosePDU
from aAgentXMessageHeader
. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
Initialize flags and other things before a PDU is encoded.void
decodePayload
(ByteBuffer buf, int length) Decode this PDU's payload.void
encodePayload
(ByteBuffer buf) Encode the payload to the given byte buffer.int
Gets the payload length.byte
Gets the reason for the close.void
setReason
(byte reason) Sets the close reason, seeAgentXProtocol.REASON_OTHER
for example.Methods inherited from class org.snmp4j.agent.agentx.AgentXPDU
addFlag, decode, encode, getByteOrder, getFlags, getPacketID, getSessionID, getTransactionID, getType, getVersion, isConfirmedPDU, isFlagSet, setByteOrder, setFlags, setPacketID, setSessionAttributes, setSessionID, setTransactionID, setType, setVersion, toString, toStringExtMembers
-
Constructor Details
-
AgentXClosePDU
Creates aAgentXClosePDU
from aAgentXMessageHeader
.- Parameters:
header
- the message header.
-
AgentXClosePDU
public AgentXClosePDU(byte reason) Creates aAgentXClosePDU
from a close reason.- Parameters:
reason
- the reason to close, seeAgentXProtocol.REASON_OTHER
for example.
-
-
Method Details
-
decodePayload
Description copied from class:AgentXPDU
Decode this PDU's payload.- Specified by:
decodePayload
in classAgentXPDU
- 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, seeAgentXProtocol.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 classAgentXPDU
- Returns:
- the payload length.
-
encodePayload
Description copied from class:AgentXPDU
Encode the payload to the given byte buffer.- Specified by:
encodePayload
in classAgentXPDU
- 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 classAgentXPDU
-