|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.noelios.restlet.http.HttpCall
com.noelios.restlet.http.HttpClientCall
public abstract class HttpClientCall
Low-level HTTP client call.
Constructor Summary | |
---|---|
HttpClientCall(HttpClientHelper helper,
java.lang.String method,
java.lang.String requestUri)
Constructor setting the request address to the local host. |
Method Summary | |
---|---|
static Representation |
copyResponseEntityHeaders(java.lang.Iterable<Parameter> responseHeaders,
Representation representation)
Copies entity headers into a response and ensures that a non null representation is returned when at least one entity header is present. |
protected long |
getContentLength()
Returns the content length of the request entity if know, Representation.UNKNOWN_SIZE otherwise. |
HttpClientHelper |
getHelper()
Returns the HTTP client helper. |
static java.lang.String |
getLocalAddress()
Returns the local IP address or 127.0.0.1 if the resolution fails. |
protected Representation |
getRepresentation(java.io.InputStream stream)
Returns the representation wrapping the given stream. |
protected Representation |
getRepresentation(java.nio.channels.ReadableByteChannel channel)
Returns the representation wrapping the given channel. |
abstract java.nio.channels.WritableByteChannel |
getRequestEntityChannel()
Returns the request entity channel if it exists. |
abstract java.io.OutputStream |
getRequestEntityStream()
Returns the request entity stream if it exists. |
abstract java.io.OutputStream |
getRequestHeadStream()
Returns the request head stream if it exists. |
Representation |
getResponseEntity(Response response)
Returns the response entity if available. |
abstract java.nio.channels.ReadableByteChannel |
getResponseEntityChannel(long size)
Returns the response channel if it exists. |
abstract java.io.InputStream |
getResponseEntityStream(long size)
Returns the response entity stream if it exists. |
protected boolean |
isClientKeepAlive()
Indicates if the client wants a persistent connection. |
protected boolean |
isServerKeepAlive()
Indicates if the server wants a persistent connection. |
static java.lang.String |
parseContentDisposition(java.lang.String value)
Parse the Content-Disposition header value |
Status |
sendRequest(Request request)
Sends the request to the client. |
protected boolean |
shouldRequestBeChunked(Request request)
Indicates if the request entity should be chunked. |
Methods inherited from class com.noelios.restlet.http.HttpCall |
---|
formatDate, getClientAddress, getClientPort, getConnectorService, getContentLength, getHostDomain, getHostPort, getLogger, getMethod, getProtocol, getReasonPhrase, getRequestHeaders, getRequestUri, getResponseHeaders, getServerAddress, getServerPort, getStatusCode, getVersion, isConfidential, isConnectionBroken, isKeepAlive, isRequestChunked, isResponseChunked, parseDate, setClientAddress, setClientPort, setConfidential, setHostDomain, setHostPort, setMethod, setProtocol, setReasonPhrase, setRequestUri, setServerAddress, setServerPort, setStatusCode, setVersion |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public HttpClientCall(HttpClientHelper helper, java.lang.String method, java.lang.String requestUri)
helper
- The parent HTTP client helper.method
- The method name.requestUri
- The request URI.Method Detail |
---|
public static Representation copyResponseEntityHeaders(java.lang.Iterable<Parameter> responseHeaders, Representation representation) throws java.lang.NumberFormatException
responseHeaders
- The headers to copy.representation
- The Representation to update.
java.lang.NumberFormatException
Engine.copyResponseHeaders(Response, Series)
,
HttpClientConverter.copyResponseTransportHeaders(Iterable, Response)
public static java.lang.String getLocalAddress()
public static java.lang.String parseContentDisposition(java.lang.String value)
value
- Content-disposition header
protected long getContentLength()
Representation.UNKNOWN_SIZE
otherwise.
public HttpClientHelper getHelper()
protected Representation getRepresentation(java.io.InputStream stream)
stream
- The response input stream.
protected Representation getRepresentation(java.nio.channels.ReadableByteChannel channel)
channel
- The response channel.
public abstract java.nio.channels.WritableByteChannel getRequestEntityChannel()
public abstract java.io.OutputStream getRequestEntityStream()
public abstract java.io.OutputStream getRequestHeadStream()
public Representation getResponseEntity(Response response)
response
- the Response to get the entity from
public abstract java.nio.channels.ReadableByteChannel getResponseEntityChannel(long size)
size
- The expected entity size or -1 if unknown.
public abstract java.io.InputStream getResponseEntityStream(long size)
size
- The expected entity size or -1 if unknown.
protected boolean isClientKeepAlive()
HttpCall
isClientKeepAlive
in class HttpCall
protected boolean isServerKeepAlive()
HttpCall
isServerKeepAlive
in class HttpCall
public Status sendRequest(Request request)
request
- The high-level request.
protected boolean shouldRequestBeChunked(Request request)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |