org.apache.camel.component.jetty
Class DefaultJettyHttpBinding

java.lang.Object
  extended by org.apache.camel.component.jetty.DefaultJettyHttpBinding
All Implemented Interfaces:
JettyHttpBinding

public class DefaultJettyHttpBinding
extends Object
implements JettyHttpBinding

Version:

Constructor Summary
DefaultJettyHttpBinding()
           
 
Method Summary
protected  Object extractResponseBody(org.apache.camel.Exchange exchange, JettyContentExchange httpExchange)
           
 org.apache.camel.spi.HeaderFilterStrategy getHeaderFilterStrategy()
          Gets the header filter strategy
 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
protected  Exception populateHttpOperationFailedException(org.apache.camel.Exchange exchange, JettyContentExchange httpExchange, int responseCode)
           
 void populateResponse(org.apache.camel.Exchange exchange, JettyContentExchange httpExchange)
          Parses the response from the Jetty client.
protected  void populateResponse(org.apache.camel.Exchange exchange, JettyContentExchange httpExchange, org.apache.camel.Message in, org.apache.camel.spi.HeaderFilterStrategy strategy, int responseCode)
           
 void setHeaderFilterStrategy(org.apache.camel.spi.HeaderFilterStrategy headerFilterStrategy)
          Sets the header filter strategy to use.
 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultJettyHttpBinding

public DefaultJettyHttpBinding()
Method Detail

populateResponse

public void populateResponse(org.apache.camel.Exchange exchange,
                             JettyContentExchange httpExchange)
                      throws Exception
Description copied from interface: JettyHttpBinding
Parses the response from the Jetty client.

Specified by:
populateResponse in interface JettyHttpBinding
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

public org.apache.camel.spi.HeaderFilterStrategy getHeaderFilterStrategy()
Description copied from interface: JettyHttpBinding
Gets the header filter strategy

Specified by:
getHeaderFilterStrategy in interface JettyHttpBinding
Returns:
the strategy

setHeaderFilterStrategy

public void setHeaderFilterStrategy(org.apache.camel.spi.HeaderFilterStrategy headerFilterStrategy)
Description copied from interface: JettyHttpBinding
Sets the header filter strategy to use.

Will default use HttpHeaderFilterStrategy

Specified by:
setHeaderFilterStrategy in interface JettyHttpBinding
Parameters:
headerFilterStrategy - the custom strategy

isThrowExceptionOnFailure

public boolean isThrowExceptionOnFailure()
Description copied from interface: JettyHttpBinding
Whether to throw HttpOperationFailedException in case of response code != 200.

Specified by:
isThrowExceptionOnFailure in interface JettyHttpBinding
Returns:
true to throw exception

setThrowExceptionOnFailure

public void setThrowExceptionOnFailure(boolean throwExceptionOnFailure)
Description copied from interface: JettyHttpBinding
Whether to throw HttpOperationFailedException in case of response code != 200.

Specified by:
setThrowExceptionOnFailure in interface JettyHttpBinding
Parameters:
throwExceptionOnFailure - true to throw exception

isTransferException

public boolean isTransferException()
Description copied from interface: JettyHttpBinding
Whether to transfer exception back as a serialized java object if processing failed due to an exception

Specified by:
isTransferException in interface JettyHttpBinding
Returns:
true to transfer exception

setTransferException

public void setTransferException(boolean transferException)
Description copied from interface: JettyHttpBinding
Whether to transfer exception back as a serialized java object if processing failed due to an exception

Specified by:
setTransferException in interface JettyHttpBinding
Parameters:
transferException - true to transfer exception

populateResponse

protected void populateResponse(org.apache.camel.Exchange exchange,
                                JettyContentExchange httpExchange,
                                org.apache.camel.Message in,
                                org.apache.camel.spi.HeaderFilterStrategy strategy,
                                int responseCode)
                         throws IOException
Throws:
IOException

populateHttpOperationFailedException

protected Exception populateHttpOperationFailedException(org.apache.camel.Exchange exchange,
                                                         JettyContentExchange httpExchange,
                                                         int responseCode)
                                                  throws IOException
Throws:
IOException

extractResponseBody

protected Object extractResponseBody(org.apache.camel.Exchange exchange,
                                     JettyContentExchange httpExchange)
                              throws IOException
Throws:
IOException


Apache Camel