Search in sources :

Example 6 with SnmpPduPacket

use of com.sun.jmx.snmp.SnmpPduPacket in project jdk8u_jdk by JetBrains.

the class SnmpRequestHandler method newTooBigMessage.

private SnmpMessage newTooBigMessage(SnmpMessage reqMsg) throws SnmpTooBigException {
    SnmpMessage result = null;
    SnmpPduPacket reqPdu;
    try {
        reqPdu = (SnmpPduPacket) pduFactory.decodeSnmpPdu(reqMsg);
        if (reqPdu != null) {
            SnmpPduPacket respPdu = newTooBigPdu(reqPdu);
            result = (SnmpMessage) pduFactory.encodeSnmpPdu(respPdu, packet.getData().length);
        }
    } catch (SnmpStatusException x) {
        // been successfully called before.
        if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINEST)) {
            SNMP_ADAPTOR_LOGGER.logp(Level.FINEST, dbgTag, "newTooBigMessage", "Internal error", x);
        }
        throw new InternalError(x);
    }
    return result;
}
Also used : SnmpStatusException(com.sun.jmx.snmp.SnmpStatusException) SnmpMessage(com.sun.jmx.snmp.SnmpMessage) SnmpPduPacket(com.sun.jmx.snmp.SnmpPduPacket)

Aggregations

SnmpPduPacket (com.sun.jmx.snmp.SnmpPduPacket)6 SnmpStatusException (com.sun.jmx.snmp.SnmpStatusException)3 SnmpMessage (com.sun.jmx.snmp.SnmpMessage)2 SnmpTooBigException (com.sun.jmx.snmp.SnmpTooBigException)2 InterruptedIOException (java.io.InterruptedIOException)2 SocketException (java.net.SocketException)2 SnmpPduBulk (com.sun.jmx.snmp.SnmpPduBulk)1 SnmpPduRequest (com.sun.jmx.snmp.SnmpPduRequest)1 SnmpVarBind (com.sun.jmx.snmp.SnmpVarBind)1 SnmpVarBindList (com.sun.jmx.snmp.SnmpVarBindList)1