org.restlet.client.engine.http
Class GwtClientCall

java.lang.Object
  extended by org.restlet.client.engine.http.Call
      extended by org.restlet.client.engine.http.ClientCall
          extended by org.restlet.client.engine.http.GwtClientCall

public class GwtClientCall
extends ClientCall

HTTP client connector call based on GWT's HTTP module.

Author:
Jerome Louvel

Constructor Summary
GwtClientCall(GwtHttpClientHelper helper, String method, String requestUri, boolean hasEntity)
          Constructor.
 
Method Summary
 GwtHttpClientHelper getHelper()
          Returns the HTTP client helper.
 String getReasonPhrase()
          Returns the response reason phrase.
 RequestBuilder getRequestBuilder()
          Returns the GWT request builder.
 String getRequestEntityString()
          Returns the request entity string if it exists.
 Response getResponse()
          Returns the GWT response.
 InputStream getResponseEntityStream(long size)
          Returns the response entity stream if it exists.
 Series<Parameter> getResponseHeaders()
          Returns the modifiable list of response headers.
 String getServerAddress()
          Returns the response address.
Corresponds to the IP address of the responding server.
 int getStatusCode()
          Returns the status code.
 void sendRequest(Request request, Response response, Uniform onResponseCallback)
          Sends the request to the client.
 void setResponse(Response response)
          Sets the GWT response.
 
Methods inherited from class org.restlet.client.engine.http.ClientCall
getContentLength, getLocalAddress, getResponseEntity, isClientKeepAlive, isServerKeepAlive, parseContentDisposition, shouldRequestBeChunked
 
Methods inherited from class org.restlet.client.engine.http.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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GwtClientCall

public GwtClientCall(GwtHttpClientHelper helper,
                     String method,
                     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 class ClientCall
Returns:
The HTTP client helper.

getReasonPhrase

public String getReasonPhrase()
Returns the response reason phrase.

Overrides:
getReasonPhrase in class Call
Returns:
The response reason phrase.

getRequestBuilder

public RequestBuilder getRequestBuilder()
Returns the GWT request builder.

Returns:
The GWT request builder.

getRequestEntityString

public String getRequestEntityString()
Description copied from class: ClientCall
Returns the request entity string if it exists.

Specified by:
getRequestEntityString in class ClientCall
Returns:
The request entity string if it exists.

getResponse

public Response getResponse()
Returns the GWT response.

Returns:
The GWT response.

getResponseEntityStream

public InputStream getResponseEntityStream(long size)
Description copied from class: ClientCall
Returns the response entity stream if it exists.

Specified by:
getResponseEntityStream in class ClientCall
Parameters:
size - The expected entity size or -1 if unknown.
Returns:
The response entity stream if it exists.

getResponseHeaders

public Series<Parameter> getResponseHeaders()
Returns the modifiable list of response headers.

Overrides:
getResponseHeaders in class Call
Returns:
The modifiable list of response headers.

getServerAddress

public String getServerAddress()
Description copied from class: Call
Returns the response address.
Corresponds to the IP address of the responding server.

Overrides:
getServerAddress in class Call
Returns:
The response address.

getStatusCode

public int getStatusCode()
Description copied from class: Call
Returns the status code.

Overrides:
getStatusCode in class Call
Returns:
The status code.

sendRequest

public void sendRequest(Request request,
                        Response response,
                        Uniform onResponseCallback)
                 throws 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 class ClientCall
Parameters:
request - The high-level request.
response - The high-level response.
onResponseCallback - The callback invoked upon request completion.
Throws:
Exception

setResponse

public void setResponse(Response response)
Sets the GWT response.

Parameters:
response - The GWT response.


Copyright © 2005-2010 Noelios Technologies.