Package org.globus.workspace.client_core

Examples of org.globus.workspace.client_core.ParameterProblem


    }

    private void validateArgs() throws ParameterProblem {

        if (this.ctxRetrieve == null) {
            throw new ParameterProblem("expected that Ctx_Retrieve object " +
                    "would be set up before this method was called");
        }

        if (this.args.clusterForImpersonationPath == null) {
            throw new ParameterProblem("missing path to cluster file to use " +
                    "for ctx agent retrieve operation");
        }

        final AgentDescription_Type args = new AgentDescription_Type();
       
        IdentityProvides_Type[] ids = new IdentityProvides_Type[2];
        ids[0] = this.getFake_0();
        ids[1] = this.getFake_1();
        args.setIdentity(ids);

        final Cloudcluster_Type clusta;
        try {
            clusta = FileUtils.getClusterDocForRetrieve(
                            this.pr, this.args.clusterForImpersonationPath);
        } catch (Exception e) {
            throw new ParameterProblem("Problem reading in the cluster " +
                    "ctx doc: " + e.getMessage(), e);
        }

        args.setCluster(clusta);
        this.ctxRetrieve.setRetrieveSend(args);
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.isGroupRequest = false;
            kind = "an instance";
        } else if (EPRUtils.isGroupEPR(this.epr)) {
            this.isGroupRequest = true;
            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()) {
                this.pr.dbg(dbg);
            } else if (this.pr.useLogging()) {
                logger.debug(dbg);
            }
        }

        if (this.isGroupRequest) {
            throw new ParameterProblem(name() + " can not handle group " +
                    "subscribe yet (only after deploying).  Stay tuned.");
        }
    }
View Full Code Here

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

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

        this.exitState = new State(this.args.exitStateString);
        if (this.pr.enabled()) {
View Full Code Here

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

        if (!State.testValidState(this.args.veryTerseNotifyStateString)) {
            throw new ParameterProblem(
                    "Provided very-terse-notify state string is not a " +
                    "valid state: '" +
                            this.args.veryTerseNotifyStateString + "'");
        }

View Full Code Here

        this.pollDontListen = true;

        try {
            this.pollMS = 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.pollMS < 1) {
            throw new ParameterProblem("Given poll delay is less than 1ms: " +
                    this.pollMS + "ms");
        }
    }
View Full Code Here

        try {
            this.pollMaxThreads =
                    Integer.parseInt(this.args.pollMaxThreadsString);
        } catch (NumberFormatException e) {
            throw new ParameterProblem(
                    "Given poll max-threads number is not valid: '" +
                    this.args.pollMaxThreadsString + "': " + e.getMessage(), e);
        }

        if (this.pollMaxThreads < 1) {
            throw new ParameterProblem("Given poll max-threads is invalid, " +
                    "it is less than 1: " + this.pollMaxThreads);
        }
    }
View Full Code Here

        if (given == null) {
            return// *** EARLY RETURN ***
        }

        if (given.indexOf('/') >= 0) {
            throw new ParameterProblem("Listener override address has a '/' " +
                    "in it, use just a host or IP, not an URL");
        }

        final int splt = given.indexOf(':'); // first occurence only
        final String host;
        final String port;
        if (splt >= 0) {
            host = given.substring(0, splt).trim();
            port = given.substring(splt).trim();
        } else {
            host = given.trim();
            port = null;
        }

        if (host.length() == 0) {
            throw new ParameterProblem("Listener override address " +
                    "has zero-length hostname, given: \"" + given + "\"");
        }

        if (port != null && port.length() == 0) {
            throw new ParameterProblem("Listener override address " +
                    "has zero-length port, given: \"" + given + "\"");
        }

        final String urlString;
        if (port == null) {
            urlString = "http://" + host;
        } else {
            urlString = "http://" + host + ":" + port;
        }

        final String usingHost;
        int usingPort = -1;
        try {
            final URL url = new URL(urlString);
            usingHost = url.getHost();
            if (port != null) {
                usingPort = url.getPort();
            }
        } catch (MalformedURLException e) {
            throw new ParameterProblem("Falied to test validity of listener " +
                    "override address using given input '" + given + "', " +
                    "testing with URL constructed from '" + urlString +
                    "': " + e.getMessage(), e);
        }

View Full Code Here

        try {
            this.listeningSubscriptionMaster.listen(
                this.notificationListenerOverride_IPorHost,
                    this.notificationListenerOverride_Port);
        } catch (IllegalStateException e) {
            throw new ParameterProblem(errPrefix + e.getMessage(), e);
        } catch (IllegalArgumentException e) {
            throw new ParameterProblem(errPrefix + e.getMessage(), e);
        } catch (Exception e) {
            throw new ParameterProblem(errPrefix + e.getMessage(), e);
        }

        this.subscribeLaunch =
                new SubscribeLaunch(this.listeningSubscriptionMaster,
                                    this.nameToPrint,
View Full Code Here

        this.validateData();
    }

    public void validateData() throws ParameterProblem {
        if (this.dataNames == null || this.dataNames.length == 0) {
            throw new ParameterProblem("no data names");
        }

        if (this.dataValues == null || this.dataValues.length == 0) {
            throw new ParameterProblem("no data values");
        }

        for (int i = 0; i < dataNames.length; i++) {
            if (this.dataNames[i] == null || this.dataNames[i].length() == 0) {
                throw new ParameterProblem("missing data name @ idx " + i);
            }
            if (this.dataValues[i] == null) {
                this.dataValues[i] = "";
            }
        }
View Full Code Here

                    WSUtils.initServicePortType(this.endpoint);
            this.stubConf.setOptions((Stub)port);
            this.servicePort = port;
        } catch (Throwable t) {
            final String err = "Problem setting up: " + t.getMessage();
            throw new ParameterProblem(err, t);
        }
    }
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.