Class GwtClientCall
- java.lang.Object
-
- org.restlet.client.engine.adapter.Call
-
- org.restlet.client.engine.adapter.ClientCall
-
- org.restlet.client.engine.adapter.GwtClientCall
-
public class GwtClientCall extends ClientCall
HTTP client connector call based on GWT's HTTP module.- Author:
- Jerome Louvel
-
-
Constructor Summary
Constructors Constructor Description GwtClientCall(GwtHttpClientHelper helper, java.lang.String method, java.lang.String requestUri, boolean hasEntity)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description GwtHttpClientHelper
getHelper()
Returns the HTTP client helper.java.lang.String
getReasonPhrase()
Returns the response reason phrase.RequestBuilder
getRequestBuilder()
Returns the GWT request builder.java.lang.String
getRequestEntityString()
Returns the request entity string if it exists.Response
getResponse()
Returns the GWT response.java.io.InputStream
getResponseEntityStream(long size)
Returns the response entity stream if it exists.org.restlet.client.util.Series<org.restlet.client.data.Header>
getResponseHeaders()
Returns the modifiable list of response headers.java.lang.String
getServerAddress()
Returns the response address.
Corresponds to the IP address of the responding server.int
getStatusCode()
Returns the status code.void
sendRequest(org.restlet.client.Request request, org.restlet.client.Response response, org.restlet.client.Uniform onResponseCallback)
Sends the request to the client.void
setResponse(Response response)
Sets the GWT response.-
Methods inherited from class org.restlet.client.engine.adapter.ClientCall
getContentLength, getLocalAddress, getResponseEntity, isClientKeepAlive, isServerKeepAlive, shouldRequestBeChunked
-
Methods inherited from class org.restlet.client.engine.adapter.Call
getClientAddress, getClientPort, getHostDomain, getHostPort, getLogger, getMethod, getProtocol, getRepresentation, getRequestHeaders, getRequestUri, getServerPort, getVersion, isBroken, isConfidential, isKeepAlive, isRequestChunked, isResponseChunked, setClientAddress, setClientPort, setConfidential, setHostDomain, setHostPort, setMethod, setProtocol, setReasonPhrase, setRequestUri, setServerAddress, setServerPort, setStatusCode, setVersion
-
-
-
-
Constructor Detail
-
GwtClientCall
public GwtClientCall(GwtHttpClientHelper helper, java.lang.String method, java.lang.String requestUri, boolean hasEntity)
Constructor.- Parameters:
helper
- The parent HTTP client helper.method
- The method name.requestUri
- The request URI.hasEntity
- Indicates if the call will have an entity to send to the server.
-
-
Method Detail
-
getHelper
public GwtHttpClientHelper getHelper()
Returns the HTTP client helper.- Overrides:
getHelper
in classClientCall
- Returns:
- The HTTP client helper.
-
getReasonPhrase
public java.lang.String getReasonPhrase()
Returns the response reason phrase.- Overrides:
getReasonPhrase
in classCall
- Returns:
- The response reason phrase.
-
getRequestBuilder
public RequestBuilder getRequestBuilder()
Returns the GWT request builder.- Returns:
- The GWT request builder.
-
getRequestEntityString
public java.lang.String getRequestEntityString()
Description copied from class:ClientCall
Returns the request entity string if it exists.- Specified by:
getRequestEntityString
in classClientCall
- Returns:
- The request entity string if it exists.
-
getResponse
public Response getResponse()
Returns the GWT response.- Returns:
- The GWT response.
-
getResponseEntityStream
public java.io.InputStream getResponseEntityStream(long size)
Description copied from class:ClientCall
Returns the response entity stream if it exists.- Specified by:
getResponseEntityStream
in classClientCall
- Parameters:
size
- The expected entity size or -1 if unknown.- Returns:
- The response entity stream if it exists.
-
getResponseHeaders
public org.restlet.client.util.Series<org.restlet.client.data.Header> getResponseHeaders()
Returns the modifiable list of response headers.- Overrides:
getResponseHeaders
in classCall
- Returns:
- The modifiable list of response headers.
-
getServerAddress
public java.lang.String getServerAddress()
Description copied from class:Call
Returns the response address.
Corresponds to the IP address of the responding server.- Overrides:
getServerAddress
in classCall
- Returns:
- The response address.
-
getStatusCode
public int getStatusCode()
Description copied from class:Call
Returns the status code.- Overrides:
getStatusCode
in classCall
- Returns:
- The status code.
-
sendRequest
public void sendRequest(org.restlet.client.Request request, org.restlet.client.Response response, org.restlet.client.Uniform onResponseCallback) throws java.lang.Exception
Description copied from class:ClientCall
Sends the request to the client. Commits the request line, headers and optional entity and send them over the network.- Overrides:
sendRequest
in classClientCall
- Parameters:
request
- The high-level request.response
- The high-level response.onResponseCallback
- The callback invoked upon request completion.- Throws:
java.lang.Exception
-
setResponse
public void setResponse(Response response)
Sets the GWT response.- Parameters:
response
- The GWT response.
-
-