Package org.nimbustools.api.services.rm

Examples of org.nimbustools.api.services.rm.ManageException


    }

    public VM[] getAllByIPAddress(String ip) throws ManageException {

        if (ip == null) {
            throw new ManageException("invalid, ip may not be null");
        }
       
        try {
            final InstanceResource[] rsrcs = this.home.findByIP(ip);

            return this.getInstances(rsrcs);

        } catch (CannotTranslateException e) {
            throw new ManageException(e.getMessage(), e);
        }
    }
View Full Code Here


            final InstanceResource[] rsrcs = this.home.findAll();

            return this.getInstances(rsrcs);

        } catch (CannotTranslateException e) {
            throw new ManageException(e.getMessage(), e);
        }
    }
View Full Code Here

    public Usage getCallerUsage(Caller caller) throws ManageException {

        this.opIntakeGeneralOp("ALL-USAGE", caller);

        if (this.accounting == null) {
            throw new ManageException("not able to query usage, there is " +
                    "no accounting plugin configured");
        }

        final String id;

        // already checked in opIntake but guard against object extenders
        if (caller == null || caller.getIdentity() == null) {
            throw new ManageException("not able to query usage, there is " +
                    "no caller information");
        } else {
            id = caller.getIdentity();
        }

        try {
            final ElapsedAndReservedMinutes earm =
                    this.accounting.totalElapsedAndReservedMinutesTuple(id);
            return this.dataConvert.getUsage(earm);
        } catch (Exception e) {
            throw new ManageException(e.getMessage(), e);
        }
    }
View Full Code Here

        switch (type) {
            case INSTANCE:
                this.home.find(id).registerStateChangeListener(listener);
                break;
            default:
                throw new ManageException(
                        "Unknown/unhandled type: " + trType(type));
        }
    }
View Full Code Here

        switch (type) {
            case INSTANCE:
                this.home.find(id).registerDestructionListener(listener);
                break;
            default:
                throw new ManageException(
                        "Unknown/unhandled type: " + trType(type));
        }
    }
View Full Code Here

        // *home.find() will return DoesNotExistException or return
        switch (type) {
            case INSTANCE: this.home.find(id); return true;
            case GROUP: this.ghome.find(id); return true;
            case COSCHEDULED: this.cohome.find(id); return true;
            default: throw new ManageException(
                                "Unknown/unhandled type: " + trType(type));
        }
    }
View Full Code Here

        switch (type) {
            case INSTANCE: return this.home.find(id).getCreatorID();
            case GROUP: return this.ghome.find(id).getCreatorID();
            case COSCHEDULED: return this.cohome.find(id).getCreatorID();
            default: throw new ManageException(
                                "Unknown/unhandled type: " + trType(type));
        }
    }
View Full Code Here

        // these things should all be present even if event log is off,
        // this method serves as initial validation as well as optionally
        // doing event log
       
        if (opName == null) {
            throw new ManageException("No operation name");
        }

        if (caller == null) {
            throw new ManageException("No caller information");
        }

        final String callerID = caller.getIdentity();

        if (callerID == null) {
            throw new ManageException("No caller identity information");
        }

        if (!this.lager.eventLog) {
            return; // *** EARLY RETURN ***
        }
       
        final String prefix;

        if (generalOp) {
           
            prefix = "";

        } else {

            switch (type) {

                case INSTANCE:
                    prefix = Lager.ev(this.home.convertID(id));
                    break;

                case GROUP:
                    prefix = Lager.groupev(id);
                    break;

                case COSCHEDULED:
                    prefix = Lager.ensembleev(id);
                    break;

                default: throw new ManageException(
                                    "Unknown/unhandled type: " + trType(type));
            }
        }

        logger.info(prefix + opName + " called by '" + callerID + "'");
View Full Code Here

        final InstanceResource[] resources = this.ghome.findMembers(groupid);

        try {
            return this.getInstances(resources);
        } catch (CannotTranslateException e) {
            throw new ManageException(e.getMessage(), e);
        }
    }
View Full Code Here

        final InstanceResource[] resources = this.cohome.findMembers(coschedid);

        try {
            return this.getInstances(resources);
        } catch (CannotTranslateException e) {
            throw new ManageException(e.getMessage(), e);
        }
    }
View Full Code Here

TOP

Related Classes of org.nimbustools.api.services.rm.ManageException

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.