com.noelios.restlet.http
Class StreamServerCall

java.lang.Object
  extended by com.noelios.restlet.http.HttpCall
      extended by com.noelios.restlet.http.HttpServerCall
          extended by com.noelios.restlet.http.StreamServerCall

public class StreamServerCall
extends HttpServerCall

HTTP server call based on streams.

Author:
Jerome Louvel

Constructor Summary
StreamServerCall(Server server, java.io.InputStream requestStream, java.io.OutputStream responseStream, java.net.Socket socket)
          Constructor.
 
Method Summary
 void complete()
          Complete the response
 java.lang.String getClientAddress()
          Returns the client address.
Corresponds to the IP address of the requesting client.
 int getClientPort()
          Returns the client port.
Corresponds to the TCP/IP port of the requesting client.
 java.nio.channels.ReadableByteChannel getRequestEntityChannel(long size)
          Returns the request entity channel if it exists.
 java.io.InputStream getRequestEntityStream(long size)
          Returns the request entity stream if it exists.
 java.nio.channels.ReadableByteChannel getRequestHeadChannel()
          Returns the request head channel if it exists.
 java.io.InputStream getRequestHeadStream()
          Returns the request head stream if it exists.
 java.nio.channels.WritableByteChannel getResponseEntityChannel()
          Returns the response channel if it exists.
 java.io.OutputStream getResponseEntityStream()
          Returns the response entity stream if it exists.
protected  boolean isServerKeepAlive()
          Indicates if the server wants a persistent connection.
 void writeResponseHead(Response response)
          Writes the response status line and headers.
 
Methods inherited from class com.noelios.restlet.http.HttpServerCall
formatContentDisposition, getContentLength, getHostDomain, getHostPort, getRequestEntity, getSslCipherSuite, getSslClientCertificates, getSslKeySize, isClientKeepAlive, readRequestHead, sendResponse, shouldResponseBeChunked, writeResponseBody, writeResponseHead
 
Methods inherited from class com.noelios.restlet.http.HttpCall
formatDate, getConnectorService, getContentLength, getLogger, getMethod, getProtocol, getReasonPhrase, getRequestHeaders, getRequestUri, getResponseHeaders, getServerAddress, getServerPort, getStatusCode, getVersion, isConfidential, isConnectionBroken, isKeepAlive, isRequestChunked, isResponseChunked, parseDate, 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

StreamServerCall

public StreamServerCall(Server server,
                        java.io.InputStream requestStream,
                        java.io.OutputStream responseStream,
                        java.net.Socket socket)
Constructor.

Parameters:
server - The server connector.
requestStream - The request input stream.
responseStream - The response output stream.
socket - The request socket
Method Detail

complete

public void complete()
Description copied from class: HttpServerCall
Complete the response

Overrides:
complete in class HttpServerCall

getClientAddress

public java.lang.String getClientAddress()
Description copied from class: HttpCall
Returns the client address.
Corresponds to the IP address of the requesting client.

Overrides:
getClientAddress in class HttpCall
Returns:
The client address.

getClientPort

public int getClientPort()
Description copied from class: HttpCall
Returns the client port.
Corresponds to the TCP/IP port of the requesting client.

Overrides:
getClientPort in class HttpCall
Returns:
The client port.

getRequestEntityChannel

public java.nio.channels.ReadableByteChannel getRequestEntityChannel(long size)
Description copied from class: HttpServerCall
Returns the request entity channel if it exists.

Specified by:
getRequestEntityChannel in class HttpServerCall
Parameters:
size - The expected entity size or -1 if unknown.
Returns:
The request entity channel if it exists.

getRequestEntityStream

public java.io.InputStream getRequestEntityStream(long size)
Description copied from class: HttpServerCall
Returns the request entity stream if it exists.

Specified by:
getRequestEntityStream in class HttpServerCall
Parameters:
size - The expected entity size or -1 if unknown.
Returns:
The request entity stream if it exists.

getRequestHeadChannel

public java.nio.channels.ReadableByteChannel getRequestHeadChannel()
Description copied from class: HttpServerCall
Returns the request head channel if it exists.

Specified by:
getRequestHeadChannel in class HttpServerCall
Returns:
The request head channel if it exists.

getRequestHeadStream

public java.io.InputStream getRequestHeadStream()
Description copied from class: HttpServerCall
Returns the request head stream if it exists.

Specified by:
getRequestHeadStream in class HttpServerCall
Returns:
The request head stream if it exists.

getResponseEntityChannel

public java.nio.channels.WritableByteChannel getResponseEntityChannel()
Description copied from class: HttpServerCall
Returns the response channel if it exists.

Specified by:
getResponseEntityChannel in class HttpServerCall
Returns:
The response channel if it exists.

getResponseEntityStream

public java.io.OutputStream getResponseEntityStream()
Description copied from class: HttpServerCall
Returns the response entity stream if it exists.

Specified by:
getResponseEntityStream in class HttpServerCall
Returns:
The response entity stream if it exists.

isServerKeepAlive

protected boolean isServerKeepAlive()
Description copied from class: HttpCall
Indicates if the server wants a persistent connection.

Overrides:
isServerKeepAlive in class HttpServerCall
Returns:
True if the server wants a persistent connection.

writeResponseHead

public void writeResponseHead(Response response)
                       throws java.io.IOException
Description copied from class: HttpServerCall
Writes the response status line and headers. Does nothing by default.

Overrides:
writeResponseHead in class HttpServerCall
Parameters:
response - The response.
Throws:
java.io.IOException


Copyright © 2005-2008 Noelios Technologies.