Class JettyContentExchange9
- java.lang.Object
-
- org.apache.camel.component.jetty9.JettyContentExchange9
-
- All Implemented Interfaces:
org.apache.camel.component.jetty.JettyContentExchange
public class JettyContentExchange9 extends Object implements org.apache.camel.component.jetty.JettyContentExchange
Jetty specific exchange which keeps track of the request and response.
-
-
Constructor Summary
Constructors Constructor Description JettyContentExchange9()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addRequestHeader(String key, String s)
protected void
closeRequestContentSource()
protected void
doTaskCompleted(Throwable ex)
byte[]
getBody()
Map<String,Collection<String>>
getRequestHeaders()
byte[]
getResponseContentBytes()
Map<String,Collection<String>>
getResponseHeaders()
int
getResponseStatus()
String
getUrl()
void
init(org.apache.camel.Exchange exchange, org.apache.camel.component.jetty.JettyHttpBinding jettyBinding, org.eclipse.jetty.client.HttpClient client, org.apache.camel.AsyncCallback callback)
protected void
onConnectionFailed(Throwable ex)
protected void
onException(Throwable ex)
protected void
onExpire()
protected void
onRequestComplete()
protected void
onResponseComplete(org.eclipse.jetty.client.api.Result result, byte[] content)
void
send(org.eclipse.jetty.client.HttpClient client)
void
setMethod(String method)
void
setRequestContent(byte[] byteArray)
void
setRequestContent(InputStream ins)
void
setRequestContent(InputStream ins, int contentLength)
void
setRequestContent(String data, String charset)
void
setRequestContentType(String contentType)
protected void
setResponse(org.eclipse.jetty.client.api.Response response)
void
setSupportRedirect(boolean supportRedirect)
void
setTimeout(long timeout)
void
setURL(String url)
-
-
-
Method Detail
-
init
public void init(org.apache.camel.Exchange exchange, org.apache.camel.component.jetty.JettyHttpBinding jettyBinding, org.eclipse.jetty.client.HttpClient client, org.apache.camel.AsyncCallback callback)
- Specified by:
init
in interfaceorg.apache.camel.component.jetty.JettyContentExchange
-
onRequestComplete
protected void onRequestComplete()
-
onResponseComplete
protected void onResponseComplete(org.eclipse.jetty.client.api.Result result, byte[] content)
-
onExpire
protected void onExpire()
-
onException
protected void onException(Throwable ex)
-
onConnectionFailed
protected void onConnectionFailed(Throwable ex)
-
getBody
public byte[] getBody()
- Specified by:
getBody
in interfaceorg.apache.camel.component.jetty.JettyContentExchange
-
getUrl
public String getUrl()
- Specified by:
getUrl
in interfaceorg.apache.camel.component.jetty.JettyContentExchange
-
closeRequestContentSource
protected void closeRequestContentSource()
-
doTaskCompleted
protected void doTaskCompleted(Throwable ex)
-
setRequestContentType
public void setRequestContentType(String contentType)
- Specified by:
setRequestContentType
in interfaceorg.apache.camel.component.jetty.JettyContentExchange
-
getResponseStatus
public int getResponseStatus()
- Specified by:
getResponseStatus
in interfaceorg.apache.camel.component.jetty.JettyContentExchange
-
setMethod
public void setMethod(String method)
- Specified by:
setMethod
in interfaceorg.apache.camel.component.jetty.JettyContentExchange
-
setTimeout
public void setTimeout(long timeout)
- Specified by:
setTimeout
in interfaceorg.apache.camel.component.jetty.JettyContentExchange
-
setURL
public void setURL(String url)
- Specified by:
setURL
in interfaceorg.apache.camel.component.jetty.JettyContentExchange
-
setRequestContent
public void setRequestContent(byte[] byteArray)
- Specified by:
setRequestContent
in interfaceorg.apache.camel.component.jetty.JettyContentExchange
-
setRequestContent
public void setRequestContent(String data, String charset) throws UnsupportedEncodingException
- Specified by:
setRequestContent
in interfaceorg.apache.camel.component.jetty.JettyContentExchange
- Throws:
UnsupportedEncodingException
-
setRequestContent
public void setRequestContent(InputStream ins)
- Specified by:
setRequestContent
in interfaceorg.apache.camel.component.jetty.JettyContentExchange
-
setRequestContent
public void setRequestContent(InputStream ins, int contentLength)
- Specified by:
setRequestContent
in interfaceorg.apache.camel.component.jetty.JettyContentExchange
-
addRequestHeader
public void addRequestHeader(String key, String s)
- Specified by:
addRequestHeader
in interfaceorg.apache.camel.component.jetty.JettyContentExchange
-
send
public void send(org.eclipse.jetty.client.HttpClient client) throws IOException
- Specified by:
send
in interfaceorg.apache.camel.component.jetty.JettyContentExchange
- Throws:
IOException
-
setResponse
protected void setResponse(org.eclipse.jetty.client.api.Response response)
-
getResponseContentBytes
public byte[] getResponseContentBytes()
- Specified by:
getResponseContentBytes
in interfaceorg.apache.camel.component.jetty.JettyContentExchange
-
getRequestHeaders
public Map<String,Collection<String>> getRequestHeaders()
- Specified by:
getRequestHeaders
in interfaceorg.apache.camel.component.jetty.JettyContentExchange
-
getResponseHeaders
public Map<String,Collection<String>> getResponseHeaders()
- Specified by:
getResponseHeaders
in interfaceorg.apache.camel.component.jetty.JettyContentExchange
-
setSupportRedirect
public void setSupportRedirect(boolean supportRedirect)
- Specified by:
setSupportRedirect
in interfaceorg.apache.camel.component.jetty.JettyContentExchange
-
-