Package org.apache.axis.types

Examples of org.apache.axis.types.URI$MalformedURIException


   
    private static Object toURI(Object value) throws PageException {
        if(value instanceof URI) return value;
        if(value instanceof java.net.URI) return value;
        try {
            return new URI(Caster.toString(value));
        } catch (MalformedURIException e) {
            throw Caster.toPageException(e);
        }
    }
View Full Code Here


        }

        final _CreateRequest req = this.repr._newCreateRequest();
        final VirtualWorkspace_Type vw = wsreq.getMetadata();
       
        final URI name = vw.getName();
        if (name != null) {
            req.setName(name.toString());
        }

        // -------------------------------------------------------------
        // Weed out the needed items:
        // -------------------------------------------------------------
View Full Code Here

        }

        this.postRequest = new PostShutdown_Type();

        try {
            final URI uri = new URI(this.args.saveTarget);
            this.postRequest.setRootPartitionUnpropagationTarget(uri);
        } catch (URI.MalformedURIException e) {
            final String err = "Save target override is not a valid URI: '" +
                    this.args.saveTarget + "'";
            throw new ParameterProblem(err, e);
View Full Code Here

        }

        this.postShutdownRequest = new PostShutdown_Type();

        try {
            final URI uri = new URI(this.args.saveTarget);
            this.postShutdownRequest.setRootPartitionUnpropagationTarget(uri);
        } catch (URI.MalformedURIException e) {
            final String err = "Save target override is not a valid URI: '" +
                    this.args.saveTarget + "'";
            throw new ParameterProblem(err, e);
View Full Code Here

            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

        }

        this.translateDiskCollection_Type(req, disks);

        if (post != null) {
            final URI unpropTarget = post.getRootPartitionUnpropagationTarget();
            if (unpropTarget != null) {
                final VMFile[] vmFiles = req.getVMFiles();
                if (vmFiles == null) {
                    throw new CannotTranslateException(
                            "expecting files to be translated already");
View Full Code Here

        }

        final Kernel_Type kernel = requires.getKernel();
        if (kernel != null) {
            final _Kernel reqKernel = this.repr._newKernel();
            final URI image = kernel.getImage();
            reqKernel.setKernel(this.convertURI(image));
            reqKernel.setParameters(kernel.getParameters());
            req.setRequestedKernel(reqKernel);
        }
    }
View Full Code Here

        file.setRootFile(rootfile);
        file.setBlankSpaceName(null);
        file.setBlankSpaceSize(-1);

        final URI uri = bd.getLocation();
        if (uri == null) {
            throw new CannotTranslateException("a disk is missing location");
        }

        file.setURI(this.convertURI(uri));
View Full Code Here

    }

    private static URI getTopicDialect() {

        try {
            return new URI(WSNConstants.SIMPLE_TOPIC_DIALECT);
        } catch (URI.MalformedURIException e) {
            final String err =
                    "Correct URI constant is missing: " + e.getMessage();
            final String clazz = "WSNConstants";
            final String key = "SIMPLE_TOPIC_DIALECT";
View Full Code Here

        ShutdownMechanism_Type shutdownMechanism = null;
        if (this.args.trashAtShutdown) {
            shutdownMechanism = ShutdownMechanism_Type.Trash;
        }

        URI newPropagationTargetURI = null;
        try {
            if (this.args.saveTarget != null) {
                newPropagationTargetURI = new URI(this.args.saveTarget);
            }
        } catch (Exception e) {
            throw new ParameterProblem("Problem with save-target '" +
                    this.args.saveTarget + "': " + e.getMessage(), e);
        }

        if (this.dep == null) {

            boolean end = false;
           
            String err = name() + " requires a deployment request.  This " +
                    "can be specified by file or by a number of arguments." +
                    "  Problem encountered is that a file request is not " +
                    "configured and expected commandline arguments are " +
                    "missing: ";

            if (deployDuration < 1 && memoryRequest < 1) {
                end = true;
                err += "duration and memory request.";
            } else if (memoryRequest < 1) {
                end = true;
                err += "memory request.";
            } else if (deployDuration < 1) {
                end = true;
                err += "duration.";
            }

            if (end) {
                throw new ParameterProblem(err);
            }

            // default is 1
            if (numNodes < 1) {
                numNodes = 1;
            }

            // default is Running
            if (requestState == null) {
                requestState = InitialState_Type.Running;
            }

            // shutdownMechanism has no default except 'not set' which
            // triggers 'normal'

            this.dep = WSUtils.constructDeploymentType(deployDuration,
                                                       memoryRequest,
                                                       numNodes,
                                                       requestState,
                                                       shutdownMechanism,
                                                       newPropagationTargetURI);

            if (this.pr.enabled()) {
                final String msg =
                        "Created deployment request soley from arguments.";
                if (this.pr.useThis()) {
                    this.pr.infoln(
                            PrCodes.DEPREQ__USING_ARGS, msg);
                } else if (this.pr.useLogging()) {
                    logger.info(msg);
                }
            }

        } else {

            if (deployDuration > 0) {
                if (this.pr.enabled()) {
                    final String msg =
                        "Duration argument provided: overriding duration " +
                        "found in deployment request file, it is now: " +
                        deployDuration + " minutes";

                    final String dbg;
                    try {
                        final int oldMins = CommonUtil.durationToMinutes(
                                this.dep.getDeploymentTime().getMinDuration());
                        dbg = "Old duration: " + oldMins + " minutes";
                    } catch (InvalidDurationException e) {
                        throw new ParameterProblem(e.getMessage(), e);
                    }

                    if (this.pr.useThis()) {
                        this.pr.infoln(
                            PrCodes.DEPREQ__FILE_OVERRIDE, msg);
                        this.pr.dbg(dbg);
                    } else if (this.pr.useLogging()) {
                        logger.info(msg);
                        logger.debug(dbg);
                    }
                }
                this.dep.setDeploymentTime(
                        WSUtils.constructDeploymentTime_Type(deployDuration));
            }

            if (memoryRequest > 0) {
                if (this.pr.enabled()) {
                    final String msg =
                        "Memory argument provided: overriding memory " +
                        "found in deployment request file, it is now: " +
                        memoryRequest + " MB";

                    if (this.pr.useThis()) {
                        this.pr.infoln(
                            PrCodes.DEPREQ__FILE_OVERRIDE, msg);
                    } else if (this.pr.useLogging()) {
                        logger.info(msg);
                    }
                }

                WSUtils.setMemory(memoryRequest,
                                  this.dep.getResourceAllocation());
            }

            if (numNodes > 0) {
                if (this.pr.enabled()) {
                    final String msg =
                        "Num-nodes argument provided: overriding number " +
                        "found in deployment request file, it is now: " +
                        numNodes + " nodes";

                    final String dbg = "Old num-nodes: " +
                                this.dep.getNodeNumber();

                    if (this.pr.useThis()) {
                        this.pr.infoln(
                            PrCodes.DEPREQ__FILE_OVERRIDE, msg);
                        this.pr.dbg(dbg);
                    } else if (this.pr.useLogging()) {
                        logger.info(msg);
                        logger.debug(dbg);
                    }
                }

                this.dep.setNodeNumber(numNodes);
            }

            if (requestState != null) {

                if (this.pr.enabled()) {
                    final String msg =
                        "Initial state argument provided: overriding " +
                        "initial state setting found in deployment request " +
                        "file, it is now: " + requestState.getValue();

                    final String dbg = "Old state: " +
                                this.dep.getInitialState().getValue();

                    if (this.pr.useThis()) {
                        this.pr.infoln(
                            PrCodes.DEPREQ__FILE_OVERRIDE, msg);
                        this.pr.dbg(dbg);
                    } else if (this.pr.useLogging()) {
                        logger.info(msg);
                        logger.debug(dbg);
                    }
                }

                this.dep.setInitialState(requestState);
            }

            if (shutdownMechanism != null) {

                if (this.pr.enabled()) {

                    boolean presentInFile = false;
                    String dbg = "No setting in file for shutdown mechanism";
                    if (this.dep.getShutdownMechanism() != null) {
                        presentInFile = true;
                        dbg = "Old shutdown mechanism: " +
                            this.dep.getShutdownMechanism().getValue();
                    }

                    final String msg;
                    if (presentInFile) {
                        msg = "Shutdown mechanism argument provided: " +
                               "overriding shutdown mechanism setting found " +
                               "in deployment request file, it is now: " +
                               requestState.getValue();
                    } else {
                        msg = "Setting shutdown mechanism to: " +
                               requestState.getValue();
                    }

                    if (this.pr.useThis()) {
                        this.pr.infoln(
                            PrCodes.DEPREQ__FILE_OVERRIDE, msg);
                        this.pr.dbg(dbg);
                    } else if (this.pr.useLogging()) {
                        logger.info(msg);
                        logger.debug(dbg);
                    }
                }

                this.dep.setShutdownMechanism(shutdownMechanism);
            }

            if (newPropagationTargetURI != null) {

                if (this.pr.enabled()) {

                    boolean presentInFile = false;
                    String dbg = "No setting in file for alternate " +
                            "propagation target";
                   
                    if (this.dep.getPostShutdown() != null) {

                        if (this.dep.getPostShutdown().
                                getRootPartitionUnpropagationTarget() != null) {

                            presentInFile = true;
                            dbg = "Old alternate propagation target: " +
                                    this.dep.getPostShutdown().
                                        getRootPartitionUnpropagationTarget().toString();
                        }
                    }

                    final String msg;
                    if (presentInFile) {
                        msg = "Alternate propagation target argument provided: " +
                               "overriding the setting found " +
                               "in deployment request file, it is now '" +
                               newPropagationTargetURI.toString() + "'";
                    } else {
                        msg = "Setting alternate propagation target to '" +
                               newPropagationTargetURI.toString() + "'";
                    }

                    if (this.pr.useThis()) {
                        this.pr.infoln(
                            PrCodes.DEPREQ__FILE_OVERRIDE, msg);
View Full Code Here

TOP

Related Classes of org.apache.axis.types.URI$MalformedURIException

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.