Package org.nimbustools.messaging.gt4_0.factory

Examples of org.nimbustools.messaging.gt4_0.factory.FactoryResource


        if (this.args.saveTarget == null) {
            return; // *** EARLY RETURN ***
        }

        this.postShutdownRequest = new PostShutdown_Type();

        try {
            final URI uri = new URI(this.args.saveTarget);
            this.postShutdownRequest.setRootPartitionUnpropagationTarget(uri);
        } catch (URI.MalformedURIException e) {
View Full Code Here


            throw new ParameterProblem("no deployment request is configured");
        }

        this.validateDeploymentRequestNodeNumber();

        final ResourceAllocation_Type ra = this.req.getResourceAllocation();
        if (ra == null) {
            throw new ParameterProblem("ResourceAllocation is not present");
        }

        final RangeValue_Type rvt =
View Full Code Here

        final VirtualNetwork_Type net = this.vw.getLogistics().getNetworking();
        if (net != null) {
            workspace.setRequestedNetworking(new Networking(net));
        }

        final ResourceAllocation_Type ra = this.req.getResourceAllocation();
        if (ra == null) {
            throw new ParameterProblem("(?) no ResourceAllocation_Type");
        }

        workspace.setRequestedResourceAllocation(new ResourceAllocation(ra));
View Full Code Here

                                                  this.args.getMetadata_cpuType(),
                                                  this.args.getMetadata_vmmVersion(),
                                                  this.args.getMetadata_vmmType(),
                          this.kernelURI);

        final WorkspaceDeployment_Type deploymentRequest =
                DeploymentXMLUtil.constructDeployment(this.args.getDurationMinutes(),
                                                      this.args.getMemory(),
                                                      this.args.getCores(),
                                                      this.newUnpropTargetURL);
View Full Code Here

                Boolean.TRUE.equals(wsreq.getPartOfEnsemble());
        final EndpointReferenceType ensembleEPR = wsreq.getEnsembleEPR();

        // it'd be interesting to not require this and use all defaults but
        // it is currently required:
        final WorkspaceDeployment_Type dep = wsreq.getResourceRequest();
        if (dep == null) {
            throw new CannotTranslateException(
                    "create request deployment may not be missing");
        }

        final PostShutdown_Type post = dep.getPostShutdown();

        // -------------------------------------------------------------
        // Translate:
        // -------------------------------------------------------------
View Full Code Here

    public CurrentWorkspaces_Type getCurrentWorkspaces_Type(VM[] vms)
            throws CannotTranslateException {

        if (vms == null || vms.length == 0) {
            return new CurrentWorkspaces_Type(); // *** EARLY RETURN ***
        }

        final OneCurrentWorkspace_Type[] currents =
                new OneCurrentWorkspace_Type[vms.length];

        for (int i = 0; i < vms.length; i++) {
            currents[i] = this.getOneCurrentWorkspace(vms[i]);
        }

        return new CurrentWorkspaces_Type(currents);
    }
View Full Code Here

    }

    private Workspace[] _queryAll() throws ExecutionProblem,
                                           RemoteException {

        final CurrentWorkspaces_Type current =
                ((WorkspaceStatusPortType)this.portType)
                                .queryCurrentWorkspaces(new VoidType());

        try {
            return convert(current);
View Full Code Here

        if (vm == null) {
            throw new IllegalArgumentException("vm may not be null");
        }

        final OneCurrentWorkspace_Type one = new OneCurrentWorkspace_Type();

        one.setEpr(this.trinst.getEPR(vm.getID()));
        one.setCurrentState(this.trinst.getCurrentState(vm));
        one.setLogistics(this.trinst.getLogistics(vm));
        one.setResourceAllocation(this.trinst.getResourceAllocation_Type(vm));
        one.setSchedule(this.trinst.getSchedule_Type(vm));
        one.setDetails(this.trinst.getDetails(vm));

        return one;
    }
View Full Code Here

        if (usage == null) {
            throw new CannotTranslateException("usage is missing");
        }

        final UsedAndReservedTime_Type ret = new UsedAndReservedTime_Type();

        // exceeds 6 million years of usage?
        final long reserved = usage.getReservedMinutes();
        if (reserved > Integer.MAX_VALUE) {
            throw new CannotTranslateException(
                    "Reserved time exceeds maximum integer size");
        }
        ret.setReservedTime(CommonUtil.minutesToDuration((int)reserved));

        // exceeds 6 million years of usage?
        final long elapsed = usage.getElapsedMinutes();
        if (elapsed > Integer.MAX_VALUE) {
            throw new CannotTranslateException(
                    "Elapsed time exceeds maximum integer size");
        }
        ret.setUsedTime(CommonUtil.minutesToDuration((int)elapsed));

        return ret;
    }
View Full Code Here

            if (action.equals(ACTION_FACTORYQUERY)) {
                (new RPQuery(client, client.endpoint, System.out)).start();
            }

            if (action.equals(ACTION_USAGEQUERY)) {
                UsedAndReservedTime_Type usedReserved = null;
                try {
                    usedReserved =
                            statusPort.queryUsedAndReservedTime(new VoidType());
                } catch (RemoteException e) {
                    die(e, "Problem with query", client.isDebugMode());
                }

                Duration used = usedReserved.getUsedTime();
                Duration reserved = usedReserved.getReservedTime();

                if (used == null) {
                    System.err.println("No used minutes " +
                            "information returned");
                } else {
View Full Code Here

TOP

Related Classes of org.nimbustools.messaging.gt4_0.factory.FactoryResource

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.