org.geotools.data.wfs.protocol.http
Class AbstractHttpProtocol

Object
  extended by AbstractHttpProtocol
All Implemented Interfaces:
HTTPProtocol
Direct Known Subclasses:
DefaultHTTPProtocol, SimpleHttpProtocol

public abstract class AbstractHttpProtocol
extends Object
implements HTTPProtocol

Base class for HTTPProtocol implementations that provides the basic property accessors and a good implementation for the URL factory helper method createUrl(URL, Map)

Since:
2.6
Author:
Gabriel Roldan (OpenGeo)
Module:
modules/unsupported/wfs (gt-wfs.jar)

Nested Class Summary
 
Nested classes/interfaces inherited from interface HTTPProtocol
HTTPProtocol.POSTCallBack
 
Field Summary
protected  String authPassword
           
protected  String authUsername
           
protected static Logger LOGGER
           
protected  int timeoutMillis
           
 
Constructor Summary
AbstractHttpProtocol()
           
 
Method Summary
protected  String createUri(URL baseUrl, Map<String,String> queryStringKvp)
           
 URL createUrl(URL baseUrl, Map<String,String> queryStringKvp)
          Creates an URL with baseUrl and a query string defined by the kvp key/value pair of parameters.
 int getTimeoutMillis()
          Returns the request timeout in milliseconds, defaults to -1 meaning no timeout
 boolean isTryGzip()
          Returns whether gzip encoding is attempted when interacting with the HTTP server; default is false
 void setAuth(String username, String password)
          Sets the HTTP authentication realms (not required/used so far, but intended to be)
 void setTimeoutMillis(int milliseconds)
          Sets the request timeout in milliseconds.
 void setTryGzip(boolean tryGzip)
          Sets whether the server should be asked to return responses encoded in GZIP.
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface HTTPProtocol
issueGet, issuePost
 

Field Detail

LOGGER

protected static final Logger LOGGER

authUsername

protected String authUsername

authPassword

protected String authPassword

timeoutMillis

protected int timeoutMillis
Constructor Detail

AbstractHttpProtocol

public AbstractHttpProtocol()
Method Detail

isTryGzip

public boolean isTryGzip()
Description copied from interface: HTTPProtocol
Returns whether gzip encoding is attempted when interacting with the HTTP server; default is false

Specified by:
isTryGzip in interface HTTPProtocol
Returns:
true if gzip is being attempted.
See Also:
HTTPProtocol.isTryGzip()

setTryGzip

public void setTryGzip(boolean tryGzip)
Description copied from interface: HTTPProtocol
Sets whether the server should be asked to return responses encoded in GZIP.

Specified by:
setTryGzip in interface HTTPProtocol
Parameters:
tryGzip - true to ask the server to encode responses in GZIP.
See Also:
HTTPProtocol.setTryGzip(boolean)

setAuth

public void setAuth(String username,
                    String password)
Description copied from interface: HTTPProtocol
Sets the HTTP authentication realms (not required/used so far, but intended to be)

Specified by:
setAuth in interface HTTPProtocol
See Also:
HTTPProtocol.setAuth(String, String)

getTimeoutMillis

public int getTimeoutMillis()
Description copied from interface: HTTPProtocol
Returns the request timeout in milliseconds, defaults to -1 meaning no timeout

Specified by:
getTimeoutMillis in interface HTTPProtocol
Returns:
See Also:
HTTPProtocol#

setTimeoutMillis

public void setTimeoutMillis(int milliseconds)
Description copied from interface: HTTPProtocol
Sets the request timeout in milliseconds.

Specified by:
setTimeoutMillis in interface HTTPProtocol
See Also:
HTTPProtocol.setTimeoutMillis(int)

createUrl

public URL createUrl(URL baseUrl,
                     Map<String,String> queryStringKvp)
              throws MalformedURLException
Description copied from interface: HTTPProtocol
Creates an URL with baseUrl and a query string defined by the kvp key/value pair of parameters.

If the base url query is not empty and already contains a parameter named as one of the parameters in kvp, the original parameter value in the baseUrl query is overriden by the one in the kvp map. For this purpose, the parameter name matching comparison is made case insensitively.

Specified by:
createUrl in interface HTTPProtocol
Parameters:
baseUrl - the original URL to create the new one from
Returns:
the new URL with baseUrl and the query string from queryStringKvp
Throws:
MalformedURLException - if the resulting URL is not valid
See Also:
HTTPProtocol.createUrl(URL, Map)

createUri

protected String createUri(URL baseUrl,
                           Map<String,String> queryStringKvp)


Copyright © 1996-2009 Geotools. All Rights Reserved.