org.restlet.engine.http.adapter

## Class ServerAdapter

- java.lang.Object
- - org.restlet.engine.http.adapter.Adapter
  - - org.restlet.engine.http.adapter.ServerAdapter

    public class ServerAdapter
    extends Adapter

Converter of low-level HTTP server calls into high-level uniform calls.

Author:
  Jerome Louvel

### Constructor Summary

Constructors
Constructor and Description
`ServerAdapter(Context context)` Constructor.

### Method Summary

Methods
`protected void` `addEntityHeaders(HttpResponse response)` Adds the entity headers for the handled uniform call.
`protected void` `addResponseHeaders(HttpResponse response)` Adds the response headers for the handled uniform call.
`void` `commit(HttpResponse response)` Commits the changes to a handled uniform call back into the original HTTP call.
`HttpRequest` `toRequest(ServerCall httpCall)` Converts a low-level HTTP call into a high-level uniform request.

### Methods inherited from class org.restlet.engine.http.adapter.Adapter

`getContext, getLogger`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### ServerAdapter

    public ServerAdapter(Context context)

Constructor.

Parameters:
  `context` - The client context.

### Method Detail

#### addEntityHeaders

    protected void addEntityHeaders(HttpResponse response)

Adds the entity headers for the handled uniform call.

Parameters:
  `response` - The response returned.

#### addResponseHeaders

    protected void addResponseHeaders(HttpResponse response)

Adds the response headers for the handled uniform call.

Parameters:
  `response` - The response returned.

#### commit

    public void commit(HttpResponse response)

Commits the changes to a handled uniform call back into the original HTTP call. The default implementation first invokes the "addResponseHeaders" then asks the "htppCall" to send the response back to the client.

Parameters:
  `response` - The high-level response.

#### toRequest

    public HttpRequest toRequest(ServerCall httpCall)

Converts a low-level HTTP call into a high-level uniform request.

Parameters:
  `httpCall` - The low-level HTTP call.
Returns:
  A new high-level uniform request.