Package org.restlet.engine.adapter
Class JettyClientCall
java.lang.Object
org.restlet.engine.adapter.Call
org.restlet.engine.adapter.ClientCall
org.restlet.engine.adapter.JettyClientCall
HTTP client connector call based on Jetty's HttpRequest class.
- Author:
- Jerome Louvel, Tal Liron
-
Constructor Summary
ConstructorsConstructorDescriptionJettyClientCall(HttpClientHelper helper, String method, String requestUri) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionorg.eclipse.jetty.client.InputStreamResponseListenerReturns the input stream response listener.Returns the reason phrase.org.eclipse.jetty.client.RequestReturns the HTTP request.Returns the request entity stream if it exists.Returns the request head stream if it exists.org.eclipse.jetty.client.ResponseReturns the HTTP response.getResponseEntity(Response response) Returns the response entity if available.getResponseEntityStream(long size) Returns the response entity stream if it exists.Returns the modifiable list of response headers.Returns the response address.
Corresponds to the IP address of the responding server.intReturns the response status code.sendRequest(Request request) Sends the request to the client.voidsendRequest(Request request, Response response, Uniform callback) Sends the request to the client.Methods inherited from class org.restlet.engine.adapter.ClientCall
getContentLength, getHelper, getLocalAddress, isClientKeepAlive, isServerKeepAlive, shouldRequestBeChunkedMethods inherited from class org.restlet.engine.adapter.Call
getClientAddress, getClientPort, getHostDomain, getHostPort, getLogger, getMethod, getProtocol, getRepresentation, getRequestHeaders, getRequestUri, getServerPort, getUserPrincipal, getVersion, isBroken, isConfidential, isConnectionBroken, isKeepAlive, isRequestChunked, isResponseChunked, setClientAddress, setClientPort, setConfidential, setHostDomain, setHostPort, setMethod, setProtocol, setReasonPhrase, setRequestUri, setServerAddress, setServerPort, setStatusCode, setUserPrincipal, setVersion
-
Constructor Details
-
JettyClientCall
public JettyClientCall(HttpClientHelper helper, String method, String requestUri) throws IOException Constructor.- Parameters:
helper- The parent HTTP client helper.method- The method name.requestUri- The request URI.- Throws:
IOException
-
-
Method Details
-
getRequest
public org.eclipse.jetty.client.Request getRequest()Returns the HTTP request.- Returns:
- The HTTP request.
-
getResponse
public org.eclipse.jetty.client.Response getResponse()Returns the HTTP response.- Returns:
- The HTTP response.
-
getInputStreamResponseListener
public org.eclipse.jetty.client.InputStreamResponseListener getInputStreamResponseListener()Returns the input stream response listener.- Returns:
- The input stream response listener.
-
getReasonPhrase
Description copied from class:CallReturns the reason phrase.- Overrides:
getReasonPhrasein classCall- Returns:
- The reason phrase.
-
getRequestEntityStream
Description copied from class:ClientCallReturns the request entity stream if it exists.- Specified by:
getRequestEntityStreamin classClientCall- Returns:
- The request entity stream if it exists.
-
getRequestHeadStream
Description copied from class:ClientCallReturns the request head stream if it exists.- Specified by:
getRequestHeadStreamin classClientCall- Returns:
- The request head stream if it exists.
-
getResponseEntityStream
Description copied from class:ClientCallReturns the response entity stream if it exists.- Specified by:
getResponseEntityStreamin classClientCall- Parameters:
size- The expected entity size or -1 if unknown.- Returns:
- The response entity stream if it exists.
-
getResponseEntity
Returns the response entity if available. Note that no metadata is associated by default, you have to manually set them from your headers. As a jetty client decodes the input stream on the fly, we have to clear theVariant.getEncodings()to avoid decoding the input stream another time.- Overrides:
getResponseEntityin classClientCall- Parameters:
response- the Response to get the entity from- Returns:
- The response entity if available.
-
getResponseHeaders
Returns the modifiable list of response headers.- Overrides:
getResponseHeadersin classCall- Returns:
- The modifiable list of response headers.
-
getServerAddress
Returns the response address.
Corresponds to the IP address of the responding server.- Overrides:
getServerAddressin classCall- Returns:
- The response address.
-
getStatusCode
public int getStatusCode()Returns the response status code.- Overrides:
getStatusCodein classCall- Returns:
- The response status code.
-
sendRequest
Sends the request to the client. Commits the request line, headers, and optional entity and send them over the network.- Overrides:
sendRequestin classClientCall- Parameters:
request- The high-level request.- Returns:
- The result status.
-
sendRequest
Description copied from class:ClientCallSends the request to the client. Commits the request line, headers and optional entity and send them over the network.- Overrides:
sendRequestin classClientCall- Parameters:
request- The high-level request.response- The high-level response.callback- The callback invoked upon request completion.- Throws:
Exception
-