com.noelios.restlet.ext.net
Class HttpClientHelper

java.lang.Object
  extended by org.restlet.util.Helper
      extended by com.noelios.restlet.ConnectorHelper
          extended by com.noelios.restlet.ClientHelper
              extended by com.noelios.restlet.http.HttpClientHelper
                  extended by com.noelios.restlet.ext.net.HttpClientHelper

public class HttpClientHelper
extends HttpClientHelper

HTTP client connector using the HttpUrlConnectionCall. Here is the list of parameters that are supported:

Parameter name Value type Default value Description
chunkLength int 0 (uses HttpURLConnection's default) The chunk-length when using chunked encoding streaming mode for response entities. A value of -1 means chunked encoding is disabled for response entities.
followRedirects boolean false If true, the protocol will automatically follow redirects. If false, the protocol will not automatically follow redirects.
allowUserInteraction boolean false If true, this URL is being examined in a context in which it makes sense to allow user interactions such as popping up an authentication dialog.
useCaches boolean false If true, the protocol is allowed to use caching whenever it can.
connectTimeout int 0 Sets a specified timeout value, in milliseconds, to be used when opening a communications link to the resource referenced. 0 means infinite timeout.
readTimeout int 0 Sets the read timeout to a specified timeout, in milliseconds. A timeout of zero is interpreted as an infinite timeout.

Author:
Jerome Louvel (contact@noelios.com)
See Also:
Networking Features

Constructor Summary
HttpClientHelper(Client client)
          Constructor.
 
Method Summary
 HttpClientCall create(Request request)
          Creates a low-level HTTP client call from a high-level uniform call.
 int getChunkLength()
          Returns the chunk-length when using chunked encoding streaming mode for response entities.
 int getConnectTimeout()
          Returns the timeout value, in milliseconds, to be used when opening a communications link to the resource referenced.
 int getReadTimeout()
          Returns the read timeout value.
 boolean isAllowUserInteraction()
          Indicates if this URL is being examined in a context in which it makes sense to allow user interactions such as popping up an authentication dialog.
 boolean isFollowRedirects()
          Indicates if the protocol will automatically follow redirects.
 boolean isUseCaches()
          Indicates if the protocol is allowed to use caching whenever it can.
 
Methods inherited from class com.noelios.restlet.http.HttpClientHelper
getConverter, handle, setConverter
 
Methods inherited from class com.noelios.restlet.ClientHelper
getClient, getContext, getLogger, getParameters
 
Methods inherited from class com.noelios.restlet.ConnectorHelper
createContext, getProtocols, start, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HttpClientHelper

public HttpClientHelper(Client client)
Constructor.

Parameters:
client - The client to help.
Method Detail

create

public HttpClientCall create(Request request)
Creates a low-level HTTP client call from a high-level uniform call.

Specified by:
create in class HttpClientHelper
Parameters:
request - The high-level request.
Returns:
A low-level HTTP client call.

getChunkLength

public int getChunkLength()
Returns the chunk-length when using chunked encoding streaming mode for response entities. A value of -1 means chunked encoding is disabled for response entities.

Returns:
The chunk-length when using chunked encoding streaming mode for response entities.

isFollowRedirects

public boolean isFollowRedirects()
Indicates if the protocol will automatically follow redirects.

Returns:
True if the protocol will automatically follow redirects.

isAllowUserInteraction

public boolean isAllowUserInteraction()
Indicates if this URL is being examined in a context in which it makes sense to allow user interactions such as popping up an authentication dialog.

Returns:
True if it makes sense to allow user interactions.

isUseCaches

public boolean isUseCaches()
Indicates if the protocol is allowed to use caching whenever it can.

Returns:
True if the protocol is allowed to use caching whenever it can.

getConnectTimeout

public int getConnectTimeout()
Returns the timeout value, in milliseconds, to be used when opening a communications link to the resource referenced. 0 means infinite timeout.

Returns:
The connection timeout value.

getReadTimeout

public int getReadTimeout()
Returns the read timeout value. A timeout of zero is interpreted as an infinite timeout.

Returns:
The read timeout value.


Copyright © 2005-2007 Noelios Technologies.