com.noelios.restlet.http
Class HttpServerConverter

java.lang.Object
  extended by com.noelios.restlet.http.HttpConverter
      extended by com.noelios.restlet.http.HttpServerConverter

public class HttpServerConverter
extends HttpConverter

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

Author:
Jerome Louvel

Constructor Summary
HttpServerConverter(Context context)
          Constructor.
 
Method Summary
protected  void addEntityHeaders(HttpResponse response)
          Adds the entity headers for the handled uniform call.
static void addEntityHeaders(Representation entity, Series<Parameter> responseHeaders)
          Copies the entity headers from the Representation to the Series.
protected  void addResponseHeaders(HttpResponse response)
          Adds the response headers for the handled uniform call.
static void addResponseHeaders(Response response, Series<Parameter> responseHeaders)
          Copies the headers from the Response to the given Series.
 void commit(HttpResponse response)
          Commits the changes to a handled uniform call back into the original HTTP call.
 HttpRequest toRequest(HttpServerCall httpCall)
          Converts a low-level HTTP call into a high-level uniform request.
 
Methods inherited from class com.noelios.restlet.http.HttpConverter
addAdditionalHeaders, getContext, getLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HttpServerConverter

public HttpServerConverter(Context context)
Constructor.

Parameters:
context - The client context.
Method Detail

addEntityHeaders

public static void addEntityHeaders(Representation entity,
                                    Series<Parameter> responseHeaders)
Copies the entity headers from the Representation to the Series.

Parameters:
entity - The Representation to copy the headers from.
responseHeaders - The Series to copy the headers to.

addResponseHeaders

public static void addResponseHeaders(Response response,
                                      Series<Parameter> responseHeaders)
                               throws java.lang.IllegalArgumentException
Copies the headers from the Response to the given Series.

Parameters:
response - The Response to copy the headers from.
responseHeaders - The Series to copy the headers to.
Throws:
java.lang.IllegalArgumentException

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(HttpServerCall 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.


Copyright © 2005-2008 Noelios Technologies.