|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.abdera.protocol.client.Client
org.apache.abdera.protocol.client.CommonsClient
public class CommonsClient
The primary Abdera HTTP Client
Field Summary |
---|
Fields inherited from class org.apache.abdera.protocol.client.Client |
---|
abdera, cache |
Constructor Summary | |
---|---|
CommonsClient()
Initialize the Commons Client using the default Abdera instance and User agent |
|
CommonsClient(Abdera abdera)
Initialize the Commons Client using the specified Abdera instance and default user agent |
|
CommonsClient(java.lang.String userAgent)
Initialize the Commons Client using the default Abdera instance and specified user agent |
|
CommonsClient(java.lang.String userAgent,
Abdera abdera)
Initialize the Commons Client using the specified Abdera instance and user agent |
Method Summary | |
---|---|
void |
addCredentials(java.lang.String target,
java.lang.String realm,
java.lang.String scheme,
org.apache.commons.httpclient.Credentials credentials)
Add a set of authentication credentials to the client. |
ClientResponse |
execute(java.lang.String method,
java.lang.String uri,
org.apache.commons.httpclient.methods.RequestEntity entity,
RequestOptions options)
Execute an arbitrary HTTP request |
RequestOptions |
getDefaultRequestOptions()
Get the default request options used by this client. |
void |
setAuthenticationSchemePriority(java.lang.String... scheme)
Set the order in which authentication schemes should be used. |
void |
teardown()
Per http://jakarta.apache.org/commons/httpclient/performance.html |
void |
usePreemptiveAuthentication(boolean val)
Configure the client to use preemptive authentication (HTTP Basic Authentication only) |
Methods inherited from class org.apache.abdera.protocol.client.Client |
---|
delete, delete, get, get, getCache, head, head, initCache, post, post, post, post, post, post, put, put, put, put, put, put, registerFactory, registerScheme, registerTrustManager, registerTrustManager, registerTrustManager, registerTrustManager |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CommonsClient()
public CommonsClient(Abdera abdera)
public CommonsClient(java.lang.String userAgent)
public CommonsClient(java.lang.String userAgent, Abdera abdera)
Method Detail |
---|
public void usePreemptiveAuthentication(boolean val)
usePreemptiveAuthentication
in class Client
public ClientResponse execute(java.lang.String method, java.lang.String uri, org.apache.commons.httpclient.methods.RequestEntity entity, RequestOptions options)
Client
execute
in class Client
method
- The method nameuri
- The URI to execute the request onentity
- The request entity to use for generating the requestoptions
- The options to use for this request
public RequestOptions getDefaultRequestOptions()
Client
getDefaultRequestOptions
in class Client
public void addCredentials(java.lang.String target, java.lang.String realm, java.lang.String scheme, org.apache.commons.httpclient.Credentials credentials) throws java.net.URISyntaxException
Client
addCredentials
in class Client
target
- The URI for which you wish to authenticaterealm
- The authentication realm these credentials apply to,
or null if the credentials apply to any realmscheme
- The authentication scheme these credentials apply to,
or null if the credentials apply to any schemecredentials
- The credentials to use
java.net.URISyntaxException
public void setAuthenticationSchemePriority(java.lang.String... scheme)
Client
setAuthenticationSchemePriority
in class Client
public void 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.
teardown
in class Client
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |