Package org.restlet.engine.adapter
Class ClientAdapter
java.lang.Object
org.restlet.engine.adapter.Adapter
org.restlet.engine.adapter.ClientAdapter
Converter of high-level uniform calls into low-level HTTP client calls.
- Author:
- Jerome Louvel
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcommit(ClientCall httpCall, Request request, Response response) Commits the changes to a handled HTTP client call back into the original uniform call.protected voidreadResponseHeaders(ClientCall httpCall, Response response) Reads the response headers of a handled HTTP client call to update the original uniform call.toSpecific(HttpClientHelper client, Request request) Converts a low-level HTTP call into a high-level uniform call.voidupdateResponse(Response response, Status status, ClientCall httpCall) Updates the response with information from the lower-level HTTP client call.Methods inherited from class org.restlet.engine.adapter.Adapter
getContext, getLogger
-
Constructor Details
-
ClientAdapter
Constructor.- Parameters:
context- The context to use.
-
-
Method Details
-
commit
Commits the changes to a handled HTTP client call back into the original uniform call. The default implementation first invokes the "addResponseHeaders" then asks the "htppCall" to send the response back to the client.- Parameters:
httpCall- The original HTTP call.request- The high-level request.response- The high-level response.- Throws:
Exception
-
readResponseHeaders
Reads the response headers of a handled HTTP client call to update the original uniform call.- Parameters:
httpCall- The handled HTTP client call.response- The high-level response to update.
-
toSpecific
Converts a low-level HTTP call into a high-level uniform call.- Parameters:
client- The HTTP client that will handle the call.request- The high-level request.- Returns:
- A new high-level uniform call.
-
updateResponse
Updates the response with information from the lower-level HTTP client call.- Parameters:
response- The response to update.status- The response status to apply.httpCall- The source HTTP client call.- Throws:
IOException
-