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
ConstructorsConstructorDescriptionAgentXClosePDU(byte reason) Creates aAgentXClosePDUfrom a close reason.AgentXClosePDU(AgentXMessageHeader header) Creates aAgentXClosePDUfrom aAgentXMessageHeader. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidInitialize flags and other things before a PDU is encoded.voiddecodePayload(ByteBuffer buf, int length) Decode this PDU's payload.voidencodePayload(ByteBuffer buf) Encode the payload to the given byte buffer.intGets the payload length.byteGets the reason for the close.voidsetReason(byte reason) Sets the close reason, seeAgentXProtocol.REASON_OTHERfor 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 aAgentXClosePDUfrom aAgentXMessageHeader.- Parameters:
header- the message header.
-
AgentXClosePDU
public AgentXClosePDU(byte reason) Creates aAgentXClosePDUfrom a close reason.- Parameters:
reason- the reason to close, seeAgentXProtocol.REASON_OTHERfor example.
-
-
Method Details
-
decodePayload
Description copied from class:AgentXPDUDecode this PDU's payload.- Specified by:
decodePayloadin 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_OTHERfor example.
-
setReason
public void setReason(byte reason) Sets the close reason, seeAgentXProtocol.REASON_OTHERfor example.- Parameters:
reason- a AgentX close reason.
-
getPayloadLength
public int getPayloadLength()Description copied from class:AgentXPDUGets the payload length.- Specified by:
getPayloadLengthin classAgentXPDU- Returns:
- the payload length.
-
encodePayload
Description copied from class:AgentXPDUEncode the payload to the given byte buffer.- Specified by:
encodePayloadin classAgentXPDU- Parameters:
buf- the buffer.
-
beforeEncode
protected void beforeEncode()Description copied from class:AgentXPDUInitialize flags and other things before a PDU is encoded.- Specified by:
beforeEncodein classAgentXPDU
-