|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.camel.component.http4.DefaultHttpBinding
public class DefaultHttpBinding
Binding between HttpMessage
and HttpServletResponse
.
Constructor Summary | |
---|---|
DefaultHttpBinding()
Deprecated. |
|
DefaultHttpBinding(org.apache.camel.spi.HeaderFilterStrategy headerFilterStrategy)
Deprecated. |
|
DefaultHttpBinding(HttpEndpoint endpoint)
|
Method Summary | |
---|---|
protected boolean |
checkChunked(org.apache.camel.Message message,
org.apache.camel.Exchange exchange)
|
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 |
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
@Deprecated public DefaultHttpBinding()
@Deprecated public DefaultHttpBinding(org.apache.camel.spi.HeaderFilterStrategy headerFilterStrategy)
public DefaultHttpBinding(HttpEndpoint endpoint)
Method Detail |
---|
public void readRequest(javax.servlet.http.HttpServletRequest request, HttpMessage message)
HttpBinding
readRequest
in interface HttpBinding
request
- the requestmessage
- the message to populate with data from requestprotected void populateRequestParameters(javax.servlet.http.HttpServletRequest request, HttpMessage message) throws Exception
Exception
protected void populateAttachments(javax.servlet.http.HttpServletRequest request, HttpMessage message)
public void writeResponse(org.apache.camel.Exchange exchange, javax.servlet.http.HttpServletResponse response) throws IOException
HttpBinding
writeResponse
in interface HttpBinding
exchange
- the exchangeresponse
- the http response
IOException
- can be thrown from http responsepublic void doWriteExceptionResponse(Throwable exception, javax.servlet.http.HttpServletResponse response) throws IOException
HttpBinding
doWriteExceptionResponse
in interface HttpBinding
exception
- the exception occurredresponse
- the http response
IOException
- 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
HttpBinding
doWriteFaultResponse
in interface HttpBinding
message
- the fault messageresponse
- the http responseexchange
- the exchange to provide context for header filtering
IOException
- 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
HttpBinding
doWriteResponse
in interface HttpBinding
message
- the OUT messageresponse
- the http responseexchange
- the exchange to provide context for header filtering
IOException
- can be thrown from http responseprotected void doWriteDirectResponse(org.apache.camel.Message message, javax.servlet.http.HttpServletResponse response, org.apache.camel.Exchange exchange) throws IOException
IOException
protected 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
IOException
public Object parseBody(HttpMessage httpMessage) throws IOException
HttpBinding
HttpMessage
parseBody
in interface HttpBinding
httpMessage
- the http message
InputStream
or a Reader
depending on the HttpBinding.setUseReaderForPayload(boolean)
property.
IOException
- can be thrownpublic boolean isUseReaderForPayload()
HttpBinding
isUseReaderForPayload
in interface HttpBinding
for more details
public void setUseReaderForPayload(boolean useReaderForPayload)
HttpBinding
ServletRequest.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 HttpBinding
useReaderForPayload
- whether to use reader or notpublic org.apache.camel.spi.HeaderFilterStrategy getHeaderFilterStrategy()
HttpBinding
getHeaderFilterStrategy
in interface HttpBinding
public void setHeaderFilterStrategy(org.apache.camel.spi.HeaderFilterStrategy headerFilterStrategy)
HttpBinding
HttpHeaderFilterStrategy
setHeaderFilterStrategy
in interface HttpBinding
headerFilterStrategy
- the custom strategy
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |