|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.restlet.engine.adapter.Call
org.restlet.engine.adapter.ClientCall
org.restlet.engine.connector.HttpUrlConnectionCall
public class HttpUrlConnectionCall
HTTP client connector call based on JDK's java.net.HttpURLConnection class. On the GAE edition, it also supports the SDC protocol by setting automatically the special "use_intranet" header.
| Constructor Summary | |
|---|---|
HttpUrlConnectionCall(HttpClientHelper helper,
String method,
String requestUri,
boolean hasEntity)
Constructor. |
|
| Method Summary | |
|---|---|
HttpURLConnection |
getConnection()
Returns the connection. |
HttpClientHelper |
getHelper()
Returns the HTTP client helper. |
String |
getReasonPhrase()
Returns the response reason phrase. |
protected Representation |
getRepresentation(InputStream stream)
Returns the representation wrapping the given stream. |
WritableByteChannel |
getRequestEntityChannel()
Returns the request entity channel if it exists. |
OutputStream |
getRequestEntityStream()
Returns the request entity stream if it exists. |
OutputStream |
getRequestHeadStream()
Returns the request head stream if it exists. |
OutputStream |
getRequestStream()
Returns the request entity stream if it exists. |
ReadableByteChannel |
getResponseEntityChannel(long size)
Returns the response channel if it exists. |
InputStream |
getResponseEntityStream(long size)
Returns the response entity stream if it exists. |
Series<Header> |
getResponseHeaders()
Returns the modifiable list of response headers. |
String |
getServerAddress()
Returns the response address. Corresponds to the IP address of the responding server. |
int |
getStatusCode()
Returns the response status code. |
Status |
sendRequest(Request request)
Sends the request to the client. |
void |
sendRequest(Request request,
Response response,
Uniform callback)
Sends the request to the client. |
| Methods inherited from class org.restlet.engine.adapter.ClientCall |
|---|
getContentLength, getLocalAddress, getResponseEntity, isClientKeepAlive, isServerKeepAlive, shouldRequestBeChunked |
| Methods inherited from class org.restlet.engine.adapter.Call |
|---|
getClientAddress, getClientPort, getHostDomain, getHostPort, getLogger, getMethod, getProtocol, getRepresentation, getRequestHeaders, getRequestUri, getServerPort, getUserPrincipal, getVersion, 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 |
| Constructor Detail |
|---|
public HttpUrlConnectionCall(HttpClientHelper helper,
String method,
String requestUri,
boolean hasEntity)
throws IOException
helper - The parent HTTP client helper.method - The method name.requestUri - The request URI.hasEntity - Indicates if the call will have an entity to send to the
server.
IOException| Method Detail |
|---|
public HttpURLConnection getConnection()
public HttpClientHelper getHelper()
getHelper in class ClientCallpublic String getReasonPhrase()
getReasonPhrase in class Callprotected Representation getRepresentation(InputStream stream)
Call
getRepresentation in class Callstream - The response input stream.
public WritableByteChannel getRequestEntityChannel()
ClientCall
getRequestEntityChannel in class ClientCallpublic OutputStream getRequestEntityStream()
ClientCall
getRequestEntityStream in class ClientCallpublic OutputStream getRequestHeadStream()
ClientCall
getRequestHeadStream in class ClientCallpublic OutputStream getRequestStream()
public ReadableByteChannel getResponseEntityChannel(long size)
ClientCall
getResponseEntityChannel in class ClientCallsize - The expected entity size or -1 if unknown.
public InputStream getResponseEntityStream(long size)
ClientCall
getResponseEntityStream in class ClientCallsize - The expected entity size or -1 if unknown.
public Series<Header> getResponseHeaders()
getResponseHeaders in class Callpublic String getServerAddress()
getServerAddress in class Call
public int getStatusCode()
throws IOException
getStatusCode in class CallIOException
IOExceptionpublic Status sendRequest(Request request)
sendRequest in class ClientCallrequest - The high-level request.
public void sendRequest(Request request,
Response response,
Uniform callback)
throws Exception
ClientCall
sendRequest in class ClientCallrequest - The high-level request.response - The high-level response.callback - The callback invoked upon request completion.
Exception
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||