|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
The SnmpPduFactoryIf
defines the interface of
the object in charge of encoding and decoding SNMP packets.
You normally don't need to use this interface except if you
decide to replace the default implementation SnmpPduFactory
.
An SnmpPduFactoryIf
object is attached to an
AdaptorServerImpl
or an SnmpPeer.
It is used each time an SNMP packet needs to be encoded or decoded.
SnmpPduFactory is the default
implementation.
It simply applies the standard ASN.1 encoding and decoding
on the bytes of the SNMP packet.
It's possible to implement its own SnmpPduFactoryIf
object and to add authentication and/or encryption to the
default encoding/decoding process.
SnmpPduFactory
,
SnmpPduPacket
,
SnmpMessage
Method Summary | |
SnmpPduPacket |
decodePdu(SnmpMessage msg)
Decodes the specified SnmpMessage and returns the
resulting SnpmPduPacket . |
SnmpMessage |
encodePdu(SnmpPduPacket pdu,
int maxPktSize)
Encodes the specified SnmpPduPacket and
returns the resulting SnmpMessage . |
Method Detail |
public SnmpPduPacket decodePdu(SnmpMessage msg) throws SnmpStatusException
SnmpMessage
and returns the
resulting SnpmPduPacket
. If this method returns
null
, the message will be considered unsafe
and will be drop.msg
- The SnmpMessage
to be decoded.SnmpPduPacket
.public SnmpMessage encodePdu(SnmpPduPacket pdu, int maxPktSize) throws SnmpStatusException, SnmpTooBigException
SnmpPduPacket
and
returns the resulting SnmpMessage
. If this
method returns null, the specified SnmpPduPacket
will be dropped and the current SNMP request will be
aborted.pdu
- The SnmpPduPacket
to be encoded.maxPktSize
- The size limit of the resulting encoding.SnmpMessage
.pdu
contains
illegal values and cannot be encoded.maxPktSize
bytes.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |