Package org.globus.workspace.client_core

Examples of org.globus.workspace.client_core.ParameterProblem


    protected void validateDeploymentRequestNodeNumber()
            throws ParameterProblem {

        final int nodeNum = (int) this.req.getNodeNumber();
        if (nodeNum != 1) {
            throw new ParameterProblem(
                    "this class does not support group requests, " +
                            "deployment request is asking for " + nodeNum);
        }
    }
View Full Code Here


     */
    public void validateEnsembleRelated() throws ParameterProblem {

        if (this.joinEnsembleEPR != null && this.createEnsemble) {

            throw new ParameterProblem("\"create ensemble\" flag may not be " +
                    "set at the same time as a \"join ensemble\" EPR, that " +
                    "request would not make any sense");

        } else if (this.createEnsemble && this.lastInEnsemble) {

            throw new ParameterProblem("\"create ensemble\" flag may not be " +
                    "set at the same time as the \"last in ensemble\" flag, " +
                    "that request would not make any sense");
        }
    }
View Full Code Here

     */
    public void validateContextRelated() throws ParameterProblem {

        if (this.joinContextEPR != null && this.createContext) {

            throw new ParameterProblem("\"create context\" flag may not be " +
                    "set at the same time as a \"join context\" EPR, that " +
                    "request would not make any sense");

        }
    }
View Full Code Here

            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));
        // this is intentionally a separate object:
        workspace.setCurrentResourceAllocation(new ResourceAllocation(ra));

        boolean trash = false;

        if (this.req.getShutdownMechanism() != null
            && this.req.getShutdownMechanism().equals(
                ShutdownMechanism_Type.Trash)) {

            trash = true;
        }
        final ShutdownMech mech = new ShutdownMech(trash);
        workspace.setRequestedShutdownMech(mech);

        if (this.req.getInitialState() == null) {
            workspace.setRequestedInitialState(State.DEFAULT_INITIAL_STATE);
        } else {
            final State initialState =
                    State.fromInitialState_Type(this.req.getInitialState());

            workspace.setRequestedInitialState(initialState);
        }

        // this might be incorrect information already, but it is the initial
        // state of all workspaces
        workspace.setCurrentState(new State(State.STATE_Unstaged));

        try {
            final DeploymentTime_Type time = this.req.getDeploymentTime();
            final int seconds =
                    CommonUtil.durationToSeconds(time.getMinDuration());
            final Schedule schedule = new Schedule();
            schedule.setDurationSeconds(seconds);
            workspace.setRequestedSchedule(schedule);
        } catch (NullPointerException e) {
            throw new ParameterProblem(e.getMessage(), e);
        } catch (InvalidDurationException e) {
            throw new ParameterProblem(e.getMessage(), e);
        }
    }
View Full Code Here

    protected void validateEndpoint() throws ParameterProblem {

        this.epr = this.stubConf.getEPR();

        if (this.epr == null) {
            throw new ParameterProblem(name() + " requires EPR");
        }

        final String eprStr;
        try {
            eprStr = EPRUtils.eprToString(this.epr);
        } catch (Exception e) {
            final String err = CommonUtil.genericExceptionMessageWrapper(e);
            throw new ParameterProblem(err, e);
        }

        if (this.pr.enabled()) {
            // xml print
            final String dbg =
                    "\nGiven EPR:\n----------\n" + eprStr + "----------\n";

            if (this.pr.useThis()) {
                this.pr.dbg(dbg);
            } else if (this.pr.useLogging()) {
                logger.debug(dbg);
            }
        }

        final String kind;
        if (EPRUtils.isInstanceEPR(this.epr)) {
            this.setInstanceAction();
            kind = "an instance";
        } else if (EPRUtils.isGroupEPR(this.epr)) {
            this.setGroupAction();
            kind = "a group";
        } else {
            throw new ParameterProblem(name() + " requires a valid EPR.");
        }

        if (this.pr.enabled()) {
            final String dbg = "Given EPR is " + kind + " EPR";
            if (this.pr.useThis()) {
View Full Code Here

                this.stubConf.setOptions((Stub)portTypes[i]);
            }

        } catch (Exception e) {
            final String err = "Problem setting up subscription stubs: ";
            throw new ParameterProblem(err + e.getMessage(), e);
        }

        if (this.pr.enabled()) {

            final long mstop = System.currentTimeMillis();
View Full Code Here

                createAsynchStateSubscribes(WorkspacePortType[] portTypes)
                        throws ParameterProblem {

        if (this.listenMaster == null) {
            // will not be null, leaving as safeguard/reminder
            throw new ParameterProblem("Cannot subscribe, notification " +
                    "listener was not set up correctly.");
        }

        final EndpointReferenceType consumerEPR =
                    this.listenMaster.getConsumerEPR();
View Full Code Here

                createAsynchTerminationSubscribes(WorkspacePortType[] portTypes)
                        throws ParameterProblem {

        if (this.listenMaster == null) {
            // will not be null, leaving as safeguard/reminder
            throw new ParameterProblem("Cannot subscribe, notification " +
                    "listener was not set up correctly.");
        }

        final EndpointReferenceType consumerEPR =
                    this.listenMaster.getConsumerEPR();
View Full Code Here

            }

            try {
                new URL(urlString);
            } catch (MalformedURLException e) {
                throw new ParameterProblem("Given factory service URL " +
                        "appears to be invalid: " + e.getMessage(), e);
            }

            if (this.pr.enabled()) {
                // address print
                final String msg = "Workspace Factory Service:\n    " +
                                        urlString;
                if (this.pr.useThis()) {
                    this.pr.infoln(PrCodes.CREATE__FACTORY_ENDPOINT,
                                   msg);
                } else if (this.pr.useLogging()) {
                    logger.info(msg);
                }
            }

            try {
                this.factoryEPR = AddressingUtils.createEndpointReference(
                                       urlString, EPRUtils.defaultFactoryKey());
            } catch (Exception e) {
                final String err = "Problem creating factory endpoint: ";
                throw new ParameterProblem(err + e.getMessage(), e);
            }

            this.stubConf.setEPR(this.factoryEPR);

        } else {

            this.factoryEPR = this.stubConf.getEPR();

            final String eprStr;
            try {
                eprStr = EPRUtils.eprToString(this.factoryEPR);
            } catch (Exception e) {
                throw new ParameterProblem(e.getMessage(), e);
            }

            if (this.pr.enabled()) {
                // xml print
                final String dbg =
View Full Code Here

        }
    }

    private void validateMetadata() throws ParameterProblem {
        if (this.args.metadataPath == null) {
            throw new ParameterProblem(name() + " requires metadata file.");
        }

        try {
            this.vw = FileUtils.getMetadataFromFile(this.pr,
                                                    this.args.metadataPath);
        } catch (Exception e) {
            final String err = "Problem with metadata file: ";
            throw new ParameterProblem(err + e.getMessage(), e);
        }
    }
View Full Code Here

TOP

Related Classes of org.globus.workspace.client_core.ParameterProblem

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.