com.ning.http.client
Class AsyncHttpClientConfig

java.lang.Object
  extended by com.ning.http.client.AsyncHttpClientConfig

public class AsyncHttpClientConfig
extends Object

Configuration class to use with a AsyncHttpClient. System property can be also used to configure this object default behavior by doing:

-Dcom.ning.http.client.AsyncHttpClientConfig.nameOfTheProperty ex:

-Dcom.ning.http.client.AsyncHttpClientConfig.defaultMaxTotalConnections -Dcom.ning.http.client.AsyncHttpClientConfig.defaultMaxTotalConnections -Dcom.ning.http.client.AsyncHttpClientConfig.defaultMaxConnectionsPerHost -Dcom.ning.http.client.AsyncHttpClientConfig.defaultConnectionTimeoutInMS -Dcom.ning.http.client.AsyncHttpClientConfig.defaultIdleConnectionTimeoutInMS -Dcom.ning.http.client.AsyncHttpClientConfig.defaultRequestTimeoutInMS -Dcom.ning.http.client.AsyncHttpClientConfig.defaultRedirectsEnabled -Dcom.ning.http.client.AsyncHttpClientConfig.defaultMaxRedirects


Nested Class Summary
static class AsyncHttpClientConfig.Builder
          Builder for an AsyncHttpClient
 
Method Summary
 ExecutorService executorService()
          Return the ExecutorService an AsyncHttpClient use for handling asynchronous response.
 AsyncHttpProviderConfig<?,?> getAsyncHttpProviderConfig()
          Return the AsyncHttpProviderConfig
 ConnectionsPool<?,?> getConnectionsPool()
          Return an instance of ConnectionsPool
 int getConnectionTimeoutInMs()
          Return the maximum time in millisecond an AsyncHttpClient can wait when connecting to a remote host
 int getIdleConnectionTimeoutInMs()
          Return the maximum time in millisecond an AsyncHttpClient can stay idle.
 boolean getKeepAlive()
          Is HTTP keep-alive enabled.
 int getMaxConnectionPerHost()
          Return the maximum number of connections per hosts an AsyncHttpClient can handle.
 int getMaxRedirects()
          Get the maximum number of HTTP redirect
 int getMaxTotalConnections()
          Return the maximum number of connections an AsyncHttpClient can handle.
 ProxyServer getProxyServer()
          An instance of ProxyServer used by an AsyncHttpClient
 Realm getRealm()
          Return the current Realm}
 int getRequestTimeoutInMs()
          Return the maximum time in millisecond an AsyncHttpClient wait for a response
 SSLContext getSSLContext()
          Return an instance of SSLContext used for SSL connection.
 SSLEngineFactory getSSLEngineFactory()
          Return an instance of SSLEngineFactory used for SSL connection.
 String getUserAgent()
          Return the USER_AGENT header value
 boolean isCompressionEnabled()
          Is HTTP compression enabled.
 boolean isRedirectEnabled()
          Is HTTP redirect enabled
 ScheduledExecutorService reaper()
          A ScheduledExecutorService used to expire idle connections.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

reaper

public ScheduledExecutorService reaper()
A ScheduledExecutorService used to expire idle connections.

Returns:
ScheduledExecutorService

getMaxTotalConnections

public int getMaxTotalConnections()
Return the maximum number of connections an AsyncHttpClient can handle.

Returns:
the maximum number of connections an AsyncHttpClient can handle.

getMaxConnectionPerHost

public int getMaxConnectionPerHost()
Return the maximum number of connections per hosts an AsyncHttpClient can handle.

Returns:
the maximum number of connections per host an AsyncHttpClient can handle.

getConnectionTimeoutInMs

public int getConnectionTimeoutInMs()
Return the maximum time in millisecond an AsyncHttpClient can wait when connecting to a remote host

Returns:
the maximum time in millisecond an AsyncHttpClient can wait when connecting to a remote host

getIdleConnectionTimeoutInMs

public int getIdleConnectionTimeoutInMs()
Return the maximum time in millisecond an AsyncHttpClient can stay idle.

Returns:
the maximum time in millisecond an AsyncHttpClient can stay idle.

getRequestTimeoutInMs

public int getRequestTimeoutInMs()
Return the maximum time in millisecond an AsyncHttpClient wait for a response

Returns:
the maximum time in millisecond an AsyncHttpClient wait for a response

isRedirectEnabled

public boolean isRedirectEnabled()
Is HTTP redirect enabled

Returns:
true if enabled.

getMaxRedirects

public int getMaxRedirects()
Get the maximum number of HTTP redirect

Returns:
the maximum number of HTTP redirect

getKeepAlive

public boolean getKeepAlive()
Is HTTP keep-alive enabled.

Returns:
true if keep-alive is enabled

getUserAgent

public String getUserAgent()
Return the USER_AGENT header value

Returns:
the USER_AGENT header value

isCompressionEnabled

public boolean isCompressionEnabled()
Is HTTP compression enabled.

Returns:
true if compression is enabled

executorService

public ExecutorService executorService()
Return the ExecutorService an AsyncHttpClient use for handling asynchronous response.

Returns:
the ExecutorService an AsyncHttpClient use for handling asynchronous response.

getProxyServer

public ProxyServer getProxyServer()
An instance of ProxyServer used by an AsyncHttpClient

Returns:
instance of ProxyServer

getSSLContext

public SSLContext getSSLContext()
Return an instance of SSLContext used for SSL connection.

Returns:
an instance of SSLContext used for SSL connection.

getConnectionsPool

public ConnectionsPool<?,?> getConnectionsPool()
Return an instance of ConnectionsPool

Returns:
an instance of ConnectionsPool

getSSLEngineFactory

public SSLEngineFactory getSSLEngineFactory()
Return an instance of SSLEngineFactory used for SSL connection.

Returns:
an instance of SSLEngineFactory used for SSL connection.

getAsyncHttpProviderConfig

public AsyncHttpProviderConfig<?,?> getAsyncHttpProviderConfig()
Return the AsyncHttpProviderConfig

Returns:
the AsyncHttpProviderConfig

getRealm

public Realm getRealm()
Return the current Realm}

Returns:
the current Realm}


Copyright © 2010. All Rights Reserved.