public class ApacheHttpClientState
extends java.lang.Object
HttpState that provides easier
functionality for setting up credentials and proxy credentials.| Constructor and Description |
|---|
ApacheHttpClientState()
Create a new instance with a default instance of an Apache HTTP state.
|
ApacheHttpClientState(org.apache.commons.httpclient.HttpState state)
Create a new state instance with an Apacahe HTTP state instance.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clearCredentials()
Clears all credentials.
|
void |
clearProxyCredentials()
Clears all proxy credentials.
|
org.apache.commons.httpclient.HttpState |
getHttpState()
Get the HTTP state.
|
void |
setCredentials(java.lang.String realm,
java.lang.String host,
int port,
java.lang.String usernamepassword)
Sets the credentials for the given authentication scope.
|
void |
setCredentials(java.lang.String realm,
java.lang.String host,
int port,
java.lang.String username,
java.lang.String password)
Sets the credentials for the given authentication scope.
|
void |
setCredentials(java.lang.String realm,
java.lang.String host,
int port,
java.lang.String username,
java.lang.String password,
java.lang.String domain,
java.lang.String thisHost)
Sets the credentials for the given authentication scope.
|
void |
setProxyCredentials(java.lang.String realm,
java.lang.String host,
int port,
java.lang.String usernamepassword)
Sets the proxy credentials for the given authentication scope.
|
void |
setProxyCredentials(java.lang.String realm,
java.lang.String host,
int port,
java.lang.String username,
java.lang.String password)
Sets the proxy credentials for the given authentication scope.
|
void |
setProxyCredentials(java.lang.String realm,
java.lang.String host,
int port,
java.lang.String username,
java.lang.String password,
java.lang.String domain,
java.lang.String thisHost)
Sets the proxy credentials for the given authentication scope.
|
public ApacheHttpClientState()
public ApacheHttpClientState(org.apache.commons.httpclient.HttpState state)
state - the Apache HTTP state.public void setCredentials(java.lang.String realm,
java.lang.String host,
int port,
java.lang.String usernamepassword)
realm - The authentication realm. The null realm
signifies default credentials for the given host, which should
be used when no credentials have been explicitly supplied for
the challenging realm.host - The host the realm belongs to. The null host
signifies default credentials which should be used when no
credentials have been explicitly supplied for the challenging
host.port - The port the realm belongs to. A negitive port
signifies the credentials are applicaple to any port when no
credentials have been explicitly supplied for the challenging
port.usernamepassword - The username:password formed string.public void setCredentials(java.lang.String realm,
java.lang.String host,
int port,
java.lang.String username,
java.lang.String password)
realm - The authentication realm. The null realm
signifies default credentials for the given host, which should
be used when no credentials have been explicitly supplied for
the challenging realm.host - The host the realm belongs to. The null host
signifies default credentials which should be used when no
credentials have been explicitly supplied for the challenging
host.port - The port the realm belongs to. A negitive port
signifies the credentials are applicaple to any port when no
credentials have been explicitly supplied for the challenging
port.username - The usernamepassword - The passwordpublic void setCredentials(java.lang.String realm,
java.lang.String host,
int port,
java.lang.String username,
java.lang.String password,
java.lang.String domain,
java.lang.String thisHost)
realm - The authentication realm. The null realm
signifies default credentials for the given host, which should
be used when no credentials have been explicitly supplied for
the challenging realm.host - The host the realm belongs to. The null host
signifies default credentials which should be used when no
credentials have been explicitly supplied for the challenging
host.port - The port the realm belongs to. A negitive port
signifies the credentials are applicaple to any port when no
credentials have been explicitly supplied for the challenging
port.username - The username, this should not include the
domain to authenticate with. For example: "user" is correct
wheareas "DOMAIN\\user" is not.password - The passwordthisHost - The host the authentication requiest is originating
from. Essentially, the computer name for this machine.domain - The domain to authentice with.public void setProxyCredentials(java.lang.String realm,
java.lang.String host,
int port,
java.lang.String usernamepassword)
realm - The authentication realm. The null realm
signifies default credentials for the given host, which should
be used when no credentials have been explicitly supplied for
the challenging realm.host - The host the realm belongs to. The null host
signifies default credentials which should be used when no
credentials have been explicitly supplied for the challenging
host.port - The port the realm belongs to. A negitive port
signifies the credentials are applicaple to any port when no
credentials have been explicitly supplied for the challenging
port.usernamepassword - The username:password formed string.public void setProxyCredentials(java.lang.String realm,
java.lang.String host,
int port,
java.lang.String username,
java.lang.String password)
realm - The authentication realm. The null realm
signifies default credentials for the given host, which should
be used when no credentials have been explicitly supplied for
the challenging realm.host - The host the realm belongs to. The null host
signifies default credentials which should be used when no
credentials have been explicitly supplied for the challenging
host.port - The port the realm belongs to. A negitive port
signifies the credentials are applicaple to any port when no
credentials have been explicitly supplied for the challenging
port.username - The usernamepassword - The passwordpublic void setProxyCredentials(java.lang.String realm,
java.lang.String host,
int port,
java.lang.String username,
java.lang.String password,
java.lang.String domain,
java.lang.String thisHost)
realm - The authentication realm. The null realm
signifies default credentials for the given host, which should
be used when no credentials have been explicitly supplied for
the challenging realm.host - The host the realm belongs to. The null host
signifies default credentials which should be used when no
credentials have been explicitly supplied for the challenging
host.port - The port the realm belongs to. A negitive port
signifies the credentials are applicaple to any port when no
credentials have been explicitly supplied for the challenging
port.username - The username, this should not include the
domain to authenticate with. For example: "user" is correct
wheareas "DOMAIN\\user" is not.password - The passwordthisHost - The host the authentication requiest is originating
from. Essentially, the computer name for this machine.domain - The domain to authentice with.public void clearCredentials()
public void clearProxyCredentials()
public org.apache.commons.httpclient.HttpState getHttpState()
Copyright © 2016 Oracle Corporation. All Rights Reserved.