Package org.nimbustools.api.services.rm

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


    public GroupResource find(String groupid)

            throws ManageException, DoesNotExistException {
       
        if (groupid == null) {
            throw new ManageException("groupid may not be null");
        }

        final GroupResource resource;

        final Lock lock = this.lockManager.getLock(groupid);
        try {
            lock.lockInterruptibly();
        } catch (InterruptedException e) {
            throw new ManageException(e.getMessage(), e);
        }

        try {

            final Element el = this.cache.get(groupid);
View Full Code Here


    public void destroy(String groupid) throws ManageException,
                                               DoesNotExistException {
       
        if (groupid == null) {
            throw new ManageException("groupid may not be null");
        }

        final Lock lock = this.lockManager.getLock(groupid);
        try {
            lock.lockInterruptibly();
        } catch (InterruptedException e) {
            throw new ManageException(e.getMessage(), e);
        }

        try {
            final GroupResource resource = this.find(groupid);
            resource.remove();
View Full Code Here

     * @throws ManageException problem
     */
    public void remove() throws ManageException {

        if (this.coschedid == null) {
            throw new ManageException(
                    "illegal class usage, no coschedid was stored at creation");
        }

        try {
            _remove();
        } catch (Throwable t) {
            logger.fatal("Could not remove-all? Via cosched group '" +
                    this.coschedid + "': " + t.getMessage(), t);
            throw new ManageException("Internal service error, perhaps " +
                    "you'd like to inform the administrator of the time of " +
                    "the error and this key: '" + this.coschedid + "'");
        }
    }
View Full Code Here

                    Lager.ensembleid(this.coschedid) + " destroy begins");
        }

        final String errors = do_remove();
        if (errors != null) {
            throw new ManageException(errors);
        }

        if (lager.eventLog) {
            logger.info(Lager.ensembleev(this.coschedid) + "destroyed");
        } else if (lager.traceLog) {
View Full Code Here

    private void _adjustRootUnpropTarget(String path, String suffix, Log logger)

            throws ManageException {
       
        if (this.partitions == null || this.partitions.length == 0) {
            throw new ManageException("partitions do not exist");
        }

        boolean found = false;
        for (int i = 0; i < this.partitions.length; i++) {
            if (this.partitions[i].isRootdisk()) {

                final String old = this.partitions[i].getAlternateUnpropTarget();

                if (logger != null && old != null) {
                    logger.info(Lager.ev(this.id) + "Overriding previously " +
                            "set alternate unpropagate target: '" + old + "'");
                } else if (logger != null) {
                    logger.info(Lager.ev(this.id) + "Setting " +
                            "alternate unpropagate target: '" + path + "'");
                }

                if (path != null) {

                    if (suffix != null) {
                        final String newpath = path + suffix;
                        this.partitions[i].setAlternateUnpropTarget(newpath);
                    } else {
                        this.partitions[i].setAlternateUnpropTarget(path);
                    }

                } else if (old != null && suffix != null) {
                    final String newpath = old + suffix;
                    this.partitions[i].setAlternateUnpropTarget(newpath);
                }
               
                found = true;
                break;
            }
        }

        if (!found) {
            throw new ManageException(
                    "could not find root disk to override its target");
        }
    }
View Full Code Here

        // technically possible but only someone else's client implementation
        // would allow this to happen
        if (!isReadyForTransport) {
            final String err = "Post-shutdown tasks are only compatible " +
                    "with a ReadyForTransport request.";
            throw new ManageException(err);
        }

        if (this.authzCallout != null
                && this.authzCallout instanceof PostTaskAuthorization) {

            // shortcut: currently we know owner is the caller at this point
            final String dnToAuthorize = this.creatorID;

            final Integer decision;
            String newTargetName;
            try {
                decision = ((PostTaskAuthorization)this.authzCallout).
                    isRootPartitionUnpropTargetPermitted(target, dnToAuthorize);
            } catch (AuthorizationException e) {
                throw new ManageException(e.getMessage(), e);
            }

            if (!Decision.PERMIT.equals(decision)) {
                throw new ManageException(
                        "request denied, no message for client");
            }
        }

        final String trueTarget;
        if (tasks.isAppendID()) {
           
            trueTarget = target.toASCIIString() + "-" + this.id;

            // check new uri syntax:
            try {
                new URI(trueTarget);
            } catch (URISyntaxException e) {
                throw new ManageException(e.getMessage(), e);
            }
           
        } else {
           
            trueTarget = target.toASCIIString();
View Full Code Here

                found = true;
            }
        }

        if (!found) {
            throw new ManageException(Lager.id(trackingID) + " entry was " +
                    "not found in '" + name + "': " + ipAddress);
        }
        entry.setInUse(false);
        db.replaceAssociationEntry(name, entry);
View Full Code Here

        return result;
    }

    public void setDestructionTime(String id, int type, Calendar time)
            throws DoesNotExistException, ManageException {
        throw new ManageException("Not allowing remote termination changes");
    }
View Full Code Here

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

        this.opIntake("START", id, type, caller);

        switch (type) {
            case INSTANCE: this.home.find(id).start(); break;
            case GROUP: this.ghome.find(id).start(); break;
            default: throw new ManageException(
                                "Unknown/unhandled type: " + trType(type));
        }
    }
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.