Package org.apache.camel.component.jetty
Interface JettyHttpBinding
-
public interface JettyHttpBindingJetty specific binding to parse the request/response from Jetty and Camel.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description org.apache.camel.spi.HeaderFilterStrategygetHeaderFilterStrategy()Gets the header filter strategyStringgetOkStatusCodeRange()The status codes which are considered a success response.booleanisAllowJavaSerializedObject()Whether to allow java serialization when a request uses context-type=application/x-java-serialized-objectbooleanisThrowExceptionOnFailure()Whether to throwHttpOperationFailedExceptionin case of response code != 200.booleanisTransferException()Whether to transfer exception back as a serialized java object if processing failed due to an exceptionvoidpopulateResponse(org.apache.camel.Exchange exchange, JettyContentExchange httpExchange)Parses the response from the Jetty client.voidsetAllowJavaSerializedObject(boolean allowJavaSerializedObject)Whether to allow java serialization when a request uses context-type=application/x-java-serialized-objectvoidsetHeaderFilterStrategy(org.apache.camel.spi.HeaderFilterStrategy headerFilterStrategy)Sets the header filter strategy to use.voidsetOkStatusCodeRange(String okStatusCodeRange)The status codes which are considered a success response.voidsetThrowExceptionOnFailure(boolean throwExceptionOnFailure)Whether to throwHttpOperationFailedExceptionin case of response code != 200.voidsetTransferException(boolean transferException)Whether to transfer exception back as a serialized java object if processing failed due to an exception
-
-
-
Method Detail
-
populateResponse
void populateResponse(org.apache.camel.Exchange exchange, JettyContentExchange httpExchange) throws ExceptionParses the response from the Jetty client.- Parameters:
exchange- the Exchange which to populate with the responsehttpExchange- the response from the Jetty client- Throws:
Exception- is thrown if error parsing response
-
getHeaderFilterStrategy
org.apache.camel.spi.HeaderFilterStrategy getHeaderFilterStrategy()
Gets the header filter strategy- Returns:
- the strategy
-
setHeaderFilterStrategy
void setHeaderFilterStrategy(org.apache.camel.spi.HeaderFilterStrategy headerFilterStrategy)
Sets the header filter strategy to use. Will default useHttpHeaderFilterStrategy- Parameters:
headerFilterStrategy- the custom strategy
-
setThrowExceptionOnFailure
void setThrowExceptionOnFailure(boolean throwExceptionOnFailure)
Whether to throwHttpOperationFailedExceptionin case of response code != 200.- Parameters:
throwExceptionOnFailure- true to throw exception
-
isThrowExceptionOnFailure
boolean isThrowExceptionOnFailure()
Whether to throwHttpOperationFailedExceptionin case of response code != 200.- Returns:
- true to throw exception
-
setTransferException
void setTransferException(boolean transferException)
Whether to transfer exception back as a serialized java object if processing failed due to an exception This is by default turned off. If you enable this then be aware that Java will deserialize the incoming data from the request to Java and that can be a potential security risk.- Parameters:
transferException- true to transfer exception
-
isTransferException
boolean isTransferException()
Whether to transfer exception back as a serialized java object if processing failed due to an exception This is by default turned off. If you enable this then be aware that Java will deserialize the incoming data from the request to Java and that can be a potential security risk.- Returns:
- true to transfer exception
-
setAllowJavaSerializedObject
void setAllowJavaSerializedObject(boolean allowJavaSerializedObject)
Whether to allow java serialization when a request uses context-type=application/x-java-serialized-object This is by default turned off. If you enable this then be aware that Java will deserialize the incoming data from the request to Java and that can be a potential security risk.- Parameters:
allowJavaSerializedObject- true to allow serializing java objects
-
isAllowJavaSerializedObject
boolean isAllowJavaSerializedObject()
Whether to allow java serialization when a request uses context-type=application/x-java-serialized-object This is by default turned off. If you enable this then be aware that Java will deserialize the incoming data from the request to Java and that can be a potential security risk.
-
getOkStatusCodeRange
String getOkStatusCodeRange()
The status codes which are considered a success response. The values are inclusive. Multiple ranges can be defined, separated by comma, e.g. 200-204,209,301-304. Each range must be a single number or from-to with the dash included. The default range is 200-299
-
setOkStatusCodeRange
void setOkStatusCodeRange(String okStatusCodeRange)
The status codes which are considered a success response. The values are inclusive. Multiple ranges can be defined, separated by comma, e.g. 200-204,209,301-304. Each range must be a single number or from-to with the dash included. The default range is 200-299
-
-