com.noelios.restlet.http
Class HttpClientCall

java.lang.Object
  extended by com.noelios.restlet.http.HttpCall
      extended by com.noelios.restlet.http.HttpClientCall
Direct Known Subclasses:
StreamClientCall

public class HttpClientCall
extends HttpCall

Low-level HTTP client call.

Author:
Jerome Louvel (contact@noelios.com)

Constructor Summary
HttpClientCall(HttpClientHelper helper, String method, String requestUri)
          Constructor setting the request address to the local host.
 
Method Summary
 HttpClientHelper getHelper()
          Returns the HTTP client helper.
static String getLocalAddress()
          Returns the local IP address or 127.0.0.1 if the resolution fails.
 WritableByteChannel getRequestChannel()
          Returns the request entity channel if it exists.
 OutputStream getRequestStream()
          Returns the request entity stream if it exists.
 ReadableByteChannel getResponseChannel()
          Returns the response channel if it exists.
 Representation getResponseEntity()
          Returns the response entity if available.
 InputStream getResponseStream()
          Returns the response stream if it exists.
 Status sendRequest(Request request)
          Sends the request to the client.
 
Methods inherited from class com.noelios.restlet.http.HttpCall
formatDate, getClientAddress, getClientPort, getConnectorService, getHostDomain, getHostPort, getLogger, getMethod, getProtocol, getReasonPhrase, getRequestHeaders, getRequestUri, getResponseHeaders, getServerAddress, getServerPort, getStatusCode, getVersion, isConfidential, parseDate, setClientAddress, setClientPort, setConfidential, setHostDomain, setHostPort, setLogger, 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

HttpClientCall

public HttpClientCall(HttpClientHelper helper,
                      String method,
                      String requestUri)
Constructor setting the request address to the local host.

Parameters:
helper - The parent HTTP client helper.
method - The method name.
requestUri - The request URI.
Method Detail

getHelper

public HttpClientHelper getHelper()
Returns the HTTP client helper.

Returns:
The HTTP client helper.

getLocalAddress

public static String getLocalAddress()
Returns the local IP address or 127.0.0.1 if the resolution fails.

Returns:
The local IP address or 127.0.0.1 if the resolution fails.

getRequestChannel

public WritableByteChannel getRequestChannel()
Returns the request entity channel if it exists.

Returns:
The request entity channel if it exists.

getRequestStream

public OutputStream getRequestStream()
Returns the request entity stream if it exists.

Returns:
The request entity stream if it exists.

sendRequest

public Status sendRequest(Request request)
Sends the request to the client. Commits the request line, headers and optional entity and send them over the network.

Parameters:
request - The high-level request.

getResponseChannel

public ReadableByteChannel getResponseChannel()
Returns the response channel if it exists.

Returns:
The response channel if it exists.

getResponseStream

public InputStream getResponseStream()
Returns the response stream if it exists.

Returns:
The response stream if it exists.

getResponseEntity

public Representation getResponseEntity()
Returns the response entity if available. Note that no metadata is associated by default, you have to manually set them from your headers.

Returns:
The response entity if available.


Copyright © 2005-2007 Noelios Technologies.