public class DefaultHttpBinding extends Object implements HttpBinding
HttpMessage and HttpServletResponse.| Constructor and Description |
|---|
DefaultHttpBinding()
Deprecated.
|
DefaultHttpBinding(org.apache.camel.spi.HeaderFilterStrategy headerFilterStrategy)
Deprecated.
|
DefaultHttpBinding(HttpEndpoint endpoint) |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
checkChunked(org.apache.camel.Message message,
org.apache.camel.Exchange exchange) |
protected int |
copyStream(InputStream is,
OutputStream os,
int bufferSize) |
protected void |
doWriteDirectResponse(org.apache.camel.Message message,
javax.servlet.http.HttpServletResponse response,
org.apache.camel.Exchange exchange) |
void |
doWriteExceptionResponse(Throwable exception,
javax.servlet.http.HttpServletResponse response)
Strategy method that writes the response to the http response stream when an exception occurred
|
void |
doWriteFaultResponse(org.apache.camel.Message message,
javax.servlet.http.HttpServletResponse response,
org.apache.camel.Exchange exchange)
Strategy method that writes the response to the http response stream for a fault message
|
protected void |
doWriteGZIPResponse(org.apache.camel.Message message,
javax.servlet.http.HttpServletResponse response,
org.apache.camel.Exchange exchange) |
void |
doWriteResponse(org.apache.camel.Message message,
javax.servlet.http.HttpServletResponse response,
org.apache.camel.Exchange exchange)
Strategy method that writes the response to the http response stream for an OUT message
|
org.apache.camel.spi.HeaderFilterStrategy |
getHeaderFilterStrategy()
Gets the header filter strategy
|
protected boolean |
isText(String contentType) |
boolean |
isUseReaderForPayload()
Should reader by used instead of input stream.
|
Object |
parseBody(HttpMessage httpMessage)
Parses the body from a
HttpMessage |
protected void |
populateAttachments(javax.servlet.http.HttpServletRequest request,
HttpMessage message) |
protected void |
populateRequestParameters(javax.servlet.http.HttpServletRequest request,
HttpMessage message) |
void |
readRequest(javax.servlet.http.HttpServletRequest request,
HttpMessage message)
Strategy to read the given request and bindings it to the given message.
|
void |
setHeaderFilterStrategy(org.apache.camel.spi.HeaderFilterStrategy headerFilterStrategy)
Sets the header filter strategy to use.
|
void |
setUseReaderForPayload(boolean useReaderForPayload)
Should the
ServletRequest.getReader() be exposed as the payload of input messages in the Camel
Message.getBody() or not. |
void |
writeResponse(org.apache.camel.Exchange exchange,
javax.servlet.http.HttpServletResponse response)
Writes the exchange to the servlet response.
|
@Deprecated public DefaultHttpBinding()
@Deprecated public DefaultHttpBinding(org.apache.camel.spi.HeaderFilterStrategy headerFilterStrategy)
public DefaultHttpBinding(HttpEndpoint endpoint)
public void readRequest(javax.servlet.http.HttpServletRequest request,
HttpMessage message)
HttpBindingreadRequest in interface HttpBindingrequest - the requestmessage - the message to populate with data from requestprotected void populateRequestParameters(javax.servlet.http.HttpServletRequest request,
HttpMessage message)
throws Exception
Exceptionprotected void populateAttachments(javax.servlet.http.HttpServletRequest request,
HttpMessage message)
public void writeResponse(org.apache.camel.Exchange exchange,
javax.servlet.http.HttpServletResponse response)
throws IOException
HttpBindingwriteResponse in interface HttpBindingexchange - the exchangeresponse - the http responseIOException - can be thrown from http responsepublic void doWriteExceptionResponse(Throwable exception, javax.servlet.http.HttpServletResponse response) throws IOException
HttpBindingdoWriteExceptionResponse in interface HttpBindingexception - the exception occurredresponse - the http responseIOException - can be thrown from http responsepublic void doWriteFaultResponse(org.apache.camel.Message message,
javax.servlet.http.HttpServletResponse response,
org.apache.camel.Exchange exchange)
throws IOException
HttpBindingdoWriteFaultResponse in interface HttpBindingmessage - the fault messageresponse - the http responseexchange - the exchange to provide context for header filteringIOException - can be thrown from http responsepublic void doWriteResponse(org.apache.camel.Message message,
javax.servlet.http.HttpServletResponse response,
org.apache.camel.Exchange exchange)
throws IOException
HttpBindingdoWriteResponse in interface HttpBindingmessage - the OUT messageresponse - the http responseexchange - the exchange to provide context for header filteringIOException - can be thrown from http responseprotected boolean isText(String contentType)
protected int copyStream(InputStream is, OutputStream os, int bufferSize) throws IOException
IOExceptionprotected void doWriteDirectResponse(org.apache.camel.Message message,
javax.servlet.http.HttpServletResponse response,
org.apache.camel.Exchange exchange)
throws IOException
IOExceptionprotected boolean checkChunked(org.apache.camel.Message message,
org.apache.camel.Exchange exchange)
protected void doWriteGZIPResponse(org.apache.camel.Message message,
javax.servlet.http.HttpServletResponse response,
org.apache.camel.Exchange exchange)
throws IOException
IOExceptionpublic Object parseBody(HttpMessage httpMessage) throws IOException
HttpBindingHttpMessageparseBody in interface HttpBindinghttpMessage - the http messageInputStream or a Reader
depending on the HttpBinding.setUseReaderForPayload(boolean) property.IOException - can be thrownpublic boolean isUseReaderForPayload()
HttpBindingisUseReaderForPayload in interface HttpBindingfor more detailspublic void setUseReaderForPayload(boolean useReaderForPayload)
HttpBindingServletRequest.getReader() be exposed as the payload of input messages in the Camel
Message.getBody() or not. If false then the ServletRequest.getInputStream() will be exposed.
Is default false.setUseReaderForPayload in interface HttpBindinguseReaderForPayload - whether to use reader or notpublic org.apache.camel.spi.HeaderFilterStrategy getHeaderFilterStrategy()
HttpBindinggetHeaderFilterStrategy in interface HttpBindingpublic void setHeaderFilterStrategy(org.apache.camel.spi.HeaderFilterStrategy headerFilterStrategy)
HttpBindingHttpHeaderFilterStrategysetHeaderFilterStrategy in interface HttpBindingheaderFilterStrategy - the custom strategyApache Camel