org.springframework.integration.http
Class AbstractHttpRequestExecutor

java.lang.Object
  extended by org.springframework.integration.http.AbstractHttpRequestExecutor
All Implemented Interfaces:
HttpRequestExecutor
Direct Known Subclasses:
CommonsHttpRequestExecutor, SimpleHttpRequestExecutor

public abstract class AbstractHttpRequestExecutor
extends java.lang.Object
implements HttpRequestExecutor

Base class for HttpRequestExecutor implementations.

Since:
1.0.2
Author:
Mark Fisher, Juergen Hoeller

Field Summary
protected static java.lang.String ENCODING_GZIP
           
protected static java.lang.String HTTP_HEADER_ACCEPT_ENCODING
           
protected static java.lang.String HTTP_HEADER_ACCEPT_LANGUAGE
           
protected static java.lang.String HTTP_HEADER_CONTENT_ENCODING
           
protected static java.lang.String HTTP_HEADER_CONTENT_LENGTH
           
protected static java.lang.String HTTP_HEADER_CONTENT_TYPE
           
protected  org.apache.commons.logging.Log logger
           
 
Constructor Summary
AbstractHttpRequestExecutor()
           
 
Method Summary
protected abstract  HttpResponse doExecuteRequest(HttpRequest request)
          Subclasses must implement this method to execute the request.
 HttpResponse executeRequest(HttpRequest request)
          Execute a request to send its content to its target URL.
 boolean isAcceptGzipEncoding()
          Return whether to accept GZIP encoding, that is, whether to send the HTTP "Accept-Encoding" header with "gzip" as its value.
 void setAcceptGzipEncoding(boolean acceptGzipEncoding)
          Set whether to accept GZIP encoding, that is, whether to send the HTTP "Accept-Encoding" header with "gzip" as value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HTTP_HEADER_ACCEPT_LANGUAGE

protected static final java.lang.String HTTP_HEADER_ACCEPT_LANGUAGE
See Also:
Constant Field Values

HTTP_HEADER_ACCEPT_ENCODING

protected static final java.lang.String HTTP_HEADER_ACCEPT_ENCODING
See Also:
Constant Field Values

HTTP_HEADER_CONTENT_ENCODING

protected static final java.lang.String HTTP_HEADER_CONTENT_ENCODING
See Also:
Constant Field Values

HTTP_HEADER_CONTENT_TYPE

protected static final java.lang.String HTTP_HEADER_CONTENT_TYPE
See Also:
Constant Field Values

HTTP_HEADER_CONTENT_LENGTH

protected static final java.lang.String HTTP_HEADER_CONTENT_LENGTH
See Also:
Constant Field Values

ENCODING_GZIP

protected static final java.lang.String ENCODING_GZIP
See Also:
Constant Field Values

logger

protected final org.apache.commons.logging.Log logger
Constructor Detail

AbstractHttpRequestExecutor

public AbstractHttpRequestExecutor()
Method Detail

setAcceptGzipEncoding

public void setAcceptGzipEncoding(boolean acceptGzipEncoding)
Set whether to accept GZIP encoding, that is, whether to send the HTTP "Accept-Encoding" header with "gzip" as value.

Default is "true". Turn this flag off if you do not want GZIP response compression even if enabled on the HTTP server.


isAcceptGzipEncoding

public boolean isAcceptGzipEncoding()
Return whether to accept GZIP encoding, that is, whether to send the HTTP "Accept-Encoding" header with "gzip" as its value.


executeRequest

public final HttpResponse executeRequest(HttpRequest request)
                                  throws java.lang.Exception
Execute a request to send its content to its target URL.

Specified by:
executeRequest in interface HttpRequestExecutor
Parameters:
request - the request to execute
Returns:
the HttpResponse result
Throws:
java.io.IOException - if thrown by I/O operations
java.lang.Exception - in case of general errors

doExecuteRequest

protected abstract HttpResponse doExecuteRequest(HttpRequest request)
                                          throws java.lang.Exception
Subclasses must implement this method to execute the request.

Throws:
java.lang.Exception