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 VariableBindings.- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.snmp4j.smi.VariableBinding[]The variable bindings in the PDU.Fields inherited from class org.snmp4j.agent.agentx.AgentXContextPDU
contextFields 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
ConstructorsModifierConstructorDescriptionprotectedAgentXVariableBindingPDU(byte type, byte flags, int sessionID, int transactionID, int packetID) Creates aAgentXVariableBindingPDUfrom its type.protectedAgentXVariableBindingPDU(byte type, org.snmp4j.smi.OctetString context, org.snmp4j.smi.VariableBinding[] vbs) Creates aAgentXVariableBindingPDUfrom its type.protectedCreates aAgentXVariableBindingPDUfrom aAgentXMessageHeader. -
Method Summary
Modifier and TypeMethodDescriptionvoiddecodeAfterContext(ByteBuffer buf, int length) Decode this PDU after the end of the encoded context.voidEncode this PDU after already encoded context (thus context will not be encoded by this operation).intGets the encoded length after an already encoded context.org.snmp4j.smi.VariableBinding[]Gets theVariableBindings array.voidsetVariableBindings(org.snmp4j.smi.VariableBinding[] variableBindings) Sets theVariableBindings array.intsize()Gets the size of theVariableBindings array.Returns a string representation of the PDU members.Methods inherited from class org.snmp4j.agent.agentx.AgentXContextPDU
beforeEncode, decodePayload, encodePayload, getContext, getPayloadLength, setContextMethods 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 aAgentXVariableBindingPDUfrom its type.- Parameters:
type- a AgentX PDU type.context- the context.vbs- an array ofVariableBindinginstances.
-
AgentXVariableBindingPDU
Creates aAgentXVariableBindingPDUfrom aAgentXMessageHeader.- Parameters:
header- the message header.
-
AgentXVariableBindingPDU
protected AgentXVariableBindingPDU(byte type, byte flags, int sessionID, int transactionID, int packetID) Creates aAgentXVariableBindingPDUfrom its type.- Parameters:
type- a AgentX PDU type.flags- a set of AgentX flags, seeAgentXProtocol.FLAG_ALLOCATE_INDEXfor example.sessionID- a session ID.transactionID- a transaction ID.packetID- a packet ID.
-
-
Method Details
-
decodeAfterContext
Description copied from class:AgentXContextPDUDecode this PDU after the end of the encoded context.- Specified by:
decodeAfterContextin 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 fewer data than expected.
-
encodeAfterContext
Description copied from class:AgentXContextPDUEncode this PDU after already encoded context (thus context will not be encoded by this operation).- Specified by:
encodeAfterContextin classAgentXContextPDU- Parameters:
buf- the target buffer.
-
getAfterContextLength
public int getAfterContextLength()Description copied from class:AgentXContextPDUGets the encoded length after an already encoded context.- Specified by:
getAfterContextLengthin classAgentXContextPDU- Returns:
- the BER encoded length (without context).
-
getVariableBindings
public org.snmp4j.smi.VariableBinding[] getVariableBindings()Gets theVariableBindings array.- Returns:
- the
VariableBindings array.
-
setVariableBindings
public void setVariableBindings(org.snmp4j.smi.VariableBinding[] variableBindings) Sets theVariableBindings array.- Parameters:
variableBindings- aVariableBindings array.
-
size
public int size()Gets the size of theVariableBindings array.- Returns:
- the number of variable bindings in this PDU.
-
toStringExtMembers
Description copied from class:AgentXPDUReturns a string representation of the PDU members. An empty string is returned by this base class.- Overrides:
toStringExtMembersin classAgentXContextPDU- Returns:
- a string representation of the PDU members.
-