Restlet Framework 2.2.1
Java Standard Edition

org.restlet.engine.connector
Class HttpExchangeCall

java.lang.Object
  extended by org.restlet.engine.adapter.Call
      extended by org.restlet.engine.adapter.ServerCall
          extended by org.restlet.engine.connector.HttpExchangeCall

public class HttpExchangeCall
extends ServerCall

Call that is used by the Basic HTTP server.

Author:
Jerome Louvel

Constructor Summary
HttpExchangeCall(Server server, com.sun.net.httpserver.HttpExchange exchange)
          Constructor.
 
Method Summary
 boolean abort()
          Ask the connector to abort the related network connection, for example immediately closing the socket.
 void flushBuffers()
          Flushes the buffers onto the network so that for example you can force headers to be written before the entity is becoming available.
 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.
 String getMethod()
          Returns the request method.
 InputStream getRequestEntityStream(long size)
          Returns the request entity stream if it exists.
 Series<Header> getRequestHeaders()
          Returns the modifiable list of request headers.
 InputStream getRequestHeadStream()
          Returns the request head stream if it exists.
 String getRequestUri()
          Returns the URI on the request line (most like a relative reference, but not necessarily).
 OutputStream getResponseEntityStream()
          Returns the response entity stream if it exists.
 void writeResponseHead(Response restletResponse)
          Writes the response status line and headers.
 
Methods inherited from class org.restlet.engine.adapter.ServerCall
complete, getCertificates, getCipherSuite, getContentLength, getHostDomain, getHostPort, getRequestEntity, getSslKeySize, getSslSessionId, getSslSessionIdBytes, isClientKeepAlive, isServerKeepAlive, readRequestHead, sendResponse, shouldResponseBeChunked, writeResponseBody, writeResponseHead
 
Methods inherited from class org.restlet.engine.adapter.Call
getLogger, getProtocol, getReasonPhrase, getRepresentation, getRepresentation, getResponseHeaders, getServerAddress, getServerPort, getStatusCode, getUserPrincipal, getVersion, isBroken, isConfidential, isConnectionBroken, isKeepAlive, isRequestChunked, isResponseChunked, setClientAddress, setClientPort, setConfidential, setHostDomain, setHostPort, setMethod, setProtocol, setReasonPhrase, setRequestUri, setServerAddress, setServerPort, setStatusCode, setUserPrincipal, setVersion
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HttpExchangeCall

public HttpExchangeCall(Server server,
                        com.sun.net.httpserver.HttpExchange exchange)
Constructor.

Parameters:
server -
exchange -
Method Detail

abort

public boolean abort()
Description copied from class: ServerCall
Ask the connector to abort the related network connection, for example immediately closing the socket.

Specified by:
abort in class ServerCall
Returns:
True if the request was aborted.

flushBuffers

public void flushBuffers()
                  throws IOException
Description copied from class: ServerCall
Flushes the buffers onto the network so that for example you can force headers to be written before the entity is becoming available.

Overrides:
flushBuffers in class ServerCall
Throws:
IOException

getClientAddress

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

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

getClientPort

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

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

getMethod

public String getMethod()
Description copied from class: Call
Returns the request method.

Overrides:
getMethod in class Call
Returns:
The request method.

getRequestHeaders

public Series<Header> getRequestHeaders()
Description copied from class: Call
Returns the modifiable list of request headers.

Overrides:
getRequestHeaders in class Call
Returns:
The modifiable list of request headers.

getRequestEntityStream

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

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

getRequestHeadStream

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

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

getRequestUri

public String getRequestUri()
Description copied from class: Call
Returns the URI on the request line (most like a relative reference, but not necessarily).

Overrides:
getRequestUri in class Call
Returns:
The URI on the request line.

getResponseEntityStream

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

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

writeResponseHead

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

Overrides:
writeResponseHead in class ServerCall
Parameters:
restletResponse - The response.
Throws:
IOException

Restlet Framework 2.2.1
Java Standard Edition

Copyright © 2005-2014 Restlet.