Default implementation of the {@link com.sun.jmx.snmp.SnmpPduFactory SnmpPduFactory} interface.
It uses the BER (basic encoding rules) standardized encoding scheme associated with ASN.1.
This implementation of the SnmpPduFactory is very
basic: it simply calls encoding and decoding methods from
{@link com.sun.jmx.snmp.SnmpMsg}.
public SnmpPdu decodeSnmpPdu(SnmpMsg msg)
throws SnmpStatusException {
return msg.decodeSnmpPdu() ;
}
public SnmpMsg encodeSnmpPdu(SnmpPdu pdu, int maxPktSize)
throws SnmpStatusException, SnmpTooBigException {
SnmpMsg result = new SnmpMessage() ; // for SNMP v1/v2
or
SnmpMsg result = new SnmpV3Message() ; // for SNMP v3
result.encodeSnmpPdu(pdu, maxPktSize) ;
return result ;
}
To implement your own object, you can implement SnmpPduFactory
or extend SnmpPduFactoryBER .
This API is a Sun Microsystems internal API and is subject
to change without notice. |