Package org.snmp4j.agent.agentx
Class AgentXRegisterPDU
java.lang.Object
org.snmp4j.agent.agentx.AgentXPDU
org.snmp4j.agent.agentx.AgentXContextPDU
org.snmp4j.agent.agentx.AgentXRegisterPDU
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
AgentXUnregisterPDU
The
AgentXRegisterPDU represents the agentx-Register-PDU defined by RFC 2741.- See Also:
-
Field Summary
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
ConstructorsModifierConstructorDescriptionAgentXRegisterPDU(byte flags, int sessionID, int transactionID, int packetID) Creates aAgentXRegisterPDU.protectedAgentXRegisterPDU(byte type, org.snmp4j.smi.OctetString context, org.snmp4j.smi.OID subtree, byte priority, byte rangeSubID, int upperBound) Creates aAgentXRegisterPDUfrom payload values.AgentXRegisterPDU(AgentXMessageHeader header) Creates aAgentXPingPDUfrom aAgentXMessageHeader.AgentXRegisterPDU(org.snmp4j.smi.OctetString context, org.snmp4j.smi.OID subtree, byte priority, byte rangeSubID, int upperBound) Creates aAgentXRegisterPDUfrom payload values. -
Method Summary
Modifier and TypeMethodDescriptionvoiddecodeAfterContext(ByteBuffer buf, int length) Decode this PDU after the end of the encoded context.protected 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.OctetStringGets the context.byteGets the region registration priority.byteGets the range sub-identifier.Gets the registered region.org.snmp4j.smi.OIDGets the sub-treeOID.byteGets the region timeout.intGets the upper bound.voidsetContext(org.snmp4j.smi.OctetString context) Sets the SNMPv3 context.voidsetPriority(byte priority) Sets the priority of the registration.voidsetRangeSubID(byte rangeSubID) Sets the range sub-identifier index (one-based).voidsetSubtree(org.snmp4j.smi.OID subtree) Sets the sub-treeOID.voidsetTimeout(byte timeout) Sets the region timeout.voidsetUpperBound(int upperBound) Sets the upper bound.protected StringReturns a string representation of the PDU members.Methods inherited from class org.snmp4j.agent.agentx.AgentXContextPDU
beforeEncode, decodePayload, encodePayload, getPayloadLengthMethods 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
-
Constructor Details
-
AgentXRegisterPDU
public AgentXRegisterPDU(byte flags, int sessionID, int transactionID, int packetID) Creates aAgentXRegisterPDU.- Parameters:
flags- a set of AgentX flags, seeAgentXProtocol.FLAG_ALLOCATE_INDEXfor example.sessionID- a session ID.transactionID- a transaction ID.packetID- a packet ID.
-
AgentXRegisterPDU
Creates aAgentXPingPDUfrom aAgentXMessageHeader.- Parameters:
header- the message header.
-
AgentXRegisterPDU
public AgentXRegisterPDU(org.snmp4j.smi.OctetString context, org.snmp4j.smi.OID subtree, byte priority, byte rangeSubID, int upperBound) Creates aAgentXRegisterPDUfrom payload values.- Parameters:
context- the SNMPv3 context.subtree- the sub-tree OID.priority- the registration priorityrangeSubID- the index within thesubtreeOIDthat represents the range of objects ("wildcard").upperBound- the upper bound of the region.
-
AgentXRegisterPDU
protected AgentXRegisterPDU(byte type, org.snmp4j.smi.OctetString context, org.snmp4j.smi.OID subtree, byte priority, byte rangeSubID, int upperBound) Creates aAgentXRegisterPDUfrom payload values.- Parameters:
type- the PDU type.context- the SNMPv3 context.subtree- the sub-tree OID.priority- the registration priorityrangeSubID- the index within thesubtreeOIDthat represents the range of objects ("wildcard").upperBound- the upper bound of the region.
-
-
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.
-
getContext
public org.snmp4j.smi.OctetString getContext()Description copied from class:AgentXContextPDUGets the context.- Overrides:
getContextin classAgentXContextPDU- Returns:
- an
OctetStringrepresenting the context.
-
getPriority
public byte getPriority()Gets the region registration priority.- Returns:
- the priority - smaller values of priority take precedence over larger values.
-
getRangeSubID
public byte getRangeSubID()Gets the range sub-identifier.- Returns:
- 0 if this registration is not a range or the sub-identifier index within lower and upper bound.
-
getSubtree
public org.snmp4j.smi.OID getSubtree()Gets the sub-treeOID.- Returns:
- the sub-tree
OID.
-
getTimeout
public byte getTimeout()Gets the region timeout.- Returns:
- the timeout in seconds.
-
getUpperBound
public int getUpperBound()Gets the upper bound.- Returns:
- the upper bound of the region.
-
setContext
public void setContext(org.snmp4j.smi.OctetString context) Sets the SNMPv3 context.- Overrides:
setContextin classAgentXContextPDU- Parameters:
context- the context.
-
setPriority
public void setPriority(byte priority) Sets the priority of the registration.- Parameters:
priority- the region priority (lower value = precedence)
-
setRangeSubID
public void setRangeSubID(byte rangeSubID) Sets the range sub-identifier index (one-based).- Parameters:
rangeSubID- the range sub-identifier starting from 1 for the first sub-identifier.
-
setSubtree
public void setSubtree(org.snmp4j.smi.OID subtree) Sets the sub-treeOID.- Parameters:
subtree- the sub-treeOID.
-
setTimeout
public void setTimeout(byte timeout) Sets the region timeout.- Parameters:
timeout- the timeout in seconds.
-
setUpperBound
public void setUpperBound(int upperBound) Sets the upper bound.- Parameters:
upperBound- the upper bound of the region.
-
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).
-
getRegion
Gets the registered region.- Returns:
- the effective registered region.
-
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.
-
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.
-