org.n52.oxf.util.web
Class HttpClientDecorator

java.lang.Object
  extended by org.n52.oxf.util.web.HttpClientDecorator
All Implemented Interfaces:
HttpClient
Direct Known Subclasses:
BasicAuthenticationHttpClient, GzipEnabledHttpClient, ProxyAwareHttpClient

public abstract class HttpClientDecorator
extends Object
implements HttpClient


Constructor Summary
HttpClientDecorator(HttpClient toDecorate)
           
 
Method Summary
 org.apache.http.HttpResponse executeGet(String uri)
           
 org.apache.http.HttpResponse executeGet(String baseUri, RequestParameters parameters)
           
 org.apache.http.HttpResponse executeMethod(org.apache.http.client.methods.HttpRequestBase method)
           
 org.apache.http.HttpResponse executePost(String uri, org.apache.http.HttpEntity payloadToSend)
          Sends the given payload to the determined URI.
 org.apache.http.HttpResponse executePost(String uri, String payloadToSend, org.apache.http.entity.ContentType contentType)
          Sends the given payload (marked to be of a specific content-type) to the determined URI.
 org.apache.http.HttpResponse executePost(String uri, org.apache.xmlbeans.XmlObject payloadToSend)
          Sends the given payload as content-type text/xml to the determined URI.
 org.apache.http.conn.ClientConnectionManager getConnectionManager()
           
 org.apache.http.impl.client.DefaultHttpClient getHttpClientToDecorate()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HttpClientDecorator

public HttpClientDecorator(HttpClient toDecorate)
Method Detail

getHttpClientToDecorate

public org.apache.http.impl.client.DefaultHttpClient getHttpClientToDecorate()
Specified by:
getHttpClientToDecorate in interface HttpClient

executeGet

public org.apache.http.HttpResponse executeGet(String uri)
                                        throws HttpClientException
Specified by:
executeGet in interface HttpClient
Throws:
HttpClientException

executeGet

public org.apache.http.HttpResponse executeGet(String baseUri,
                                               RequestParameters parameters)
                                        throws HttpClientException
Specified by:
executeGet in interface HttpClient
Parameters:
baseUri - the target to send the GET request to.
parameters - the request/query parameters.
Returns:
the http response returned by the target.
Throws:
HttpClientException - if sending the request fails.

executePost

public org.apache.http.HttpResponse executePost(String uri,
                                                org.apache.xmlbeans.XmlObject payloadToSend)
                                         throws HttpClientException
Description copied from interface: HttpClient
Sends the given payload as content-type text/xml to the determined URI.

Specified by:
executePost in interface HttpClient
Parameters:
uri - the target to send the POST request to.
payloadToSend - the POST payload as XML.
Returns:
the http response returned by the target.
Throws:
HttpClientException - if sending the request fails.

executePost

public org.apache.http.HttpResponse executePost(String uri,
                                                String payloadToSend,
                                                org.apache.http.entity.ContentType contentType)
                                         throws HttpClientException
Description copied from interface: HttpClient
Sends the given payload (marked to be of a specific content-type) to the determined URI.

Specified by:
executePost in interface HttpClient
Parameters:
uri - the target to send the POST request to.
payloadToSend - the POST payload as XML.
contentType - the content-type of the payload.
Returns:
the http responsey returned by the target.
Throws:
HttpClientException - if sending the request fails.

executePost

public org.apache.http.HttpResponse executePost(String uri,
                                                org.apache.http.HttpEntity payloadToSend)
                                         throws HttpClientException
Description copied from interface: HttpClient
Sends the given payload to the determined URI. Refer to the HTTP components docs to get more information which entity types are possible.

Specified by:
executePost in interface HttpClient
Parameters:
uri - the target to send the POST request to.
payloadToSend - a more generic way to send arbitrary content.
Returns:
the http response returned by the target.
Throws:
HttpClientException - if sending the request fails.

executeMethod

public org.apache.http.HttpResponse executeMethod(org.apache.http.client.methods.HttpRequestBase method)
                                           throws HttpClientException
Specified by:
executeMethod in interface HttpClient
Returns:
the http response returned by the target.
Throws:
HttpClientException

getConnectionManager

public org.apache.http.conn.ClientConnectionManager getConnectionManager()


Copyright © 2012-2013 52north.org. All Rights Reserved.