Package org.restlet.engine.connector
Class HttpExchangeCall
- java.lang.Object
 - 
- org.restlet.engine.adapter.Call
 - 
- org.restlet.engine.adapter.ServerCall
 - 
- org.restlet.engine.connector.HttpExchangeCall
 
 
 
 
- 
public class HttpExchangeCall extends ServerCall
Call that is used by the Basic HTTP server.- Author:
 - Jerome Louvel
 
 
- 
- 
Constructor Summary
Constructors Constructor Description HttpExchangeCall(org.restlet.Server server, com.sun.net.httpserver.HttpExchange exchange)Constructor.HttpExchangeCall(org.restlet.Server server, com.sun.net.httpserver.HttpExchange exchange, boolean confidential)Constructor. 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanabort()Ask the connector to abort the related network connection, for example immediately closing the socket.voidflushBuffers()Flushes the buffers onto the network so that for example you can force headers to be written before the entity is becoming available.java.lang.StringgetClientAddress()Returns the client address.
Corresponds to the IP address of the requesting client.intgetClientPort()Returns the client port.
Corresponds to the TCP/IP port of the requesting client.java.lang.StringgetMethod()Returns the request method.java.io.InputStreamgetRequestEntityStream(long size)Returns the request entity stream if it exists.org.restlet.util.Series<org.restlet.data.Header>getRequestHeaders()Returns the modifiable list of request headers.java.io.InputStreamgetRequestHeadStream()Returns the request head stream if it exists.java.lang.StringgetRequestUri()Returns the URI on the request line (most like a relative reference, but not necessarily).java.io.OutputStreamgetResponseEntityStream()Returns the response entity stream if it exists.voidwriteResponseHead(org.restlet.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 
 - 
 
 - 
 
- 
- 
Constructor Detail
- 
HttpExchangeCall
public HttpExchangeCall(org.restlet.Server server, com.sun.net.httpserver.HttpExchange exchange)Constructor.- Parameters:
 server- The parent server.exchange- The wrappedHttpExchangeinstance.
 
- 
HttpExchangeCall
public HttpExchangeCall(org.restlet.Server server, com.sun.net.httpserver.HttpExchange exchange, boolean confidential)Constructor.- Parameters:
 server- The parent server.exchange- The wrappedHttpExchangeinstance.confidential- True if the confidentiality of the call is ensured (ex: via SSL)
 
 - 
 
- 
Method Detail
- 
abort
public boolean abort()
Description copied from class:ServerCallAsk the connector to abort the related network connection, for example immediately closing the socket.- Specified by:
 abortin classServerCall- Returns:
 - True if the connection was aborted.
 
 
- 
flushBuffers
public void flushBuffers() throws java.io.IOExceptionDescription copied from class:ServerCallFlushes the buffers onto the network so that for example you can force headers to be written before the entity is becoming available.- Overrides:
 flushBuffersin classServerCall- Throws:
 java.io.IOException
 
- 
getClientAddress
public java.lang.String getClientAddress()
Description copied from class:CallReturns the client address.
Corresponds to the IP address of the requesting client.- Overrides:
 getClientAddressin classCall- Returns:
 - The client address.
 
 
- 
getClientPort
public int getClientPort()
Description copied from class:CallReturns the client port.
Corresponds to the TCP/IP port of the requesting client.- Overrides:
 getClientPortin classCall- Returns:
 - The client port.
 
 
- 
getMethod
public java.lang.String getMethod()
Description copied from class:CallReturns the request method. 
- 
getRequestHeaders
public org.restlet.util.Series<org.restlet.data.Header> getRequestHeaders()
Description copied from class:CallReturns the modifiable list of request headers.- Overrides:
 getRequestHeadersin classCall- Returns:
 - The modifiable list of request headers.
 
 
- 
getRequestEntityStream
public java.io.InputStream getRequestEntityStream(long size)
Description copied from class:ServerCallReturns the request entity stream if it exists.- Specified by:
 getRequestEntityStreamin classServerCall- Parameters:
 size- The expected entity size or -1 if unknown.- Returns:
 - The request entity stream if it exists.
 
 
- 
getRequestHeadStream
public java.io.InputStream getRequestHeadStream()
Description copied from class:ServerCallReturns the request head stream if it exists.- Specified by:
 getRequestHeadStreamin classServerCall- Returns:
 - The request head stream if it exists.
 
 
- 
getRequestUri
public java.lang.String getRequestUri()
Description copied from class:CallReturns the URI on the request line (most like a relative reference, but not necessarily).- Overrides:
 getRequestUriin classCall- Returns:
 - The URI on the request line.
 
 
- 
getResponseEntityStream
public java.io.OutputStream getResponseEntityStream()
Description copied from class:ServerCallReturns the response entity stream if it exists.- Specified by:
 getResponseEntityStreamin classServerCall- Returns:
 - The response entity stream if it exists.
 
 
- 
writeResponseHead
public void writeResponseHead(org.restlet.Response restletResponse) throws java.io.IOExceptionDescription copied from class:ServerCallWrites the response status line and headers. Does nothing by default.- Overrides:
 writeResponseHeadin classServerCall- Parameters:
 restletResponse- The response.- Throws:
 java.io.IOException
 
 - 
 
 -