com.noelios.restlet.http
Class StreamClientCall

java.lang.Object
  extended by com.noelios.restlet.http.HttpCall
      extended by com.noelios.restlet.http.HttpClientCall
          extended by com.noelios.restlet.http.StreamClientCall

public class StreamClientCall
extends HttpClientCall

HTTP client call based on streams.

Author:
Jerome Louvel (contact@noelios.com)

Constructor Summary
StreamClientCall(StreamClientHelper helper, Request request)
          Constructor.
 
Method Summary
 Socket createSocket(String hostDomain, int hostPort)
          Creates the socket that will be used to send the request and get the response.
 Request getRequest()
          Returns the request to send.
 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.
 InputStream getResponseStream()
          Returns the response stream if it exists.
protected  void parseResponse()
          Parses the HTTP response.
 Status sendRequest(Request request)
          Sends the request to the client.
 
Methods inherited from class com.noelios.restlet.http.HttpClientCall
getHelper, getLocalAddress, getResponseEntity
 
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

StreamClientCall

public StreamClientCall(StreamClientHelper helper,
                        Request request)
Constructor.

Parameters:
helper - The client connector helper.
request - The request to send.
Method Detail

createSocket

public Socket createSocket(String hostDomain,
                           int hostPort)
                    throws UnknownHostException,
                           IOException
Creates the socket that will be used to send the request and get the response.

Parameters:
hostDomain - The target host domain name.
hostPort - The target host port.
Returns:
The created socket.
Throws:
UnknownHostException
IOException

getRequest

public Request getRequest()
Returns the request to send.

Returns:
The request to send.

getRequestChannel

public WritableByteChannel getRequestChannel()
Description copied from class: HttpClientCall
Returns the request entity channel if it exists.

Overrides:
getRequestChannel in class HttpClientCall
Returns:
The request entity channel if it exists.

getRequestStream

public OutputStream getRequestStream()
Description copied from class: HttpClientCall
Returns the request entity stream if it exists.

Overrides:
getRequestStream in class HttpClientCall
Returns:
The request entity stream if it exists.

getResponseChannel

public ReadableByteChannel getResponseChannel()
Description copied from class: HttpClientCall
Returns the response channel if it exists.

Overrides:
getResponseChannel in class HttpClientCall
Returns:
The response channel if it exists.

getResponseStream

public InputStream getResponseStream()
Description copied from class: HttpClientCall
Returns the response stream if it exists.

Overrides:
getResponseStream in class HttpClientCall
Returns:
The response stream if it exists.

parseResponse

protected void parseResponse()
                      throws IOException
Parses the HTTP response.

Throws:
IOException

sendRequest

public Status sendRequest(Request request)
Description copied from class: HttpClientCall
Sends the request to the client. Commits the request line, headers and optional entity and send them over the network.

Overrides:
sendRequest in class HttpClientCall
Parameters:
request - The high-level request.


Copyright © 2005-2007 Noelios Consulting.