java.lang.Object | ||
↳ | com.sun.jmx.snmp.SnmpMsg | |
↳ | com.sun.jmx.snmp.SnmpV3Message |
Is a partially decoded representation of an SNMP V3 packet.
This class can be used when developing customized manager or agent.
The SnmpV3Message
class is directly mapped onto the
message syntax defined in RFC 2572.
SNMPv3Message ::= SEQUENCE { msgVersion INTEGER ( 0 .. 2147483647 ), -- administrative parameters msgGlobalData HeaderData, -- security model-specific parameters -- format defined by Security Model msgSecurityParameters OCTET STRING, msgData ScopedPduData } HeaderData ::= SEQUENCE { msgID INTEGER (0..2147483647), msgMaxSize INTEGER (484..2147483647), msgFlags OCTET STRING (SIZE(1)), -- .... ...1 authFlag -- .... ..1. privFlag -- .... .1.. reportableFlag -- Please observe: -- .... ..00 is OK, means noAuthNoPriv -- .... ..01 is OK, means authNoPriv -- .... ..10 reserved, must NOT be used. -- .... ..11 is OK, means authPriv msgSecurityModel INTEGER (1..2147483647) }
This API is a Sun Microsystems internal API and is subject to change without notice.
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
contextEngineId | The context engine Id in which the pdu must be handled (Generaly the local engine Id). | ||||||||||
contextName | The context name in which the OID has to be interpreted. | ||||||||||
encryptedPdu | The encrypted form of the scoped pdu (Only relevant when dealing with privacy). | ||||||||||
msgFlags | Message flags. | ||||||||||
msgId | Message identifier. | ||||||||||
msgMaxSize | Message max size the pdu sender can deal with. | ||||||||||
msgSecurityModel | The security model the security sub system MUST use in order to deal with this pdu (eg: User based Security Model Id = 3). | ||||||||||
msgSecurityParameters | The unmarshalled security parameters. |
[Expand]
Inherited Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Constructor.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Decodes the specified bytes and initializes this message.
| |||||||||||
Gets the PDU encoded in this message.
| |||||||||||
Encodes this message and puts the result in the specified byte array.
| |||||||||||
Initializes this message with the specified
pdu . | |||||||||||
Returns the associated request Id.
| |||||||||||
Dumps this message in a string.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() |
The context engine Id in which the pdu must be handled (Generaly the local engine Id).
The context name in which the OID has to be interpreted.
The encrypted form of the scoped pdu (Only relevant when dealing with privacy).
Message flags. Reportable flag and security level.
-- .... ...1 authFlag -- .... ..1. privFlag -- .... .1.. reportableFlag -- Please observe: -- .... ..00 is OK, means noAuthNoPriv -- .... ..01 is OK, means authNoPriv -- .... ..10 reserved, must NOT be used. -- .... ..11 is OK, means authPriv
Message identifier.
Message max size the pdu sender can deal with.
The security model the security sub system MUST use in order to deal with this pdu (eg: User based Security Model Id = 3).
The unmarshalled security parameters.
Constructor.
Decodes the specified bytes and initializes this message. For internal use only.
inputBytes | The bytes to be decoded. |
---|
SnmpStatusException | If the specified bytes are not a valid encoding. |
---|
Gets the PDU encoded in this message.
This method decodes the data field and returns the resulting PDU.
SnmpStatusException | If the encoding is not valid. |
---|
Encodes this message and puts the result in the specified byte array. For internal use only.
outputBytes | An array to receive the resulting encoding. |
---|
ArrayIndexOutOfBoundsException | If the result does not fit into the specified array. |
---|---|
SnmpTooBigException |
Initializes this message with the specified pdu
.
This method initializes the data field with an array of
maxDataLength
bytes. It encodes the pdu
.
The resulting encoding is stored in the data field
and the length of the encoding is stored in dataLength
.
If the encoding length exceeds maxDataLength
,
the method throws an exception.
p | The PDU to be encoded. |
---|---|
maxDataLength | The maximum length permitted for the data field. |
SnmpStatusException | If the specified pdu
is not valid. |
---|---|
SnmpTooBigException | If the resulting encoding does not fit
into maxDataLength bytes. |
ArrayIndexOutOfBoundsException | If the encoding exceeds
maxDataLength .
|
Returns the associated request Id.
data | The flat message. |
---|
SnmpStatusException |
---|
Dumps this message in a string.