Package org.geoserver.wps

Examples of org.geoserver.wps.WPSException


        Double decoded;

        try {
            decoded = Double.valueOf(encoded);
        } catch(NumberFormatException e) {
            throw new WPSException("InvalidParameterType", "Could not convert paramter to object.");
        }

        return decoded;
    }
View Full Code Here


        Object parsed;
        try {
            parsed = parser.parse(reader);
        } catch(Exception e) {
            throw new WPSException("Could not parse XML request.", e);
        }

        if (!parser.getValidationErrors().isEmpty()) {
            WPSException exception = new WPSException("Invalid request", "InvalidParameterValue");

            for(Exception error : (List<Exception>)parser.getValidationErrors()) {
                LOGGER.warning( error.getLocalizedMessage() );
                exception.getExceptionText().add(error.getLocalizedMessage());
            }
        }

        return parsed;
    }
View Full Code Here

            try {
                delegate.encode(xmls);
            } catch (IOException e) {
                throw e;
            } catch (Exception e) {
                throw new WPSException("An error occurred while encoding "
                        + "the results of the process", e);
            }
        } else {
            throw new WPSException("Cannot encode an object of class "
                    + rawResult.getClass() + " in raw form");
        }
    }
View Full Code Here

        Configuration config  = null;

        try {
            config = (Configuration)(this.getXMLConfiguration().getConstructor().newInstance());
        } catch(Exception e) {
            throw new WPSException("NoApplicableCode", "Failed to initialize XMLConfiguration");
        }

        org.geotools.xml.Parser parser = new org.geotools.xml.Parser(config);

        try {
            decoded = (Geometry)parser.parse(stream);
        } catch(Exception e) {
            throw new WPSException("NoApplicableCode", "Parsing error " + e);
        }

        return decoded;
    }
View Full Code Here

     *
     * @param input
     * @return
     */
    public Object encode(Object input) {
        throw new WPSException("NoApplicableCode", "Unimplemented encoder for ComplexTransmuter.");
    }
View Full Code Here

       
        // grab the process, we need it to parse the data inputs
        Name processName = Ows11Util.name(execute.getIdentifier());
        ProcessFactory pf = Processors.createProcessFactory(processName);
        if (pf == null) {
            throw new WPSException("No such process: " + processName);
        }

        // parse inputs
        List<InputType> inputs = parseDataInputs(pf.getParameterInfo(processName), (String) rawKvp.get("DataInputs"));
        DataInputsType1 input1 = factory.createDataInputsType1();
View Full Code Here

            it.setIdentifier(Ows11Util.code(ioParam.id));
            it.setData(factory.createDataType());
           
            Parameter<?> gtParam = inputParams.get(ioParam.id);
            if(gtParam == null) {
                throw new WPSException("Unknown data input named '" + ioParam.id + "'");
            }
            ProcessParameterIO ppio = ProcessParameterIO.findAll(gtParam, applicationContext).get(0);
           
            if(ppio instanceof LiteralPPIO) {
                it.getData().setLiteralData(parseLiteral(it, factory, ioParam));
View Full Code Here

        // start from 1, 0 is the value
        for (int i = 1; i < attributes.length; i++) {
            final String att = attributes[i];
            int idx = att.indexOf("=");
            if(idx == -1) {
                throw new WPSException("Invalid syntax for data input attribute: @" + att);
            }
            if(idx == att.length() - 1) {
                result.put(att.substring(0, idx), null);
            } else {
                result.put(att.substring(0, idx), att.substring(idx + 1, att.length()));
View Full Code Here

                return bbox;
            } else {
                return null;
            }
        } catch(Exception e) {
            throw new WPSException("Failed to parse the bounding box", e);
        }
    }
View Full Code Here

    }

    OutputDefinitionType parseOutputDefinitionType(Map<String, Parameter<?>> outputs, Wps10Factory factory,
            IOParam ioParam, boolean inDocument) {
        if(!outputs.containsKey(ioParam.id)) {
            throw new WPSException("Unknown output " + ioParam.id);
        }
       
        OutputDefinitionType odt;
        if(inDocument) {
            odt = factory.createDocumentOutputDefinitionType();
View Full Code Here

TOP

Related Classes of org.geoserver.wps.WPSException

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.