Package com.sun.jmx.snmp

Examples of com.sun.jmx.snmp.SnmpStatusException


            final int errorCode = exception.getStatus();
            final int mappedErrorCode = mapSetException(errorCode,
                                                        version);

            if (errorCode != mappedErrorCode)
                throw new
                    SnmpStatusException(mappedErrorCode, getVarIndex(var)+1);
            else
                throw new SnmpStatusException(exception, getVarIndex(var)+1);
        }
View Full Code Here


                    // } else v = entrylists[pos];
                if (statusvb != null) {
                    if ((rs != null) && (rs != statusvb) &&
                        ((type == SnmpDefinitions.pduWalkRequest) ||
                         (type == SnmpDefinitions.pduSetRequestPdu))) {
                        throw new SnmpStatusException(
                              SnmpStatusException.snmpRspInconsistentValue);
                    }
                    rowstatus[pos] = statusvb;
                }
            }
View Full Code Here

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

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

    @Override
    public void check(SnmpMibSubRequest req, int depth)
        throws SnmpStatusException {
        for (Enumeration<SnmpVarBind> e= req.getElements(); e.hasMoreElements();) {
            SnmpVarBind var= 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 new SnmpStatusException(SnmpStatusException.noSuchObject);
        } else if (depth == length) {
            // The oid is not complete...
            throw new SnmpStatusException(SnmpStatusException.noSuchInstance);
        } else {
            // Some children variable or subobject is being querried
            // getChild() will raise an exception if no child is found.
            //
            final SnmpMibNode child= getChild(oid[depth]);
View Full Code Here

        if (handlers == null) {
            // This should be considered as a genErr, but we do not want to
            // abort the whole request, so we're going to throw
            // a noSuchObject...
            //
            throw new SnmpStatusException(SnmpStatusException.noSuchObject);
        }

        final Object data = handlers.getUserData();
        final int pduVersion = handlers.getRequestPduVersion();

        if (pos >= length) {
            long[] newOid= new long[1];
            newOid[0]=  getNextVarId(-1,data,pduVersion);
            result = findNextHandlingNode(varbind,newOid,0,depth,handlers,
                                          checker);
            return result;
        }

        // search the element specified in the oid
        //
        long[] newOid= new long[1];
        long index= oid[pos];

        while (true) {

            try {
                final SnmpMibNode child = getChild(index);
                // SnmpOid result = null;
                if (child == null) {
                    // shouldn't happen
                    throw new SnmpStatusException(SnmpStatusException.noSuchObject);
                    // validateVarId(index);
                    // handlers.add(this,varbind,depth);
                    // result = new SnmpOid(0);
                } else {
                    checker.add(depth, index);
View Full Code Here

        // first we need to retrieve the identifier in the list of children
        //
        final int pos= getInsertAt(id);
        if (pos >= nbChildren) {
            throw new SnmpStatusException(SnmpStatusException.noSuchObject);
        }

        if (varList[pos] != (int) id) {
            throw new SnmpStatusException(SnmpStatusException.noSuchObject);
        }

        // Access the node
        //
        SnmpMibNode child = null;
        try {
            child = children.elementAtNonSync(pos);
        } catch(ArrayIndexOutOfBoundsException e) {
            throw new SnmpStatusException(SnmpStatusException.noSuchObject);
        }
        if (child == null) {
            throw new SnmpStatusException(SnmpStatusException.noSuchInstance);
        }
        return child;
    }
View Full Code Here

        // should have been registered earlier)
        if (isnew) {
            SnmpVarBind var;
            for (Enumeration<SnmpVarBind> e= r.getElements(); e.hasMoreElements();) {
                var = e.nextElement();
                r.registerGetException(var,new SnmpStatusException(SnmpStatusException.noSuchInstance));
            }
        }

        final SnmpOid     oid    = r.getEntryOid();
View Full Code Here

    public synchronized void addEntry(SnmpOid oid, ObjectName name,
                                      Object entry)
        throws SnmpStatusException {

        if (isRegistrationRequired() == true && name == null)
            throw new SnmpStatusException(SnmpStatusException.badValue);

        if (size == 0) {
            //            indexes.addElement(index);
            // XX oids.addElement(oid);
            insertOid(0,oid);
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.