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

Object
  extended by AbstractHttpProtocol
      extended by DefaultHTTPProtocol
All Implemented Interfaces:
HTTPProtocol

public class DefaultHTTPProtocol
extends AbstractHttpProtocol
implements HTTPProtocol

Default implementation of HTTPProtocol based on apache's common-http-client

Since:
2.6
Author:
Gabriel Roldan (OpenGeo)
Module:

Nested Class Summary
 class DefaultHTTPProtocol.HTTPClientResponse
          An HTTPResponse wrapping an executed GetMethod or PostMethod from the apache commons-httpclient package
 
Nested classes/interfaces inherited from interface HTTPProtocol
HTTPProtocol.POSTCallBack
 
Field Summary
 
Fields inherited from class AbstractHttpProtocol
authPassword, authUsername, LOGGER, timeoutMillis
 
Constructor Summary
DefaultHTTPProtocol()
           
 
Method Summary
 HTTPResponse issueGet(URL baseUrl, Map<String,String> kvp)
          Issues an HTTP request over the baseUrl with a query string defined by the kvp key/value pair of parameters.
 HTTPResponse issuePost(URL targetUrl, HTTPProtocol.POSTCallBack callback)
           
 
Methods inherited from class AbstractHttpProtocol
createUri, createUrl, getTimeoutMillis, isTryGzip, setAuth, setTimeoutMillis, setTryGzip
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface HTTPProtocol
createUrl, getTimeoutMillis, isTryGzip, setAuth, setTimeoutMillis, setTryGzip
 

Constructor Detail

DefaultHTTPProtocol

public DefaultHTTPProtocol()
Method Detail

issuePost

public HTTPResponse issuePost(URL targetUrl,
                              HTTPProtocol.POSTCallBack callback)
                       throws IOException
Specified by:
issuePost in interface HTTPProtocol
Throws:
IOException

issueGet

public HTTPResponse issueGet(URL baseUrl,
                             Map<String,String> kvp)
                      throws IOException
Description copied from interface: HTTPProtocol
Issues an HTTP request over the baseUrl with 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:
issueGet in interface HTTPProtocol
Parameters:
baseUrl - the URL where to fetch the contents from
kvp - the set of key/value pairs to create the actual URL query string, may be empty
Returns:
the server response of issuing the HTTP request through GET method
Throws:
IOException - if a communication error of some sort occurs
See Also:
HTTPProtocol.createUrl(URL, Map)


Copyright © 1996-2010 Geotools. All Rights Reserved.