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
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
ModifierConstructorDescriptionAgentXRegisterPDU
(byte flags, int sessionID, int transactionID, int packetID) Creates aAgentXRegisterPDU
.protected
AgentXRegisterPDU
(byte type, org.snmp4j.smi.OctetString context, org.snmp4j.smi.OID subtree, byte priority, byte rangeSubID, int upperBound) Creates aAgentXRegisterPDU
from payload values.AgentXRegisterPDU
(AgentXMessageHeader header) Creates aAgentXPingPDU
from aAgentXMessageHeader
.AgentXRegisterPDU
(org.snmp4j.smi.OctetString context, org.snmp4j.smi.OID subtree, byte priority, byte rangeSubID, int upperBound) Creates aAgentXRegisterPDU
from payload values. -
Method Summary
Modifier and TypeMethodDescriptionvoid
decodeAfterContext
(ByteBuffer buf, int length) Decode this PDU after the end of the encoded context.protected 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.OctetString
Gets the context.byte
Gets the region registration priority.byte
Gets the range sub-identifier.Gets the registered region.org.snmp4j.smi.OID
Gets the sub-treeOID
.byte
Gets the region timeout.int
Gets the upper bound.void
setContext
(org.snmp4j.smi.OctetString context) Sets the SNMPv3 context.void
setPriority
(byte priority) Sets the priority of the registration.void
setRangeSubID
(byte rangeSubID) Sets the range sub-identifier index (one-based).void
setSubtree
(org.snmp4j.smi.OID subtree) Sets the sub-treeOID
.void
setTimeout
(byte timeout) Sets the region timeout.void
setUpperBound
(int upperBound) Sets the upper bound.protected String
Returns a string representation of the PDU members.Methods inherited from class org.snmp4j.agent.agentx.AgentXContextPDU
beforeEncode, decodePayload, encodePayload, getPayloadLength
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
-
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_INDEX
for example.sessionID
- a session ID.transactionID
- a transaction ID.packetID
- a packet ID.
-
AgentXRegisterPDU
Creates aAgentXPingPDU
from 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 aAgentXRegisterPDU
from payload values.- Parameters:
context
- the SNMPv3 context.subtree
- the sub-tree OID.priority
- the registration priorityrangeSubID
- the index within thesubtree
OID
that 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 aAgentXRegisterPDU
from payload values.- Parameters:
type
- the PDU type.context
- the SNMPv3 context.subtree
- the sub-tree OID.priority
- the registration priorityrangeSubID
- the index within thesubtree
OID
that represents the range of objects ("wildcard").upperBound
- the upper bound of the region.
-
-
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.
-
getContext
public org.snmp4j.smi.OctetString getContext()Description copied from class:AgentXContextPDU
Gets the context.- Overrides:
getContext
in classAgentXContextPDU
- Returns:
- an
OctetString
representing 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:
setContext
in 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:AgentXContextPDU
Gets the encoded length after an already encoded context.- Specified by:
getAfterContextLength
in classAgentXContextPDU
- Returns:
- the BER encoded length (without context).
-
getRegion
Gets the registered region.- Returns:
- the effective registered region.
-
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.
-
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.
-