Package com.sun.jmx.snmp

Examples of com.sun.jmx.snmp.SnmpStatusException


        final int length= oid.length;

        // Control the length of the oid
        //
        if (pos +2 >= length) {
            throw new SnmpStatusException(SnmpStatusException.noSuchInstance);
        }

        // Check that the entry identifier is specified
        //
        if (oid[pos] != nodeId) {
            throw new SnmpStatusException(SnmpStatusException.noSuchObject);
        }
    }
View Full Code Here


            //
            comp= oid.compareTo(pos);

            if (comp == 0) {
                if (fail)
                    throw new SnmpStatusException(failStatus,curr);
                else
                    return curr+1;
            }

            if (comp>0) {
View Full Code Here

     */
    public void get(SnmpMibSubRequest req, int depth)
  throws SnmpStatusException {
        for (Enumeration e= req.getElements(); e.hasMoreElements();) {
            SnmpVarBind var= (SnmpVarBind) e.nextElement();
      SnmpStatusException x =
    new SnmpStatusException(SnmpStatusException.noSuchObject);
      req.registerGetException(var,x);
  }
    }
View Full Code Here

     */
    public void set(SnmpMibSubRequest req, int depth)
  throws SnmpStatusException {
        for (Enumeration e= req.getElements(); e.hasMoreElements();) {
            SnmpVarBind var= (SnmpVarBind) e.nextElement();
      SnmpStatusException x =
    new SnmpStatusException(SnmpStatusException.noAccess);
      req.registerSetException(var,x);
  }
    }
View Full Code Here

     */
    public void check(SnmpMibSubRequest req, int depth)
  throws SnmpStatusException {
        for (Enumeration e= req.getElements(); e.hasMoreElements();) {
            SnmpVarBind var= (SnmpVarBind) e.nextElement();
      SnmpStatusException x =
    new SnmpStatusException(SnmpStatusException.noAccess);
      req.registerCheckException(var,x);
  }
    }
View Full Code Here

  final int length = oid.length;
  SnmpMibNode node = null;
 
  if (handlers == null)
            throw new SnmpStatusException(SnmpStatusException.snmpRspGenErr);

  if (depth > length) {
      // Nothing is left... the oid is not valid
            throw noSuchObjectException;
View Full Code Here

            else if (snmpCmd == pduInformRequestPdu)
                return _informCommunity.getBytes("8859_1") ;
            else
                return _readCommunity.getBytes("8859_1") ;
        }catch(UnsupportedEncodingException e) {
            throw new SnmpStatusException(e.getMessage());
        }
    }
View Full Code Here

      debug("getHandlers","\tV1: Throwing exception");

        // The index in the exception must correspond to the
        // SNMP index ...
        //
        final SnmpStatusException sse =
      new SnmpStatusException(x, index + 1);
        sse.initCause(x);
        throw sse;
    } else if ((type == SnmpDefinitions.pduWalkRequest)   ||
         (type == SnmpDefinitions.pduSetRequestPdu)) {
        final int status =
      SnmpRequestTree.mapSetException(x.getStatus(),ver);

         if (isDebugOn())
      debug("getHandlers","\tSET: Throwing exception");

        final SnmpStatusException sse =
      new SnmpStatusException(status, index + 1);
        sse.initCause(x);
        throw sse;
    } else if (atomic) {

        // Should never come here...
         if (isDebugOn())
      debug("getHandlers","\tATOMIC: Throwing exception");

        final SnmpStatusException sse =
      new SnmpStatusException(x, index + 1);
        sse.initCause(x);
        throw sse;
    }

    final int status =
        SnmpRequestTree.mapGetException(x.getStatus(),ver);
       
    if (status == SnmpStatusException.noSuchInstance) {

        if (isDebugOn())
      debug("getHandlers",
            "\tGET: Registering noSuchInstance");

        var.value= SnmpVarBind.noSuchInstance;

    } else if (status == SnmpStatusException.noSuchObject) {
     
        if (isDebugOn())
      debug("getHandlers",
            "\tGET: Registering noSuchObject");

      var.value= SnmpVarBind.noSuchObject;

    } else {

        if (isDebugOn())
      debug("getHandlers",
            "\tGET: Registering global error: "
            + status);

        final SnmpStatusException sse =
      new SnmpStatusException(status, index + 1);
        sse.initCause(x);
        throw sse;
    }
      }
        }
  return handlers;
View Full Code Here

      debug("getGetNextHandlers","\tThrowing exception" +
            x.toString());
        // The index in the exception must correspond to the
        // SNMP index ...
        //
                    throw new SnmpStatusException(x, index + 1);
    }
    if (isDebugOn())
        debug("getGetNextHandlers","Exception : " + x.getStatus());
   
                var.setSnmpValue(SnmpVarBind.endOfMibView);
View Full Code Here

     * @param vblst The list of <CODE>SnmpVarBind</CODE> to be used.
     * @exception SnmpStatusException This inform request is already in progress.
     */
    synchronized void start(SnmpVarBindList vblst) throws SnmpStatusException {
        if (inProgress())
            throw  new SnmpStatusException("Inform request already in progress.");
        setVarBindList(vblst);
        initializeAndFire();
    }
View Full Code Here

TOP

Related Classes of com.sun.jmx.snmp.SnmpStatusException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.