Package org.geotools.util

Examples of org.geotools.util.Version


import javax.xml.parsers.DocumentBuilderFactory;


public class MessageXmlParser extends XmlRequestReader {
    public MessageXmlParser() {
        super(new QName(null, "Hello"), new Version("1.0.0"), "hello");
    }
View Full Code Here


    private WFSVConfiguration configuration;

    public WfsvXmlReader(String element, GeoServer gs, WFSVConfiguration configuration) {
        super(new QName(org.geoserver.wfsv.xml.v1_1_0.WFSV.NAMESPACE, element),
                new Version("1.1.0"), "wfsv");
        this.wfs = gs.getService( WFSInfo.class );
        this.configuration = configuration;
    }
View Full Code Here

    public WfsXmlReader(String element, GeoServer gs, Configuration configuration) {
        this(element, gs, configuration, "wfs");
    }
   
    protected WfsXmlReader(String element, GeoServer gs, Configuration configuration, String serviceId) {
        super(new QName(org.geoserver.wfs.xml.v1_1_0.WFS.NAMESPACE, element), new Version("1.1.0"),
            serviceId);
        this.wfs = gs.getService( WFSInfo.class );
        this.catalog = gs.getCatalog();
        this.configuration = configuration;
    }
View Full Code Here

     */
    public static String getVersionPreOws(List<String> providedList, List<String> acceptedList) {
        //first figure out which versions are provided
        TreeSet<Version> provided = new TreeSet<Version>();
        for (String v : providedList) {
            provided.add(new Version(v));
        }
       
        // if no accept list provided, we return the biggest
        if(acceptedList == null || acceptedList.isEmpty())
            return provided.last().toString();
   
        //next figure out what the client accepts (and check they are good version numbers)
        TreeSet<Version> accepted = new TreeSet<Version>();
        for (String v : acceptedList) {
            checkVersionNumber(v, null);
           
            accepted.add(new Version(v));
        }
   
        // prune out those not provided
        for (Iterator<Version> v = accepted.iterator(); v.hasNext();) {
            Version version = (Version) v.next();
   
            if (!provided.contains(version)) {
                v.remove();
            }
        }
   
        // lookup a matching version
        String version = null;
        if (!accepted.isEmpty()) {
            //return the highest version provided
            version = ((Version) accepted.last()).toString();
        } else {
            for (String v : acceptedList) {
                accepted.add(new Version(v));
            }
   
            //if highest accepted less then lowest provided, send lowest
            if ((accepted.last()).compareTo(provided.first()) < 0) {
                version = (provided.first()).toString();
            }
   
            //if lowest accepted is greater then highest provided, send highest
            if ((accepted.first()).compareTo(provided.last()) > 0) {
                version = (provided.last()).toString();
            }
   
            if (version == null) {
                //go through from lowest to highest, and return highest provided
                // that is less than the highest accepted
                Iterator<Version> v = provided.iterator();
                Version last = v.next();
   
                for (; v.hasNext();) {
                    Version current = v.next();
   
                    if (current.compareTo(accepted.last()) > 0) {
                        break;
                    }
   
                    last = current;
                }
View Full Code Here

     */
    public static String getVersionOws11(List<String> providedList, List<String> acceptedList) {
        //first figure out which versions are provided
        TreeSet<Version> provided = new TreeSet<Version>();
        for (String v : providedList) {
            provided.add(new Version(v));
        }
       
        // if no accept list provided, we return the biggest supported version
        if(acceptedList == null || acceptedList.isEmpty())
            return provided.last().toString();
           
   
        // next figure out what the client accepts (and check they are good version numbers)
        List<Version> accepted = new ArrayList<Version>();
        for (String v : acceptedList) {
            checkVersionNumber(v, "AcceptVersions");
           
            accepted.add(new Version(v));
        }
   
        // from the specification "The server, upon receiving a GetCapabilities request, shall scan
        // through this list and find the first version number that it supports"
        Version negotiated = null;
        for (Iterator<Version> v = accepted.iterator(); v.hasNext();) {
            Version version = (Version) v.next();
   
            if (provided.contains(version)) {
                negotiated = version;
                break;
            }
View Full Code Here

    public void write(Object value, OutputStream output, Operation operation)
        throws IOException, ServiceException {
        TransactionResponseType response = (TransactionResponseType) value;

        if (new Version("1.0.0").equals(operation.getService().getVersion())) {
            v_1_0(response, output, operation);
        } else {
            v_1_1(response, output, operation);
        }
    }
View Full Code Here

    private WFSVConfiguration configuration;

    public WfsvXmlReader(String element, GeoServer gs, WFSVConfiguration configuration) {
        super(new QName(org.geoserver.wfsv.xml.v1_1_0.WFSV.NAMESPACE, element),
                new Version("1.0.0"), "wfsv");
        this.wfs = gs.getService( WFSInfo.class );
        this.configuration = configuration;
    }
View Full Code Here

                LOGGER.info( "Processed layer group '" + bm.getName() + "'" );
                catalog.add( bm );
            }
        }
       
        wms.getVersions().add( new Version( "1.1.1" ) );
        return wms;
    }
View Full Code Here

    }
   
    @Override
    protected WMSInfo initialize(WMSInfo service) {
        if ( service.getVersions().isEmpty() ) {
            service.getVersions().add( new Version( "1.1.1" ) );
        }
        if(service.getSRS() == null) {
            ((WMSInfoImpl)service).setSRS( new ArrayList<String>() );
        }
        return service;
View Full Code Here

                s.setFilename(base + ".yaml");
            }
         }

        s.setFormat(YsldHandler.FORMAT);
        s.setFormatVersion(new Version("1.0.0"));

        // write out the resource
        OutputStream output = dataDir().style(s).out();
        try {
            try {
View Full Code Here

TOP

Related Classes of org.geotools.util.Version

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.