Package org.snmp4j.agent.agentx
Class AgentXOpenPDU
java.lang.Object
org.snmp4j.agent.agentx.AgentXPDU
org.snmp4j.agent.agentx.AgentXOpenPDU
- All Implemented Interfaces:
Serializable
The
AgentXOpenPDU
represents the agentx-CleanupSet-PDU defined by RFC 2741.- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionprotected org.snmp4j.smi.OctetString
The subagent description.protected org.snmp4j.smi.OID
The sub-agent ID.protected byte
AgentX timeout in seconds.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
ConstructorDescriptionAgentXOpenPDU
(int sessionID, int transactionID, int packetID, byte timeout, org.snmp4j.smi.OID subagentID, org.snmp4j.smi.OctetString subagentDescr) Creates aAgentXOpenPDU
. -
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.org.snmp4j.smi.OctetString
Gets the sub-agent description.org.snmp4j.smi.OID
Gets the sub-agent ID.byte
Gets the session timeout.void
setSubagentDescr
(org.snmp4j.smi.OctetString subagentDescr) Gets the sub-agent description.void
setSubagentID
(org.snmp4j.smi.OID subagentID) Sets the sub-agent ID.void
setTimeout
(byte timeout) Sets the session timeout in seconds.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
-
Field Details
-
timeout
protected byte timeoutAgentX timeout in seconds. -
subagentID
protected org.snmp4j.smi.OID subagentIDThe sub-agent ID. -
subagentDescr
protected org.snmp4j.smi.OctetString subagentDescrThe subagent description.
-
-
Constructor Details
-
AgentXOpenPDU
public AgentXOpenPDU(int sessionID, int transactionID, int packetID, byte timeout, org.snmp4j.smi.OID subagentID, org.snmp4j.smi.OctetString subagentDescr) Creates aAgentXOpenPDU
.- Parameters:
sessionID
- a session ID.transactionID
- a transaction ID.packetID
- a packet ID.timeout
- the packet timeout.subagentID
- the sub-agent IDsubagentDescr
- the sub-agent description.
-
-
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.
-
getSubagentDescr
public org.snmp4j.smi.OctetString getSubagentDescr()Gets the sub-agent description.- Returns:
- a secription.
-
getSubagentID
public org.snmp4j.smi.OID getSubagentID()Gets the sub-agent ID.- Returns:
- a
OID
.
-
getTimeout
public byte getTimeout()Gets the session timeout.- Returns:
- the timeout in seconds.
-
setSubagentDescr
public void setSubagentDescr(org.snmp4j.smi.OctetString subagentDescr) Gets the sub-agent description.- Parameters:
subagentDescr
- the sub-agent description.
-
setSubagentID
public void setSubagentID(org.snmp4j.smi.OID subagentID) Sets the sub-agent ID.- Parameters:
subagentID
- the sub-agent ID.
-
setTimeout
public void setTimeout(byte timeout) Sets the session timeout in seconds.- Parameters:
timeout
- the timeout in seconds.
-
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
-