All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.geotools.data.ows.Request Maven / Gradle / Ivy

Go to download

The main module contains the GeoTools public interfaces that are used by other GeoTools modules (and GeoTools applications). Where possible we make use industry standard terms as provided by OGC and ISO standards. The formal GeoTools public api consists of gt-metadata, jts and the gt-main module. The main module contains the default implementations that are available provided to other GeoTools modules using our factory system. Factories are obtained from an appropriate FactoryFinder, giving applications a chance configure the factory used using the Factory Hints facilities. FilterFactory ff = CommonFactoryFinder.getFilterFactory(); Expression expr = ff.add( expression1, expression2 ); If you find yourself using implementation specific classes chances are you doing it wrong: Expression expr = new AddImpl( expression1, expressiom2 );

The newest version!
/*
 *    GeoTools - The Open Source Java GIS Toolkit
 *    http://geotools.org
 *
 *    (C) 2004-2008, Open Source Geospatial Foundation (OSGeo)
 *
 *    This library is free software; you can redistribute it and/or
 *    modify it under the terms of the GNU Lesser General Public
 *    License as published by the Free Software Foundation;
 *    version 2.1 of the License.
 *
 *    This library is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 *    Lesser General Public License for more details.
 */
package org.geotools.data.ows;

import java.io.IOException;
import java.io.OutputStream;
import java.net.URL;
import java.util.Collections;
import java.util.Map;
import java.util.Properties;
import org.geotools.ows.ServiceException;

/**
 * This represents a Request to be made against a Open Web Service.
 *
 * @author rgould
 */
public interface Request {

    /** Represents the REQUEST parameter */
    public static final String REQUEST = "REQUEST"; // $NON-NLS-1$
    /** Represents the VERSION parameter */
    public static final String VERSION = "VERSION"; // $NON-NLS-1$
    /** Represents the WMTVER parameter */
    public static final String WMTVER = "WMTVER"; // $NON-NLS-1$

    public static final String SERVICE = "SERVICE";

    /**
     * Once the properties of the request are configured, this will return the URL that points to
     * the server and contains all of the appropriate name/value parameters.
     *
     * @return a URL that can be used to issue the request
     */
    public URL getFinalURL();

    /**
     * Sets the name/value property for this request.
     *
     * 

Note that when using this method, it is up to the programmer to provide their own encoding * of value according to the OWS specifications! The code will not do this for you. * *

Different OWS specifications define different ways to do this. There are notorious * differences between WMS 1.1.1 (section 6.2.1) and WMS 1.3.0 (section 6.3.2) for example. * *

If value is null, "name" is removed from the properties table. * * @param name the name of the property * @param value the value of the property */ public void setProperty(String name, String value); /** @return a copy of this request's properties */ public Properties getProperties(); /** * Each Request must know how to create it's counterpart Response. Given the content type and * input stream (containin the response data), this method must return an appropriate Response * object. */ Response createResponse(HTTPResponse response) throws ServiceException, IOException; /** * This method indicates whether this request needs to transmit some data to the server using * POST. If this returns true, performPostOutput() will be called during the connection, * allowing the data to be written out to the server. * * @return true if this request needs POST support, false otherwise. */ boolean requiresPost(); /** * If this request uses POST, it must specify the content type of the data that is to be written * out during performPostOutput(). * *

For open web services, this is usually "application/xml". * * @return the MIME type of the data to be sent during the request */ String getPostContentType(); /** * This is called during the connection to the server, allowing this request to write out data * to the server by using the provided outputStream. * *

Implementors of this method do not need to call outputStream.flush() or * outputStream.close(). The framework will call them immediately after calling this method. */ void performPostOutput(OutputStream outputStream) throws IOException; /** Sets hints that might be driving how the request is performed */ default void setRequestHints(Map hints) { // nothing to do } /** Returns the request hints */ default Map getRequestHints() { return Collections.emptyMap(); } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy