org.restlet.ext.simple.internal

## Class SimpleCall

- java.lang.Object
- - org.restlet.engine.http.Call
  - - org.restlet.engine.http.ServerCall
    - - org.restlet.ext.simple.internal.SimpleCall

    public class SimpleCall
    extends ServerCall

Call that is used by the Simple HTTP server.

Author:
  Lars Heuer, Jerome Louvel

### Method Summary

Methods
`boolean` `abort()` Closes the socket.
`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.
`protected long` `getContentLength()` Returns the content length of the request entity if know, `Representation.UNKNOWN_SIZE` otherwise.
`java.lang.String` `getHostDomain()` Returns the host domain name.
`java.lang.String` `getMethod()` Returns the request method.
`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.
`Series<Parameter>` `getRequestHeaders()` Returns the list of request headers.
`java.io.InputStream` `getRequestHeadStream()` Returns the request head stream if it exists.
`java.lang.String` `getRequestUri()` Returns the full request URI.
`java.nio.channels.WritableByteChannel` `getResponseEntityChannel()` Returns the response channel if it exists.
`java.io.OutputStream` `getResponseEntityStream()` Returns the response stream if it exists.
`java.lang.String` `getSslCipherSuite()` Returns the SSL Cipher Suite, if available and accessible.
`java.util.List<java.security.cert.Certificate>` `getSslClientCertificates()` Returns the chain of client certificates, if available and accessible.
`protected byte[]` `getSslSessionIdBytes()` Returns the SSL session ID, as a byte array, if available and accessible in that format (to be used by getSslSessionId).
`java.lang.String` `getVersion()` Returns the protocol version used.
`protected boolean` `isClientKeepAlive()` Indicates if the client wants a persistent connection.
`void` `writeResponseHead(Response restletResponse)` Writes the response status line and headers.

### Methods inherited from class org.restlet.engine.http.ServerCall

`getHostPort, getRequestEntity, getSslKeySize, getSslSessionId, isServerKeepAlive, readRequestHead, sendResponse, shouldResponseBeChunked, writeResponseBody, writeResponseHead`

### Methods inherited from class org.restlet.engine.http.Call

`getLogger, getProtocol, getReasonPhrase, getRepresentation, getRepresentation, getResponseHeaders, getServerAddress, getServerPort, getStatusCode, getUserPrincipal, 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`

### Method Detail

#### abort

    public boolean abort()

Closes the socket.

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

#### complete

    public void complete()

Description copied from class: `ServerCall`
Complete the response

Overrides:
  `complete` in class `ServerCall`

#### getClientAddress

    public java.lang.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.

#### getContentLength

    protected long getContentLength()

Description copied from class: `ServerCall`
Returns the content length of the request entity if know, `Representation.UNKNOWN_SIZE` otherwise.

Overrides:
  `getContentLength` in class `ServerCall`
Returns:
  The request content length.

#### getHostDomain

    public java.lang.String getHostDomain()

Description copied from class: `ServerCall`
Returns the host domain name.

Overrides:
  `getHostDomain` in class `ServerCall`
Returns:
  The host domain name.

#### getMethod

    public java.lang.String getMethod()

Returns the request method.

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

#### getRequestEntityChannel

    public java.nio.channels.ReadableByteChannel getRequestEntityChannel(long size)

Description copied from class: `ServerCall`
Returns the request entity channel if it exists.

Specified by:
  `getRequestEntityChannel` in class `ServerCall`
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: `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.

#### getRequestHeadChannel

    public java.nio.channels.ReadableByteChannel getRequestHeadChannel()

Description copied from class: `ServerCall`
Returns the request head channel if it exists.

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

#### getRequestHeaders

    public Series<Parameter> getRequestHeaders()

Returns the list of request headers.

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

#### getRequestHeadStream

    public java.io.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 java.lang.String getRequestUri()

Returns the full request URI.

Overrides:
  `getRequestUri` in class `Call`
Returns:
  The full request URI.

#### getResponseEntityChannel

    public java.nio.channels.WritableByteChannel getResponseEntityChannel()

Returns the response channel if it exists.

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

#### getResponseEntityStream

    public java.io.OutputStream getResponseEntityStream()

Returns the response stream if it exists.

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

#### getSslCipherSuite

    public java.lang.String getSslCipherSuite()

Description copied from class: `ServerCall`
Returns the SSL Cipher Suite, if available and accessible.

Overrides:
  `getSslCipherSuite` in class `ServerCall`
Returns:
  The SSL Cipher Suite, if available and accessible.

#### getSslClientCertificates

    public java.util.List<java.security.cert.Certificate> getSslClientCertificates()

Description copied from class: `ServerCall`
Returns the chain of client certificates, if available and accessible.

Overrides:
  `getSslClientCertificates` in class `ServerCall`
Returns:
  The chain of client certificates, if available and accessible.

#### getSslSessionIdBytes

    protected byte[] getSslSessionIdBytes()

Description copied from class: `ServerCall`
Returns the SSL session ID, as a byte array, if available and accessible in that format (to be used by getSslSessionId).

Overrides:
  `getSslSessionIdBytes` in class `ServerCall`
Returns:
  The SSL session ID, as a byte array, if available and accessible in that format.

#### getVersion

    public java.lang.String getVersion()

Description copied from class: `Call`
Returns the protocol version used.

Overrides:
  `getVersion` in class `Call`
Returns:
  The protocol version used.

#### isClientKeepAlive

    protected boolean isClientKeepAlive()

Description copied from class: `Call`
Indicates if the client wants a persistent connection.

Overrides:
  `isClientKeepAlive` in class `ServerCall`
Returns:
  True if the client wants a persistent connection.

#### writeResponseHead

    public void writeResponseHead(Response restletResponse)
                           throws java.io.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:
  `java.io.IOException`