|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectio.keen.client.java.http.UrlConnectionHttpHandler
public class UrlConnectionHttpHandler
This class provides a default implementation of HttpHandler using
HttpURLConnection. To use a different HttpURLConnection implementation simply
override the execute(Request)} method.
| Constructor Summary | |
|---|---|
UrlConnectionHttpHandler()
|
|
| Method Summary | |
|---|---|
Response |
execute(Request request)
Sends an HTTP request. |
protected java.net.HttpURLConnection |
openConnection(Request request)
Opens a connection based on the URL in the given request. |
protected Response |
readResponse(java.net.HttpURLConnection connection)
Reads a Response from an existing connection. |
protected void |
sendRequest(java.net.HttpURLConnection connection,
Request request)
Sends a request over a given connection. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public UrlConnectionHttpHandler()
| Method Detail |
|---|
public Response execute(Request request)
throws java.io.IOException
execute in interface HttpHandlerrequest - The Request to send.
Response object describing the response from the server.
java.io.IOException - If there was an error during the connection.
protected java.net.HttpURLConnection openConnection(Request request)
throws java.io.IOException
HttpURLConnection.
request - The Request.
HttpURLConnection.
java.io.IOException - If there is an error opening the connection.
protected void sendRequest(java.net.HttpURLConnection connection,
Request request)
throws java.io.IOException
connection - The connection over which to send the request.request - The request to send.
java.io.IOException - If there is an error sending the request.
protected Response readResponse(java.net.HttpURLConnection connection)
throws java.io.IOException
Response from an existing connection. This method should only be
called on a connection for which the entire request has been sent.
connection - The connection that sent the response.
Response
java.io.IOException - If there is an error reading the response from the connection.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||