Package org.geoserver.wms

Examples of org.geoserver.wms.DescribeLayerRequest


     */
    @SuppressWarnings({ "rawtypes", "unchecked" })
    @Override
    public Object read(Object req, Map kvp, Map rawKvp) throws Exception {

        DescribeLayerRequest request = (DescribeLayerRequest) super.read(req, kvp, rawKvp);
        request.setRawKvp(rawKvp);

        final String version = request.getVersion();
        if (null == version) {
            String code = "NoVersionInfo";
            String simpleName = getClass().getSimpleName();
            throw new ServiceException(
                    "Version parameter not provided for DescribeLayer operation", code, simpleName);
        }

        if (!wms.getVersion().equals(version)) {
            throw new ServiceException("Wrong value for version parameter: " + version
                    + ". This server accetps version " + wms.getVersion(), "InvalidVersion",
                    getClass().getSimpleName());
        }

        List<MapLayerInfo> layers = new MapLayerInfoKvpParser("LAYERS", wms).parse((String) rawKvp.get("LAYERS"));
        request.setLayers(layers);
        if (layers == null || layers.size() == 0) {
            throw new ServiceException("No LAYERS has been requested", "NoLayerRequested",
                    getClass().getName());
        }
        return request;
View Full Code Here


        public void encode(Object o) throws IllegalArgumentException {
            if (!(o instanceof DescribeLayerRequest)) {
                throw new IllegalArgumentException();
            }

            DescribeLayerRequest req = (DescribeLayerRequest) o;

            AttributesImpl versionAtt = new AttributesImpl();
            final String requestVersion = req.getVersion();
            if (requestVersion == null) {
                throw new NullPointerException("requestVersion");
            }

            versionAtt.addAttribute("", "version", "version", "", requestVersion);
View Full Code Here

        Assert.isTrue(value instanceof DescribeLayerTransformer);
        Assert.notNull(operation.getParameters());
        Assert.isTrue(operation.getParameters()[0] instanceof DescribeLayerRequest);

        DescribeLayerTransformer transformer = (DescribeLayerTransformer) value;
        DescribeLayerRequest request = (DescribeLayerRequest) operation.getParameters()[0];
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        try {
            transformer.transform(request, out);
            out.flush();
        } catch (TransformerException e) {
View Full Code Here

TOP

Related Classes of org.geoserver.wms.DescribeLayerRequest

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.