|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface HttpBinding
A plugable strategy for configuring the http binding so reading request and writing response can be customized using the Java Servlet API.
This is also used by the camel-jetty by the JettyHttpConsumer.
Method Summary | |
---|---|
void |
doWriteExceptionResponse(Throwable exception,
HttpServletResponse response)
Strategy method that writes the response to the http response stream when an exception occurred |
void |
doWriteFaultResponse(Message message,
HttpServletResponse response,
Exchange exchange)
Strategy method that writes the response to the http response stream for a fault message |
void |
doWriteResponse(Message message,
HttpServletResponse response,
Exchange exchange)
Strategy method that writes the response to the http response stream for an OUT message |
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 |
void |
readRequest(HttpServletRequest request,
HttpMessage message)
Strategy to read the given request and bindings it to the given message. |
void |
setHeaderFilterStrategy(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(Exchange exchange,
HttpServletResponse response)
Writes the exchange to the servlet response. |
Method Detail |
---|
void readRequest(HttpServletRequest request, HttpMessage message)
request
- the requestmessage
- the message to populate with data from requestObject parseBody(HttpMessage httpMessage) throws IOException
HttpMessage
httpMessage
- the http message
InputStream
or a Reader
depending on the setUseReaderForPayload(boolean)
property.
IOException
- can be thrownvoid writeResponse(Exchange exchange, HttpServletResponse response) throws IOException
exchange
- the exchangeresponse
- the http response
IOException
- can be thrown from http responsevoid doWriteExceptionResponse(Throwable exception, HttpServletResponse response) throws IOException
exception
- the exception occurredresponse
- the http response
IOException
- can be thrown from http responsevoid doWriteFaultResponse(Message message, HttpServletResponse response, Exchange exchange) throws IOException
message
- the fault messageresponse
- the http responseexchange
- the exchange to provide context for header filtering
IOException
- can be thrown from http responsevoid doWriteResponse(Message message, HttpServletResponse response, Exchange exchange) throws IOException
message
- the OUT messageresponse
- the http responseexchange
- the exchange to provide context for header filtering
IOException
- can be thrown from http responseboolean isUseReaderForPayload()
for more details
void setUseReaderForPayload(boolean useReaderForPayload)
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.
useReaderForPayload
- whether to use reader or notHeaderFilterStrategy getHeaderFilterStrategy()
void setHeaderFilterStrategy(HeaderFilterStrategy headerFilterStrategy)
HttpHeaderFilterStrategy
headerFilterStrategy
- the custom strategy
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |