Interface JettyHttpBinding


  • public interface JettyHttpBinding
    Jetty 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.HeaderFilterStrategy getHeaderFilterStrategy()
      Gets the header filter strategy
      String getOkStatusCodeRange()
      The status codes which are considered a success response.
      boolean isAllowJavaSerializedObject()
      Whether to allow java serialization when a request uses context-type=application/x-java-serialized-object
      boolean isThrowExceptionOnFailure()
      Whether to throw HttpOperationFailedException in case of response code != 200.
      boolean isTransferException()
      Whether to transfer exception back as a serialized java object if processing failed due to an exception
      void populateResponse​(org.apache.camel.Exchange exchange, JettyContentExchange httpExchange)
      Parses the response from the Jetty client.
      void setAllowJavaSerializedObject​(boolean allowJavaSerializedObject)
      Whether to allow java serialization when a request uses context-type=application/x-java-serialized-object
      void setHeaderFilterStrategy​(org.apache.camel.spi.HeaderFilterStrategy headerFilterStrategy)
      Sets the header filter strategy to use.
      void setOkStatusCodeRange​(String okStatusCodeRange)
      The status codes which are considered a success response.
      void setThrowExceptionOnFailure​(boolean throwExceptionOnFailure)
      Whether to throw HttpOperationFailedException in case of response code != 200.
      void setTransferException​(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 Exception
        Parses the response from the Jetty client.
        Parameters:
        exchange - the Exchange which to populate with the response
        httpExchange - 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 use HttpHeaderFilterStrategy

        Parameters:
        headerFilterStrategy - the custom strategy
      • setThrowExceptionOnFailure

        void setThrowExceptionOnFailure​(boolean throwExceptionOnFailure)
        Whether to throw HttpOperationFailedException in case of response code != 200.
        Parameters:
        throwExceptionOnFailure - true to throw exception
      • isThrowExceptionOnFailure

        boolean isThrowExceptionOnFailure()
        Whether to throw HttpOperationFailedException in 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