org.apache.abdera.protocol.client
Class AbderaClient

java.lang.Object
  extended by org.apache.abdera.protocol.client.AbderaClient

public class AbderaClient
extends Object

An Atom Publishing Protocol client.


Field Summary
protected  Abdera abdera
           
protected  Cache cache
           
static int DEFAULT_MAX_REDIRECTS
           
static String DEFAULT_USER_AGENT
           
 
Constructor Summary
AbderaClient()
           
AbderaClient(Abdera abdera)
          Create an AbderaClient instance using the specified Abdera instance
AbderaClient(Abdera abdera, Cache cache)
          Create an AbderaClient instance using the specified Abdera instance
AbderaClient(Abdera abdera, org.apache.commons.httpclient.HttpClient client)
          Create an Abdera using a preconfigured HttpClient object
AbderaClient(Abdera abdera, org.apache.commons.httpclient.HttpClient client, Cache cache)
          Create an Abdera using a preconfigured HttpClient object
AbderaClient(Abdera abdera, String useragent)
          Create an AbderaClient instance using the specified Abdera instance and useragent name
AbderaClient(Abdera abdera, String useragent, Cache cache)
          Create an AbderaClient instance using the specified Abdera instance and useragent name
AbderaClient(org.apache.commons.httpclient.HttpClient client)
          Create an Abdera using a preconfigured HttpClient object
AbderaClient(String useragent)
          Create an AbderaClient instance using the specified useragent name
 
Method Summary
 AbderaClient addCookie(String domain, String name, String value)
          Manually add cookies
 AbderaClient addCookie(String domain, String name, String value, String path, Date expires, boolean secure)
          Manually add cookies
 AbderaClient addCookie(String domain, String name, String value, String path, int maxAge, boolean secure)
          Manually add cookies
 AbderaClient addCookies(org.apache.commons.httpclient.Cookie... cookies)
          Manually add cookies
 AbderaClient addCookies(org.apache.commons.httpclient.Cookie cookie)
          Manually add cookies
 AbderaClient addCredentials(String target, String realm, String scheme, org.apache.commons.httpclient.Credentials credentials)
          Add authentication credentials
 AbderaClient clearCookies()
          Clear the cookies
 AbderaClient clearCredentials()
          Clear all credentials (including proxy credentials)
 AbderaClient clearProxyCredentials()
          Clear proxy credentials
 AbderaClient clearState()
          Clear all state (cookies, credentials, etc)
 ClientResponse delete(String uri)
          Sends an HTTP DELETE request to the specified URI using the default options
 ClientResponse delete(String uri, RequestOptions options)
          Sends an HTTP DELETE request to the specified URI.
 ClientResponse execute(String method, String uri, Base base, RequestOptions options)
          Sends the specified method request to the specified URI.
 ClientResponse execute(String method, String uri, EntityProvider provider, RequestOptions options)
          Sends the specified method request to the specified URI.
 ClientResponse execute(String method, String uri, InputStream in, RequestOptions options)
          Sends the specified method request to the specified URI.
 ClientResponse execute(String method, String uri, org.apache.commons.httpclient.methods.RequestEntity entity, RequestOptions options)
          Sends the specified method request to the specified URI.
 ClientResponse get(String uri)
          Sends an HTTP GET request to the specified URI using the default options
 ClientResponse get(String uri, RequestOptions options)
          Sends an HTTP GET request to the specified URI.
 String[] getAuthenticationSchemePriority()
          Returns the current listing of preferred authentication schemes, in order of preference
 Cache getCache()
          Returns the client HTTP cache instance
 long getConnectionManagerTimeout()
          Returns the timeout in milliseconds used when retrieving an HTTP connection from the HTTP connection manager.
 int getConnectionTimeout()
          Return the timeout until a connection is etablished, in milliseconds.
 org.apache.commons.httpclient.Cookie[] getCookies()
          Get all the cookies
 org.apache.commons.httpclient.Cookie[] getCookies(String domain)
          Get the cookies for a specific domain
 org.apache.commons.httpclient.Cookie[] getCookies(String domain, String path)
          Get the cookies for a specific domain and path
 RequestOptions getDefaultRequestOptions()
          Get a copy of the default request options
 org.apache.commons.httpclient.params.HttpClientParams getHttpClientParams()
          Return the HttpClientParams object of the underlying HttpClient.
 org.apache.commons.httpclient.params.HttpConnectionManagerParams getHttpConnectionManagerParams()
          Return the HttpConnectionManagerParams object of the underlying HttpClient.
 int getMaxConnectionsPerHost()
          Return the maximum number of connections allowed for a single host
 int getMaxConnectionsTotal()
          Return the maximum number of connections allowed for the client
 int getMaximumRedirects()
          Get the maximum number of redirects
 int getSocketTimeout()
          Return the socket timeout for the connection in milliseconds A timeout value of zero is interpreted as an infinite timeout.
 boolean getTcpNoDelay()
          Tests if Nagle's algorithm is to be used.
 ClientResponse head(String uri)
          Sends an HTTP HEAD request to the specified URI using the default options
 ClientResponse head(String uri, RequestOptions options)
          Sends an HTTP HEAD request to the specified URI.
static Cache initCache(Abdera abdera)
          Initializes the client HTTP cache
 Cache initCache(CacheFactory factory)
          Deprecated. The CacheFactory interface is no longer used.
 ClientResponse post(String uri, Base base)
          Sends an HTTP POST request to the specified URI using the default options
 ClientResponse post(String uri, Base base, RequestOptions options)
          Sends an HTTP POST request to the specified URI.
 ClientResponse post(String uri, EntityProvider provider)
          Sends an HTTP POST request to the specified URI using the default options
 ClientResponse post(String uri, EntityProvider provider, RequestOptions options)
          Sends an HTTP POST request to the specified URI.
 ClientResponse post(String uri, Entry entry, InputStream media)
          Sends an HTTP POST request to the specified URI.
 ClientResponse post(String uri, Entry entry, InputStream media, RequestOptions options)
          Sends an HTTP POST request to the specified URI.
 ClientResponse post(String uri, Entry entry, InputStream media, String contentType, RequestOptions options)
          Sends an HTTP POST request to the specified URI.
 ClientResponse post(String uri, InputStream in)
          Sends an HTTP POST request to the specified URI using the default options
 ClientResponse post(String uri, InputStream in, RequestOptions options)
          Sends an HTTP POST request to the specified URI.
 ClientResponse post(String uri, org.apache.commons.httpclient.methods.RequestEntity entity)
          Sends an HTTP POST request to the specified URI using the default options
 ClientResponse post(String uri, org.apache.commons.httpclient.methods.RequestEntity entity, RequestOptions options)
          Sends an HTTP POST request to the specified URI.
 ClientResponse put(String uri, Base base)
          Sends an HTTP PUT request to the specified URI using the default options
 ClientResponse put(String uri, Base base, RequestOptions options)
          Sends an HTTP PUT request to the specified URI.
 ClientResponse put(String uri, EntityProvider provider)
          Sends an HTTP PUT request to the specified URI using the default options
 ClientResponse put(String uri, EntityProvider provider, RequestOptions options)
          Sends an HTTP PUT request to the specified URI.
 ClientResponse put(String uri, InputStream in)
          Sends an HTTP PUT request to the specified URI using the default options
 ClientResponse put(String uri, InputStream in, RequestOptions options)
          Sends an HTTP PUT request to the specified URI.
 ClientResponse put(String uri, org.apache.commons.httpclient.methods.RequestEntity entity)
          Sends an HTTP PUT request to the specified URI using the default options
 ClientResponse put(String uri, org.apache.commons.httpclient.methods.RequestEntity entity, RequestOptions options)
          Sends an HTTP PUT request to the specified URI.
static void registerFactory(org.apache.commons.httpclient.protocol.SecureProtocolSocketFactory factory, int port)
          Register the specified secure socket factory on the specified port
static void registerScheme(String name, Class<? extends org.apache.commons.httpclient.auth.AuthScheme> scheme)
          Register a new authentication scheme.
static void registerTrustManager()
          Register the default TrustManager for SSL support on the default port (443)
static void registerTrustManager(int port)
          Register the default trust manager on the specified port
static void registerTrustManager(TrustManager trustManager)
          Register the specified TrustManager for SSL support on the default port (443)
static void registerTrustManager(TrustManager trustManager, int port)
          Register the specified TrustManager for SSL support on the specified port
 AbderaClient setAuthenticationSchemeDefaults()
          Configure the client to use the default authentication scheme settings
 AbderaClient setAuthenticationSchemePriority(String... scheme)
          When multiple authentication schemes are supported by a server, the client will automatically select a scheme based on the configured priority.
 void setConnectionManagerTimeout(long timeout)
          Sets the timeout in milliseconds used when retrieving an HTTP connection from the HTTP connection manager.
 AbderaClient setConnectionTimeout(int timeout)
          Sets the timeout until a connection is etablished.
 AbderaClient setMaxConnectionsPerHost(int max)
          Set the maximum number of connections allowed for a single host
 AbderaClient setMaxConnectionsTotal(int max)
          Return the maximum number of connections allowed for the client
 AbderaClient setMaximumRedirects(int redirects)
          Set the maximum number of redirects
 AbderaClient setProxy(String host, int port)
          Configure the client to use the specified proxy
 AbderaClient setProxyCredentials(String host, int port, org.apache.commons.httpclient.Credentials credentials)
          Specify the auth credentials for the proxy server
 AbderaClient setProxyCredentials(String host, int port, String realm, String scheme, org.apache.commons.httpclient.Credentials credentials)
          Specify the auth credentials for the proxy server
 AbderaClient setSocketTimeout(int timeout)
          Sets the default socket timeout (SO_TIMEOUT) in milliseconds which is the timeout for waiting for data.
 void setTcpNoDelay(boolean enable)
          Determines whether Nagle's algorithm is to be used.
 AbderaClient teardown()
           Per http://jakarta.apache.org/commons/httpclient/performance.html Generally it is recommended to have a single instance of HttpClient per communication component or even per application.
static void unregisterScheme(String... names)
          Unregister multiple HTTP authentication schemes
static void unregisterScheme(String name)
          Unregister a specific authentication scheme
 AbderaClient usePreemptiveAuthentication(boolean val)
          Configure the client to use preemptive authentication (HTTP Basic Authentication only)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_USER_AGENT

public static final String DEFAULT_USER_AGENT
See Also:
Constant Field Values

DEFAULT_MAX_REDIRECTS

public static int DEFAULT_MAX_REDIRECTS

abdera

protected final Abdera abdera

cache

protected final Cache cache
Constructor Detail

AbderaClient

public AbderaClient()

AbderaClient

public AbderaClient(String useragent)
Create an AbderaClient instance using the specified useragent name

Parameters:
useragent -

AbderaClient

public AbderaClient(Abdera abdera,
                    String useragent)
Create an AbderaClient instance using the specified Abdera instance and useragent name

Parameters:
abdera -
useragent -

AbderaClient

public AbderaClient(Abdera abdera,
                    String useragent,
                    Cache cache)
Create an AbderaClient instance using the specified Abdera instance and useragent name

Parameters:
abdera -
useragent -

AbderaClient

public AbderaClient(org.apache.commons.httpclient.HttpClient client)
Create an Abdera using a preconfigured HttpClient object

Parameters:
client - An Apache HttpClient object

AbderaClient

public AbderaClient(Abdera abdera,
                    org.apache.commons.httpclient.HttpClient client)
Create an Abdera using a preconfigured HttpClient object

Parameters:
abdera -
client - An Apache HttpClient object

AbderaClient

public AbderaClient(Abdera abdera,
                    org.apache.commons.httpclient.HttpClient client,
                    Cache cache)
Create an Abdera using a preconfigured HttpClient object

Parameters:
abdera -
client - An Apache HttpClient object

AbderaClient

public AbderaClient(Abdera abdera)
Create an AbderaClient instance using the specified Abdera instance

Parameters:
abdera -

AbderaClient

public AbderaClient(Abdera abdera,
                    Cache cache)
Create an AbderaClient instance using the specified Abdera instance

Parameters:
abdera -
Method Detail

getCache

public Cache getCache()
Returns the client HTTP cache instance


initCache

public Cache initCache(CacheFactory factory)
Deprecated. The CacheFactory interface is no longer used.


initCache

public static Cache initCache(Abdera abdera)
Initializes the client HTTP cache


head

public ClientResponse head(String uri,
                           RequestOptions options)
Sends an HTTP HEAD request to the specified URI.

Parameters:
uri - The request URI
options - The request options

get

public ClientResponse get(String uri,
                          RequestOptions options)
Sends an HTTP GET request to the specified URI.

Parameters:
uri - The request URI
options - The request options

post

public ClientResponse post(String uri,
                           EntityProvider provider,
                           RequestOptions options)
Sends an HTTP POST request to the specified URI.

Parameters:
uri - The request URI
provider - An EntityProvider implementation providing the payload of the request
options - The request options

post

public ClientResponse post(String uri,
                           org.apache.commons.httpclient.methods.RequestEntity entity,
                           RequestOptions options)
Sends an HTTP POST request to the specified URI.

Parameters:
uri - The request URI
entity - A RequestEntity object providing the payload of the request
options - The request options

post

public ClientResponse post(String uri,
                           InputStream in,
                           RequestOptions options)
Sends an HTTP POST request to the specified URI.

Parameters:
uri - The request URI
in - An InputStream providing the payload of the request
options - The request options

post

public ClientResponse post(String uri,
                           Base base,
                           RequestOptions options)
Sends an HTTP POST request to the specified URI.

Parameters:
uri - The request URI
base - An Abdera FOM Document or Element object providing the payload of the request
options - The request options

post

public ClientResponse post(String uri,
                           Entry entry,
                           InputStream media)
Sends an HTTP POST request to the specified URI. It uses the media and entry parameters to create a multipart/related object. If the contentType is not provided this method tries to get it from the type attribute of the entry content.

Parameters:
uri - The request URI
entry - The entry that will be sent as the first element of the multipart/related object
media - The media object that will be sent as the second element of the multipart/related object

post

public ClientResponse post(String uri,
                           Entry entry,
                           InputStream media,
                           RequestOptions options)
Sends an HTTP POST request to the specified URI. It uses the media and entry parameters to create a multipart/related object. If the contentType is not provided this method tries to get it from the type attribute of the entry content.

Parameters:
uri - The request URI
entry - The entry that will be sent as the first element of the multipart/related object
media - The media object that will be sent as the second element of the multipart/related object
options - The request options

post

public ClientResponse post(String uri,
                           Entry entry,
                           InputStream media,
                           String contentType,
                           RequestOptions options)
Sends an HTTP POST request to the specified URI. It uses the media and entry parameters to create a multipart/related object.

Parameters:
uri - The request URI
entry - The entry that will be sent as the first element of the multipart/related object
media - The media object that will be sent as the second element of the multipart/related object
contentType - the content type of the media object
options - The request options

put

public ClientResponse put(String uri,
                          EntityProvider provider,
                          RequestOptions options)
Sends an HTTP PUT request to the specified URI.

Parameters:
uri - The request URI
provider - An EntityProvider implementation providing the payload of the request
options - The request options

put

public ClientResponse put(String uri,
                          org.apache.commons.httpclient.methods.RequestEntity entity,
                          RequestOptions options)
Sends an HTTP PUT request to the specified URI.

Parameters:
uri - The request URI
entity - A RequestEntity object providing the payload of the request
options - The request options

put

public ClientResponse put(String uri,
                          InputStream in,
                          RequestOptions options)
Sends an HTTP PUT request to the specified URI.

Parameters:
uri - The request URI
in - An InputStream providing the payload of the request
options - The request options

put

public ClientResponse put(String uri,
                          Base base,
                          RequestOptions options)
Sends an HTTP PUT request to the specified URI.

Parameters:
uri - The request URI
base - A FOM Document or Element providing the payload of the request
options - The request options

delete

public ClientResponse delete(String uri,
                             RequestOptions options)
Sends an HTTP DELETE request to the specified URI.

Parameters:
uri - The request URI
options - The request options

head

public ClientResponse head(String uri)
Sends an HTTP HEAD request to the specified URI using the default options

Parameters:
uri - The request URI

get

public ClientResponse get(String uri)
Sends an HTTP GET request to the specified URI using the default options

Parameters:
uri - The request URI

post

public ClientResponse post(String uri,
                           EntityProvider provider)
Sends an HTTP POST request to the specified URI using the default options

Parameters:
uri - The request URI
provider - An EntityProvider implementation providing the payload the request

post

public ClientResponse post(String uri,
                           org.apache.commons.httpclient.methods.RequestEntity entity)
Sends an HTTP POST request to the specified URI using the default options

Parameters:
uri - The request URI
entity - A RequestEntity object providing the payload of the request

post

public ClientResponse post(String uri,
                           InputStream in)
Sends an HTTP POST request to the specified URI using the default options

Parameters:
uri - The request URI
in - An InputStream providing the payload of the request

post

public ClientResponse post(String uri,
                           Base base)
Sends an HTTP POST request to the specified URI using the default options

Parameters:
uri - The request URI
base - A FOM Document or Element providing the payload of the request

put

public ClientResponse put(String uri,
                          EntityProvider provider)
Sends an HTTP PUT request to the specified URI using the default options

Parameters:
uri - The request URI
provider - An EntityProvider implementation providing the payload of the request

put

public ClientResponse put(String uri,
                          org.apache.commons.httpclient.methods.RequestEntity entity)
Sends an HTTP PUT request to the specified URI using the default options

Parameters:
uri - The request URI
entity - A RequestEntity object providing the payload of the request

put

public ClientResponse put(String uri,
                          InputStream in)
Sends an HTTP PUT request to the specified URI using the default options

Parameters:
uri - The request URI
in - An InputStream providing the payload of the request

put

public ClientResponse put(String uri,
                          Base base)
Sends an HTTP PUT request to the specified URI using the default options

Parameters:
uri - The request URI
base - A FOM Document or Element providing the payload of the request

delete

public ClientResponse delete(String uri)
Sends an HTTP DELETE request to the specified URI using the default options

Parameters:
uri - The request URI

registerScheme

public static void registerScheme(String name,
                                  Class<? extends org.apache.commons.httpclient.auth.AuthScheme> scheme)
Register a new authentication scheme.

Parameters:
name -
scheme -

unregisterScheme

public static void unregisterScheme(String name)
Unregister a specific authentication scheme

Parameters:
name - The name of the authentication scheme (e.g. "basic", "digest", etc)

unregisterScheme

public static void unregisterScheme(String... names)
Unregister multiple HTTP authentication schemes


registerTrustManager

public static void registerTrustManager(TrustManager trustManager)
Register the specified TrustManager for SSL support on the default port (443)

Parameters:
trustManager - The TrustManager implementation

registerTrustManager

public static void registerTrustManager()
Register the default TrustManager for SSL support on the default port (443)


registerTrustManager

public static void registerTrustManager(TrustManager trustManager,
                                        int port)
Register the specified TrustManager for SSL support on the specified port

Parameters:
trustManager - The TrustManager implementation
port - The port

registerTrustManager

public static void registerTrustManager(int port)
Register the default trust manager on the specified port

Parameters:
port - The port

registerFactory

public static void registerFactory(org.apache.commons.httpclient.protocol.SecureProtocolSocketFactory factory,
                                   int port)
Register the specified secure socket factory on the specified port


usePreemptiveAuthentication

public AbderaClient usePreemptiveAuthentication(boolean val)
Configure the client to use preemptive authentication (HTTP Basic Authentication only)


execute

public ClientResponse execute(String method,
                              String uri,
                              Base base,
                              RequestOptions options)
Sends the specified method request to the specified URI. This can be used to send extension HTTP methods to a server (e.g. PATCH, LOCK, etc)

Parameters:
method - The HTTP method
uri - The request URI
base - A FOM Document and Element providing the payload for the request
options - The Request Options

execute

public ClientResponse execute(String method,
                              String uri,
                              EntityProvider provider,
                              RequestOptions options)
Sends the specified method request to the specified URI. This can be used to send extension HTTP methods to a server (e.g. PATCH, LOCK, etc)

Parameters:
method - The HTTP method
uri - The request URI
provider - An EntityProvider implementation providing the payload of the request
options - The Request Options

execute

public ClientResponse execute(String method,
                              String uri,
                              InputStream in,
                              RequestOptions options)
Sends the specified method request to the specified URI. This can be used to send extension HTTP methods to a server (e.g. PATCH, LOCK, etc)

Parameters:
method - The HTTP method
uri - The request URI
in - An InputStream providing the payload of the request
options - The Request Options

execute

public ClientResponse execute(String method,
                              String uri,
                              org.apache.commons.httpclient.methods.RequestEntity entity,
                              RequestOptions options)
Sends the specified method request to the specified URI. This can be used to send extension HTTP methods to a server (e.g. PATCH, LOCK, etc)

Parameters:
method - The HTTP method
uri - The request URI
entity - A RequestEntity object providing the payload for the request
options - The Request Options

getDefaultRequestOptions

public RequestOptions getDefaultRequestOptions()
Get a copy of the default request options


addCredentials

public AbderaClient addCredentials(String target,
                                   String realm,
                                   String scheme,
                                   org.apache.commons.httpclient.Credentials credentials)
                            throws URISyntaxException
Add authentication credentials

Throws:
URISyntaxException

setAuthenticationSchemeDefaults

public AbderaClient setAuthenticationSchemeDefaults()
Configure the client to use the default authentication scheme settings


setAuthenticationSchemePriority

public AbderaClient setAuthenticationSchemePriority(String... scheme)
When multiple authentication schemes are supported by a server, the client will automatically select a scheme based on the configured priority. For instance, to tell the client to prefer "digest" over "basic", set the priority by calling setAuthenticationSchemePriority("digest","basic")


getAuthenticationSchemePriority

public String[] getAuthenticationSchemePriority()
Returns the current listing of preferred authentication schemes, in order of preference

See Also:
setAuthenticationSchemePriority

teardown

public AbderaClient teardown()

Per http://jakarta.apache.org/commons/httpclient/performance.html

Generally it is recommended to have a single instance of HttpClient per communication component or even per application. However, if the application makes use of HttpClient only very infrequently, and keeping an idle instance of HttpClient in memory is not warranted, it is highly recommended to explicitly shut down the multithreaded connection manager prior to disposing the HttpClient instance. This will ensure proper closure of all HTTP connections in the connection pool.


setMaxConnectionsPerHost

public AbderaClient setMaxConnectionsPerHost(int max)
Set the maximum number of connections allowed for a single host


getMaxConnectionsPerHost

public int getMaxConnectionsPerHost()
Return the maximum number of connections allowed for a single host


setMaxConnectionsTotal

public AbderaClient setMaxConnectionsTotal(int max)
Return the maximum number of connections allowed for the client


getMaxConnectionsTotal

public int getMaxConnectionsTotal()
Return the maximum number of connections allowed for the client


setProxy

public AbderaClient setProxy(String host,
                             int port)
Configure the client to use the specified proxy


setProxyCredentials

public AbderaClient setProxyCredentials(String host,
                                        int port,
                                        org.apache.commons.httpclient.Credentials credentials)
Specify the auth credentials for the proxy server


setProxyCredentials

public AbderaClient setProxyCredentials(String host,
                                        int port,
                                        String realm,
                                        String scheme,
                                        org.apache.commons.httpclient.Credentials credentials)
Specify the auth credentials for the proxy server


addCookie

public AbderaClient addCookie(String domain,
                              String name,
                              String value)
Manually add cookies


addCookie

public AbderaClient addCookie(String domain,
                              String name,
                              String value,
                              String path,
                              Date expires,
                              boolean secure)
Manually add cookies


addCookie

public AbderaClient addCookie(String domain,
                              String name,
                              String value,
                              String path,
                              int maxAge,
                              boolean secure)
Manually add cookies


addCookies

public AbderaClient addCookies(org.apache.commons.httpclient.Cookie cookie)
Manually add cookies


addCookies

public AbderaClient addCookies(org.apache.commons.httpclient.Cookie... cookies)
Manually add cookies


getCookies

public org.apache.commons.httpclient.Cookie[] getCookies()
Get all the cookies


getCookies

public org.apache.commons.httpclient.Cookie[] getCookies(String domain,
                                                         String path)
Get the cookies for a specific domain and path


getCookies

public org.apache.commons.httpclient.Cookie[] getCookies(String domain)
Get the cookies for a specific domain


clearCookies

public AbderaClient clearCookies()
Clear the cookies


setConnectionTimeout

public AbderaClient setConnectionTimeout(int timeout)
Sets the timeout until a connection is etablished. A value of zero means the timeout is not used. The default value is zero.


setSocketTimeout

public AbderaClient setSocketTimeout(int timeout)
Sets the default socket timeout (SO_TIMEOUT) in milliseconds which is the timeout for waiting for data. A timeout value of zero is interpreted as an infinite timeout.


setConnectionManagerTimeout

public void setConnectionManagerTimeout(long timeout)
Sets the timeout in milliseconds used when retrieving an HTTP connection from the HTTP connection manager.


getConnectionTimeout

public int getConnectionTimeout()
Return the timeout until a connection is etablished, in milliseconds. A value of zero means the timeout is not used. The default value is zero.


getSocketTimeout

public int getSocketTimeout()
Return the socket timeout for the connection in milliseconds A timeout value of zero is interpreted as an infinite timeout.


getConnectionManagerTimeout

public long getConnectionManagerTimeout()
Returns the timeout in milliseconds used when retrieving an HTTP connection from the HTTP connection manager.


setTcpNoDelay

public void setTcpNoDelay(boolean enable)
Determines whether Nagle's algorithm is to be used. The Nagle's algorithm tries to conserve bandwidth by minimizing the number of segments that are sent. When applications wish to decrease network latency and increase performance, they can disable Nagle's algorithm (that is enable TCP_NODELAY). Data will be sent earlier, at the cost of an increase in bandwidth consumption.


getTcpNoDelay

public boolean getTcpNoDelay()
Tests if Nagle's algorithm is to be used.


getHttpConnectionManagerParams

public org.apache.commons.httpclient.params.HttpConnectionManagerParams getHttpConnectionManagerParams()
Return the HttpConnectionManagerParams object of the underlying HttpClient. This enables you to configure options not explicitly exposed by the AbderaClient


getHttpClientParams

public org.apache.commons.httpclient.params.HttpClientParams getHttpClientParams()
Return the HttpClientParams object of the underlying HttpClient. This enables you to configure options not explicitly exposed by the AbderaClient


setMaximumRedirects

public AbderaClient setMaximumRedirects(int redirects)
Set the maximum number of redirects


getMaximumRedirects

public int getMaximumRedirects()
Get the maximum number of redirects


clearCredentials

public AbderaClient clearCredentials()
Clear all credentials (including proxy credentials)


clearProxyCredentials

public AbderaClient clearProxyCredentials()
Clear proxy credentials


clearState

public AbderaClient clearState()
Clear all state (cookies, credentials, etc)



Copyright © 2006-2010 Apache Software Foundation. All Rights Reserved.