Package org.nimbustools.api.services.rm

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


        final VirtualMachine[] vms = new VirtualMachine[numNodes];
        for (int i = 0; i < vms.length; i++) {
            try {
                vms[i] = VirtualMachine.cloneOne(vm);
            } catch (Exception e) {
                throw new CreationException(e.getMessage(), e);
            }
        }
       
        return vms;
    }
View Full Code Here


            }

            if (!ok) {
                final String err = "requested initial target state '" +
                        requestedInitialState + "' is illegal";
                throw new CreationException(err);
            }

            vm.getDeployment().setRequestedState(targetState);

        } else {
View Full Code Here

            FileOutputStream out = new FileOutputStream(localPath);
            out.write(credential.getBytes());
            out.flush();
            out.close();
        } catch (Exception e) {
            throw new CreationException("Couldn't save credential to " + localTempDirectory
                                         + ". " + e.getMessage());
        }

        final FileCopyNeed need;
        try {
            // FileCopyNeed expects a file in nimbus's tmp, not a full path
            need = new FileCopyNeed(credentialName);
            vm.addFileCopyNeed(need);
        } catch (Exception e) {
            final String err = "problem setting up file copy for credential: " +
                    credentialName + " : " + e.getMessage();
            throw new CreationException(err);
        }

        vm.setCredentialName(credentialName);
    }
View Full Code Here

        try {
            this.validate();
            this.bindFileWrites(vm, reqs);
        } catch (Exception e) {
            throw new CreationException(e.getMessage(), e);
        }
    }
View Full Code Here

    protected FileCopyNeed newNeed(String src,
                                        String dstPath) throws Exception {

        // already checked, this is for object extenders
        if (this.localDirPath == null) {
            throw new CreationException("cannot perform customization " +
                    "without local tmp directory");
        }

        final int maxContentLength = 40960; // embedded policy for now
       
View Full Code Here

                         Calendar termTime,
                         String node,
                         double chargeRatio) throws CreationException {

        if (vm == null) {
            throw new CreationException("null vm");
        }

        if (vm.getDeployment() == null) {
            throw new CreationException("null deployment information");
        }

        this.id = id;
        this.vm = vm;
        this.chargeRatio = chargeRatio;
View Full Code Here

        final String idStr;
        try {
            idStr = this.convertID(id);
            return this.newInstance(idStr);
        } catch (ManageException e) {
            throw new CreationException(e.getMessage(), e);
        }
    }
View Full Code Here

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

        try {

            final Element el = this.cache.get(idStr);
            if (el == null) {
                resource = this.newEmptyResource();
                this.cache.put(new Element(idStr, resource));
            } else {
                throw new CreationException(
                        "ID collision, ID '" + idStr + "' already in cache");
            }

        } finally {
            lock.unlock();
View Full Code Here

            throws CreationException,
                   MetadataException {

        if (req == null) {
            throw new CreationException("no CreateRequest?");
        }

        if (req.getName() == null) {
            throw new CreationException("no createrequest name?");
        }

        final RequiredVMM reqVMM = req.getRequiredVMM();
        if (reqVMM != null && reqVMM.getType() == null) {
            throw new MetadataException(
                    "RequiredVMM encountered with missing type");
        }

        final Kernel kernel = req.getRequestedKernel();
        if (kernel != null && kernel.getKernel() == null) {
            throw new MetadataException(
                    "RequestedKernel encountered with missing location URI");
        }

        final Context context = req.getContext();
        if (context != null) {
            if (context.getBootstrapPath() == null) {
                throw new CreationException(
                    "Context encountered with missing bootstrap path");
            }
            if (context.getBootstrapText() == null) {
                throw new CreationException(
                    "Context encountered with missing bootstrap text");
            }
        }
    }
View Full Code Here

        }

        for (int i = 0; i < custTasks.length; i++) {
            final CustomizationRequest custTask = custTasks[i];
            if (custTask == null) {
                throw new CreationException("CustomizationRequest array " +
                    "may not contain nulls");
            }
            if (custTask.getContent() == null) {
                throw new CreationException("CustomizationRequest " +
                    "encountered with no content");
            }
            if (custTask.getPathOnVM() == null) {
                throw new CreationException("CustomizationRequest " +
                    "encountered with no target path");
            }
        }
    }
View Full Code Here

TOP

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

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.