|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.microsoft.tfs.core.httpclient.HttpState
public class HttpState
A container for HTTP attributes that may persist from request to request,
such as cookies and authentication credentials.
| Field Summary | |
|---|---|
protected java.util.ArrayList<Cookie> |
cookies
Array of cookies that this HTTP state contains. |
protected java.util.HashMap<AuthScope,Credentials> |
credMap
Map of credentials by realm that this HTTP state
contains. |
protected java.util.HashMap<AuthScope,Credentials> |
proxyCred
Map of proxy credentials by realm that this HTTP
state contains |
| Constructor Summary | |
|---|---|
HttpState()
Default constructor. |
|
| Method Summary | |
|---|---|
void |
addCookie(Cookie cookie)
Adds an HTTP cookie, replacing any existing equivalent
cookies. |
void |
addCookies(Cookie[] cookies)
Adds an array of HTTP cookies. |
void |
clear()
Clears the state information (all cookies, credentials and proxy credentials). |
void |
clearCookies()
Clears all cookies. |
void |
clearCredentials()
Clears all credentials. |
void |
clearProxyCredentials()
Clears all proxy credentials. |
Cookie[] |
getCookies()
Returns an array of cookies that this HTTP state currently
contains. |
Credentials |
getCredentials(AuthScope authscope)
Get the credentials for the given authentication
scope. |
Credentials |
getProxyCredentials(AuthScope authscope)
Get the proxy credentials for the given
authentication scope. |
boolean |
purgeExpiredCookies()
Removes all of cookies in this HTTP state that have
expired according to the current system time. |
boolean |
purgeExpiredCookies(java.util.Date date)
Removes all of cookies in this HTTP state that have
expired by the specified date. |
void |
setCredentials(AuthScope authscope,
Credentials credentials)
Sets the credentials for the given authentication
scope. |
void |
setProxyCredentials(AuthScope authscope,
Credentials credentials)
Sets the proxy credentials for the given
authentication realm. |
java.lang.String |
toString()
Returns a string representation of this HTTP state. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected java.util.HashMap<AuthScope,Credentials> credMap
credentials by realm that this HTTP state
contains.
protected java.util.HashMap<AuthScope,Credentials> proxyCred
proxy credentials by realm that this HTTP
state contains
protected java.util.ArrayList<Cookie> cookies
cookies that this HTTP state contains.
| Constructor Detail |
|---|
public HttpState()
| Method Detail |
|---|
public void addCookie(Cookie cookie)
HTTP cookie, replacing any existing equivalent
cookies. If the given cookie has already expired it will not be added,
but existing values will still be removed.
cookie - the cookie to be addedaddCookies(Cookie[])public void addCookies(Cookie[] cookies)
HTTP cookies. Cookies are added
individually and in the given array order. If any of the given cookies
has already expired it will not be added, but existing values will still
be removed.
cookies - the cookies to be addedaddCookie(Cookie)public Cookie[] getCookies()
cookies that this HTTP state currently
contains.
cookies.#getCookies(String, int, String, boolean)public boolean purgeExpiredCookies()
cookies in this HTTP state that have
expired according to the current system time.
purgeExpiredCookies(java.util.Date)public boolean purgeExpiredCookies(java.util.Date date)
cookies in this HTTP state that have
expired by the specified date.
date - The date to compare against.
Cookie.isExpired(java.util.Date),
purgeExpiredCookies()
public void setCredentials(AuthScope authscope,
Credentials credentials)
credentials for the given authentication
scope. Any previous credentials for the given scope will be overwritten.
authscope - the authentication scopecredentials - the authentication credentials for the given
scope.getCredentials(AuthScope),
setProxyCredentials(AuthScope, Credentials)public Credentials getCredentials(AuthScope authscope)
credentials for the given authentication
scope.
authscope - the authentication scope
setCredentials(AuthScope, Credentials)
public void setProxyCredentials(AuthScope authscope,
Credentials credentials)
proxy credentials for the given
authentication realm. Any previous credentials for the given realm will
be overwritten.
authscope - the authentication scopecredentials - the authentication credentials for the given
realm.getProxyCredentials(AuthScope),
setCredentials(AuthScope, Credentials)public Credentials getProxyCredentials(AuthScope authscope)
proxy credentials for the given
authentication scope.
authscope - the authentication scope
setProxyCredentials(AuthScope, Credentials)public java.lang.String toString()
toString in class java.lang.ObjectObject.toString()public void clearCredentials()
public void clearProxyCredentials()
public void clearCookies()
public void clear()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||