Package org.globus.workspace.client_core

Examples of org.globus.workspace.client_core.ParameterProblem


    }

    void parameterCheck_destroy() throws ParameterProblem {

        if (this.args.getActions().contains(AllArgs.ACTION_RUN)) {
            throw new ParameterProblem(
                    "You cannot create (--" + Opts.RUN_OPT_STRING +
                            ") and destroy in the same invocation");
        }

        final String actionString = "Terminating";
View Full Code Here


    }

    void parameterCheck_status() throws ParameterProblem {

        if (this.args.getActions().contains(AllArgs.ACTION_RUN)) {
            throw new ParameterProblem(
                    "You cannot create (--" + Opts.RUN_OPT_STRING +
                            ") and run a status check (on a previously" +
                            "created workspace) in the same invocation");
        }
View Full Code Here

    }

    void parameterCheck_printContextStatus() throws ParameterProblem {

        if (this.args.getActions().contains(AllArgs.ACTION_RUN)) {
            throw new ParameterProblem(
                    "You cannot create (--" + Opts.RUN_OPT_STRING +
                            ") and run print context status (on a previously" +
                            "created cluster) in the same invocation");
        }

        final String actionString = "Printing ctx status of each node";
        CloudClientUtil.checkX509Credential(actionString, this.print);
        this._translateHandle(actionString);

        if (this.args.getHistorySubDir() != null ||
                this.args.getEprGivenFilePath() != null) {
            this._checkSpecificBrokerEPR(actionString);
        } else {
            throw new ParameterProblem(actionString + " requires either " +
                    "'--" + Opts.HANDLE_OPT_STRING +
                    "' or path to specific context EPR file using '--" +
                    Opts.EPR_FILE_OPT_STRING + '\'');
        }
    }
View Full Code Here

    }

    void parameterCheck_save() throws ParameterProblem {

        if (this.args.getActions().contains(AllArgs.ACTION_RUN)) {
            throw new ParameterProblem(
                  "You cannot create (--" + Opts.RUN_OPT_STRING + ") and " +
                  "save a previously created workspace in the same invocation");
        }

        final String actionString = "Saving";
        CloudClientUtil.checkX509Credential(actionString, this.print);
        this._translateHandle(actionString);
        this._checkSpecificEPR(actionString);
        this.repoUtil.paramterCheck(this.args, actionString);

        final String newname = this.args.getNewname();
        if (newname != null) {
            this.print.debugln(
                    "save called with newname '" + newname + "'");
            try {
                this.newUnpropTargetURL = this.repoUtil.getDerivedImageURL(newname);
            } catch (Exception e) {
                throw new ParameterProblem("Problem with save's newname '" +
                        newname + "': " + e.getMessage(), e);
            }
        } else {
            this.print.debugln("save called with no newname");
        }
View Full Code Here

        this.repoUtil.paramterCheck(this.args, Opts.TARGETDIR_OPT_STRING);

        final String sourcefile = this.args.getSourcefile();
        final String name = this.args.getName();
        if (sourcefile == null && name == null) {
            throw new ParameterProblem(Opts.TARGETDIR_OPT_STRING +
                                       " requires either '" +
                                       Opts.SOURCEFILE_OPT_STRING + "' or '" +
                                       Opts.NAME_OPT_STRING + "'");
        }
    }
View Full Code Here

        this.repoUtil.paramterCheck(this.args, Opts.TRANSFER_OPT_STRING);

        final String sourcefile = this.args.getSourcefile();
        if (sourcefile == null) {
            throw new ParameterProblem(Opts.TRANSFER_OPT_STRING +
                                       " requires '" +
                                       Opts.SOURCEFILE_OPT_STRING + "'");
        }

        this._checkSourcefile();
View Full Code Here

        this.repoUtil.paramterCheck(this.args, Opts.DELETE_OPT_STRING);

        final String name = this.args.getName();
        if (name == null) {
            throw new ParameterProblem("Deleting requires '" +
                    Opts.NAME_OPT_STRING + "' (the name " +
                    "of the file in your remote personal directory)");
        }
    }
View Full Code Here

        final String localfile = this.args.getLocalfile();
        final String name = this.args.getName();

        if (localfile == null) {
            throw new ParameterProblem(Opts.DOWNLOAD_OPT_STRING +
                                       " requires '" +
                                       Opts.LOCAL_FILE_OPT_STRING + "'");
        }

        if (name == null) {
            throw new ParameterProblem("Downloading requires '" +
                    Opts.NAME_OPT_STRING + "' (the name " +
                    "of the file in your remote personal directory)");
        }

        this._checkLocalfile();
View Full Code Here

        // Differentiate between run and cluster-run
       
        if (sourcefile == null && name == null && clusterPath == null) {

            throw new ParameterProblem("Running requires either '" +
                                       Opts.SOURCEFILE_OPT_STRING + "', '" +
                                       Opts.NAME_OPT_STRING + "', or '" +
                                       Opts.CLUSTER_OPT_STRING + "'");
        }

        if (sourcefile != null && name != null) {
            throw new ParameterProblem("You may not specify both '" +
                                       Opts.SOURCEFILE_OPT_STRING + "' and '" +
                                       Opts.NAME_OPT_STRING + "'");
        }

        if (sourcefile == null && name == null && ec2ScriptPath != null) {
View Full Code Here

        if (sshfile == null) {
            this.print.errln("WARNING: no SSH public key is configured");
        }

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

        this._checkHistoryDirectory("Running");

        if (!this.args.isDurationMinutesConfigured()) {
            throw new ParameterProblem("Running requires '" +
                                       Opts.HOURS_OPT_STRING + "'");
        }

        this.print.debugln("Checking on repository URL for running " +
                    "because we are going to derive propagation string " +
                    "for the client");

        this.repoUtil.paramterCheck(this.args, Opts.RUN_OPT_STRING);

        final String newname = this.args.getNewname();
        if (newname != null) {
            this.print.debugln(
                    "run called with newname '" + newname + "'");
            try {
                this.newUnpropTargetURL =
                        this.repoUtil.getDerivedImageURL(newname);

            } catch (Exception e) {
                throw new ParameterProblem("Problem with run's newname '" +
                        newname + "': " + e.getMessage(), e);
            }
        }

        if (sshfile != null) {

            sshfile = CloudClientUtil.expandSshPath(sshfile);

            final File f = new File(sshfile);
            sshfile = f.getAbsolutePath();
            this.args.setSshfile(sshfile);

            this.print.debugln("Examining '" + sshfile + "'");

            if (!CloudClientUtil.fileExistsAndReadable(sshfile)) {
                throw new ParameterProblem("SSH public key file does not " +
                        "exist or is not readable: '" + sshfile + "'");
            }

            this.print.debugln("Exists and readable: '" + sshfile + "'");
        }

    if (this.args.getKernel() != null) {
      final String kernel = this.args.getKernel().trim();
      if (kernel.length() == 0) {
        throw new ParameterProblem("empty kernel string?");
      }

      if (kernel.indexOf('/') >= 0) {
        throw new ParameterProblem("kernel may not contain any /");
      }
      if (kernel.indexOf("..") >= 0) {
        throw new ParameterProblem("kernel may not contain any '..'");
      }

      // already-propagated kernel is implied
      try {
        this.kernelURI = new URI("file://" + kernel);
      } catch (URI.MalformedURIException e) {
        throw new ParameterProblem(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.