Package org.snmp4j.agent.agentx
Class AgentXVariableBindingPDU
java.lang.Object
org.snmp4j.agent.agentx.AgentXPDU
org.snmp4j.agent.agentx.AgentXContextPDU
org.snmp4j.agent.agentx.AgentXVariableBindingPDU
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
AgentXIndexAllocatePDU
,AgentXIndexDeallocatePDU
,AgentXNotifyPDU
,AgentXTestSetPDU
The
AgentXVariableBindingPDU
is the base class for all AgentX PDUs with a list of VariableBinding
s.- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionprotected org.snmp4j.smi.VariableBinding[]
The variable bindings in the PDU.Fields inherited from class org.snmp4j.agent.agentx.AgentXContextPDU
context
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
ModifierConstructorDescriptionprotected
AgentXVariableBindingPDU
(byte type, byte flags, int sessionID, int transactionID, int packetID) Creates aAgentXVariableBindingPDU
from its type.protected
AgentXVariableBindingPDU
(byte type, org.snmp4j.smi.OctetString context, org.snmp4j.smi.VariableBinding[] vbs) Creates aAgentXVariableBindingPDU
from its type.protected
Creates aAgentXVariableBindingPDU
from aAgentXMessageHeader
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
decodeAfterContext
(ByteBuffer buf, int length) Decode this PDU after the end of the encoded context.void
Encode this PDU after already encoded context (thus context will not be encoded by this operation).int
Gets the encoded length after an already encoded context.org.snmp4j.smi.VariableBinding[]
Gets theVariableBinding
s array.void
setVariableBindings
(org.snmp4j.smi.VariableBinding[] variableBindings) Sets theVariableBinding
s array.int
size()
Gets the size of theVariableBinding
s array.Returns a string representation of the PDU members.Methods inherited from class org.snmp4j.agent.agentx.AgentXContextPDU
beforeEncode, decodePayload, encodePayload, getContext, getPayloadLength, setContext
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
-
Field Details
-
variableBindings
protected org.snmp4j.smi.VariableBinding[] variableBindingsThe variable bindings in the PDU.
-
-
Constructor Details
-
AgentXVariableBindingPDU
protected AgentXVariableBindingPDU(byte type, org.snmp4j.smi.OctetString context, org.snmp4j.smi.VariableBinding[] vbs) Creates aAgentXVariableBindingPDU
from its type.- Parameters:
type
- a AgentX PDU type.context
- the context.vbs
- an array ofVariableBinding
instances.
-
AgentXVariableBindingPDU
Creates aAgentXVariableBindingPDU
from aAgentXMessageHeader
.- Parameters:
header
- the message header.
-
AgentXVariableBindingPDU
protected AgentXVariableBindingPDU(byte type, byte flags, int sessionID, int transactionID, int packetID) Creates aAgentXVariableBindingPDU
from its type.- Parameters:
type
- a AgentX PDU type.flags
- a set of AgentX flags, seeAgentXProtocol.FLAG_ALLOCATE_INDEX
for example.sessionID
- a session ID.transactionID
- a transaction ID.packetID
- a packet ID.
-
-
Method Details
-
decodeAfterContext
Description copied from class:AgentXContextPDU
Decode this PDU after the end of the encoded context.- Specified by:
decodeAfterContext
in classAgentXContextPDU
- 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
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 classAgentXContextPDU
- 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 classAgentXContextPDU
- Returns:
- the BER encoded length (without context).
-
getVariableBindings
public org.snmp4j.smi.VariableBinding[] getVariableBindings()Gets theVariableBinding
s array.- Returns:
- the
VariableBinding
s array.
-
setVariableBindings
public void setVariableBindings(org.snmp4j.smi.VariableBinding[] variableBindings) Sets theVariableBinding
s array.- Parameters:
variableBindings
- aVariableBinding
s array.
-
size
public int size()Gets the size of theVariableBinding
s array.- Returns:
- the number of variable bindings in this PDU.
-
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 classAgentXContextPDU
- Returns:
- a string representation of the PDU members.
-