Package org.globus.workspace.client_core

Examples of org.globus.workspace.client_core.ParameterProblem


    void _parameterCheck_initContext() throws ParameterProblem {
        CloudClientUtil.checkX509Credential("Context init helper (which talks to the " +
                "context broker)", this.print);

        if (this.args.getInitCtxDir() == null) {
            throw new ParameterProblem("Must specify ctx output directory");
        }
    }
View Full Code Here


        final String brokerURL = this.args.getBrokerURL();
        if (brokerURL == null) {
            final String factoryHostPort = this.args.getFactoryHostPort();
            if (factoryHostPort == null) {
                throw new ParameterProblem(" requires either '--" +
                        Opts.BROKER_URL_OPT_STRING + "' or '--" +
                        Opts.FACTORY_OPT_STRING + "'");
            }

            final String url = CloudClientUtil.serviceURL(factoryHostPort);
            if (!CloudClientUtil.validURL(url, this.print.getDebugProxy())) {
                throw new ParameterProblem("Derived service URL is not a " +
                        "valid URL: '" + url + "'");
            }

            this.workspaceFactoryURL = url;
        }

        if (this.args.getHistoryDirectory() == null) {
            throw new ParameterProblem("This requires '" +
                                       Opts.HISTORY_DIR_OPT_STRING + "'");
        }

        this._checkHistoryDirectory("EC2 cluster helper (which talks to the " +
                "context broker)");
View Full Code Here

    void _checkServiceURL(String action) throws ParameterProblem {

        final String factoryHostPort = this.args.getFactoryHostPort();

        if (factoryHostPort == null) {
            throw new ParameterProblem(action + " requires '" +
                                       Opts.FACTORY_OPT_STRING + "'");
        }

        final String url = CloudClientUtil.serviceURL(factoryHostPort);
        if (!CloudClientUtil.validURL(url, this.print.getDebugProxy())) {
            throw new ParameterProblem("Service URL is not a valid URL: '" +
                                       url + "'");
        }

        this.workspaceFactoryURL = url;
        this.print.debugln("Derived workspace factory URL: '" + url + "'");
View Full Code Here

    void _checkStatusServiceEPR(String action) throws ParameterProblem {

        final String factoryHostPort = this.args.getFactoryHostPort();

        if (factoryHostPort == null) {
            throw new ParameterProblem(action + " requires '" +
                                       Opts.FACTORY_OPT_STRING + "'");
        }

        final String url = CloudClientUtil.statusServiceURL(factoryHostPort);
        if (!CloudClientUtil.validURL(url, this.print.getDebugProxy())) {
            throw new ParameterProblem(
                    "Status Service URL is not a valid URL: '" + url + "'");
        }

        try {
            this.statusServiceEPR =
                    AddressingUtils.createEndpointReference( url,
                                     WorkspaceStatusClient.defaultResourceKey);
        } catch (Exception e) {
            final String err = "Problem deriving status service EPR: ";
            throw new ParameterProblem(err + e.getMessage(), e);
        }

        this.print.debugln("Derived workspace status service URL: '" + url + "'");
    }
View Full Code Here

    void _checkHistoryDirectory(String action) throws ParameterProblem {

        final String historyDirectory = this.args.getHistoryDirectory();

        if (historyDirectory == null) {
            throw new ParameterProblem(action + " requires '" +
                                       Opts.HISTORY_DIR_OPT_STRING + "'");
        }

        CloudClientUtil.verifyHistoryDir(historyDirectory, true, true);
    }
View Full Code Here

                    "sub-directory argument overrides it");
            return;
        }

        if (this.args.getHistoryDirectory() == null) {
            throw new ParameterProblem("Not able to use handle to locate the " +
                    "necessary, stored information: no top-level history " +
                    "directory argument was supplied.");
        }

        this._checkHistoryDirectory(action);
View Full Code Here

            // This is a message present to human.  An unmentioned, third option
            // is technically possible.  It's more esoteric, but one could
            // specify Opts.HISTORY_SUBDIR_OPT_STRING directly.

            throw new ParameterProblem(action + " requires either " +
                    "'" + Opts.HANDLE_OPT_STRING +
                    "' or path to specific EPR file using '" +
                    Opts.EPR_FILE_OPT_STRING + "'");
        }

        if (historySubDir != null && eprGivenFilePath != null) {
            throw new ParameterProblem(action + " will use either '" +
                                       Opts.HISTORY_SUBDIR_OPT_STRING +
                                       "' or '" + Opts.EPR_FILE_OPT_STRING +
                                       "', but you've provided BOTH options.");
        }

        File f;
        if (historySubDir != null) {
            CloudClientUtil.verifyHistoryDir(historySubDir, false, false);
            f = new File(historySubDir, HistoryUtil.SINGLE_EPR_FILE_NAME);
            if (!CloudClientUtil.fileExistsAndReadable(f)) {
                f = new File(historySubDir, HistoryUtil.ENSEMBLE_EPR_FILE_NAME);
                if (CloudClientUtil.fileExistsAndReadable(f)) {
                    this.isClusterHandle = true;
                } else {
                    throw new ParameterProblem("Cannot find or read any " +
                            "instance or cluster EPRs under '" +
                            historySubDir + "'\nPerhaps this launch did " +
                            "not succeed?");
                }
            }
        } else {
            f = new File(eprGivenFilePath);
            if (!CloudClientUtil.fileExistsAndReadable(f)) {
                throw new ParameterProblem("Cannot find or read '" +
                        eprGivenFilePath + "'");
            }
        }

        String old = null;
        if (this.specificEPRpath != null) {
            old = this.specificEPRpath;
        }

        this.specificEPRpath = f.getAbsolutePath();

        if (old != null) {
            if (!old.equals(this.specificEPRpath)) {
                throw new ParameterProblem(
                        "Unexpected with any input: specific EPR that was " +
                                "previously set is '" + old + "' but it is " +
                                "not the same as a repeat derivation which " +
                                "is '" + this.specificEPRpath + "'. Please " +
                                "send debug output file (in the history " +
View Full Code Here

            // This is a message present to human.  An unmentioned, third option
            // is technically possible.  It's more esoteric, but one could
            // specify Opts.HISTORY_SUBDIR_OPT_STRING directly.

            throw new ParameterProblem(action + " requires either " +
                    "'" + Opts.HANDLE_OPT_STRING +
                    "' or path to specific EPR file using '" +
                    Opts.EPR_FILE_OPT_STRING + "'");
        }

        if (historySubDir != null && eprGivenFilePath != null) {
            throw new ParameterProblem(action + " will use either '" +
                                       Opts.HISTORY_SUBDIR_OPT_STRING +
                                       "' or '" + Opts.EPR_FILE_OPT_STRING +
                                       "', but you've provided BOTH options.");
        }

        File f;
        if (historySubDir != null) {
            CloudClientUtil.verifyHistoryDir(historySubDir, false, false);
            f = new File(historySubDir, HistoryUtil.CONTEXT_EPR_FILE_NAME);
            if (!CloudClientUtil.fileExistsAndReadable(f)) {
                throw new ParameterProblem("Cannot find or read any " +
                            "context EPRs under '" +
                            historySubDir + "'\nPerhaps this launch did " +
                            "not succeed or it was not a virtual cluster launch " +
                            "using the context broker?");
            }
        } else {
            f = new File(eprGivenFilePath);
            if (!CloudClientUtil.fileExistsAndReadable(f)) {
                throw new ParameterProblem("Cannot find or read '" +
                        eprGivenFilePath + "'");
            }
        }

        String old = null;
        if (this.specificEPRpath != null) {
            old = this.specificEPRpath;
        }

        this.specificEPRpath = f.getAbsolutePath();

        if (old != null) {
            if (!old.equals(this.specificEPRpath)) {
                throw new ParameterProblem(
                        "Unexpected with any input: specific EPR that was " +
                                "previously set is '" + old + "' but it is " +
                                "not the same as a repeat derivation which " +
                                "is '" + this.specificEPRpath + "'. Please " +
                                "send debug output file (in the history " +
View Full Code Here

    }

    void _checkSourcefile() throws ParameterProblem {
        final String sourcefile = this.args.getSourcefile();
        if (!CloudClientUtil.fileExistsAndReadable(sourcefile)) {
            throw new ParameterProblem("Specified source file does not " +
                    "exist or is not readable: '" + sourcefile + "'");
        }
    }
View Full Code Here

    }

    void _checkLocalfile() throws ParameterProblem {
        final String localfile = this.args.getLocalfile();
        if (CloudClientUtil.fileExists(localfile)) {
            throw new ParameterProblem("Specified local target file already " +
                    "exists: '" + localfile + "'");
        }
    }
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.