Package org.globus.workspace.client_core

Examples of org.globus.workspace.client_core.ParameterProblem


    // -------------------------------------------------------------------------

    private void handlePollDelay() throws ParameterProblem {

        if (this.args.pollDelayString == null) {
            throw new ParameterProblem("poll delay is required");
        }

        try {
            this.pollDelayMs = Long.parseLong(this.args.pollDelayString);
        } catch (NumberFormatException e) {
            throw new ParameterProblem("Given poll delay is not valid: '" +
                    this.args.pollDelayString + "': " + e.getMessage(), e);
        }

        if (this.pollDelayMs < 1) {
            throw new ParameterProblem("Given poll delay is less than 1ms: " +
                    this.pollDelayMs + "ms");
        }
    }
View Full Code Here


            return// *** EARLY RETURN ***
        }


        if (!State.testValidState(this.args.exitStateString)) {
            throw new ParameterProblem("Provided exit string is not a " +
                    "valid state: '" + this.args.exitStateString + "'");
        }

        this.compareState = new State(this.args.exitStateString);

        if (this.pr.enabled()) {
            final String dbg = "Exit state: " + this.compareState.toString();
            if (this.pr.useThis()) {
                this.pr.dbg(dbg);
            } else if (this.pr.useLogging()) {
                logger.debug(dbg);
            }
        }

        if (!this.compareState.isOKState()) {
            throw new ParameterProblem("Provided exit string is not a " +
                    "valid target state: '" + this.args.exitStateString + "'");
        }

        this.targetState = CurrentState_Enumeration.
                                fromString(this.compareState.toString());
View Full Code Here

    private 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 =
View Full Code Here

            return; // *** EARLY RETURN ***
        }

        final File f = new File(this.args.reportDir);
        if (!f.exists()) {
            throw new ParameterProblem("Given path for reports directory ('" +
                    this.args.reportDir + "') does not exist.");
        }

        if (!f.isDirectory()) {
            throw new ParameterProblem("Given path for reports directory ('" +
                    this.args.reportDir + "') is not a directory.");
        }

        if (!f.canWrite()) {
            throw new ParameterProblem("Given path for reports directory ('" +
                    this.args.reportDir + "') is not writable.");
        }
    }
View Full Code Here

    protected void validateDeploymentRequestNodeNumber()
            throws ParameterProblem {

        final int nodeNum = (int) this.req.getNodeNumber();
        if (nodeNum < 2) {
            throw new ParameterProblem(
                    "this class only supports group requests, " +
                            "deployment request is asking for " + nodeNum);
        }
    }
View Full Code Here

     * @throws ParameterProblem issue that will stop creation attempt
     */
    public void validateAll() throws ParameterProblem {
        super.validateAll();
        if (this.retrieveSend == null) {
            throw new ParameterProblem("there is no configured " +
                    "RetrieveSend_Type, cannot run Ctx_Retrieve");
        }
    }
View Full Code Here

    // -------------------------------------------------------------------------

    public void validateAll() throws ParameterProblem {

        if (this.lifetime < 1) {
            throw new ParameterProblem(
                    "newProxyLifetimeSeconds is less than one second");
        }

        if (this.factoryUrl == null) {
            throw new ParameterProblem("delegation factory URL is missing");
        } else {
            try {
                new URL(this.factoryUrl);
            } catch (MalformedURLException e) {
                throw new ParameterProblem(
                        "delegation factory URL is not a valid URL");
            }
        }

        if (this.issuingCred == null) {
            throw new ParameterProblem("issuing credential is missing");
        }

        if (this.certToSign == null) {
            throw new ParameterProblem("certificate to sign is missing");
        }

        if (this.csd == null) {
            throw new ParameterProblem(
                    "client security descriptor is missing");
        }
    }
View Full Code Here

        if (this.queryIP != null) {
            numSet += 1;
        }

        if (numSet > 1) {
            throw new ParameterProblem(
                    "Can only choose one query method: all, ip, or host");
        }

        if (numSet == 0) {
            throw new ParameterProblem(
                    "Must choose one query method: all, ip, or host");
        }
    }
View Full Code Here

     * @throws ParameterProblem issue that will stop creation attempt
     */
    public void validateMetadata() throws ParameterProblem {

        if (this.vw == null) {
            throw new ParameterProblem("no metadata is configured");
        }

        if (this.vw.getDefinition() == null) {
            throw new ParameterProblem("no definition in given metadata");
        }

        if (this.vw.getLogistics() == null) {
            throw new ParameterProblem("no logistics in given metadata");
        }

        if (this.vw.getName() == null) {
            // TODO: debug print this
            final URI name;
            try {
                name = new URI("http://no-name");
            } catch (URI.MalformedURIException e) {
                throw new ParameterProblem(
                        "default name problem: " + e.getMessage(), e);
            }
            this.vw.setName(name);
        }

View Full Code Here

    }
   
    protected void validateDeploymentRequestCommon() throws ParameterProblem {

        if (this.req == null) {
            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 =
                this.req.getResourceAllocation().getIndividualPhysicalMemory();
        if (rvt == null) {
            throw new ParameterProblem(
                    "memory specification is not present");
        }
        final GenericIntRange exact = new GenericIntRange(rvt);
        if (exact.getMin() != exact.getMax()) {
            throw new ParameterProblem(
                    "memory range requests aren't supported right now");
        }

        if (this.req.getInitialState() != null) {
            final State testing =
                    State.fromInitialState_Type(this.req.getInitialState());
            if (testing == null) {
                throw new ParameterProblem(
                    "initial state in deployment request is unrecognized?");
            }
        }

        final DeploymentTime_Type time = this.req.getDeploymentTime();
        if (time == null) {
            throw new ParameterProblem("no DeploymentTime_Type in request?");
        }

        final Duration minDuration = time.getMinDuration();
        if (minDuration == null) {
            throw new ParameterProblem("no minDuration in request?");
        }

        try {
            if (CommonUtil.durationToSeconds(minDuration) < 1) {
                throw new ParameterProblem(
                        "minDuration in request is less than 1 second?");
            }
        } catch (InvalidDurationException e) {
            throw new ParameterProblem(
                        "minDuration is invalid: " + 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.