org.apache.commons.httpclient
Class HttpSharedState

java.lang.Object
  |
  +--org.apache.commons.httpclient.HttpState
        |
        +--org.apache.commons.httpclient.HttpSharedState

public class HttpSharedState
extends HttpState

HttpSharedState provides synchronized access to HttpState so that the state can be used in calls to HttpMultiClient.executeMethod() on multiple threads.

Author:
Marc A. Saegesser

Fields inherited from class org.apache.commons.httpclient.HttpState
log
 
Constructor Summary
HttpSharedState()
          No-args constructor.
 
Method Summary
 void addCookie(Cookie cookie)
          Synchronizes HttpState.addCookie().
 void addCookies(Cookie[] newCookies)
          Synchronizes HttpState.addCookies().
 Cookie[] getCookies()
          Synchronizes HttpState.getCookies().
 Cookie[] getCookies(java.lang.String domain, int port, java.lang.String path, boolean secure, java.util.Date now)
          Synchronizes HttpState.getCookies().
 Credentials getCredentials(java.lang.String realm)
          Synchronizes HttpState.getCredentials().
 boolean purgeExpiredCookies(java.util.Date date)
          Synchronizes HttpState.purgeExpiredCookies(Date).
 void setCredentials(java.lang.String realm, Credentials credentials)
          Synchronizes HttpState.setCredentials().
 
Methods inherited from class org.apache.commons.httpclient.HttpState
getProxyCredentials, purgeExpiredCookies, setProxyCredentials
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HttpSharedState

public HttpSharedState()
No-args constructor.
Method Detail

addCookie

public void addCookie(Cookie cookie)
Synchronizes HttpState.addCookie().
Overrides:
addCookie in class HttpState
Parameters:
cookie - - the Cookie to add.

addCookies

public void addCookies(Cookie[] newCookies)
Synchronizes HttpState.addCookies().
Overrides:
addCookies in class HttpState
Parameters:
newCookies - - an array of cookies to add.

getCookies

public Cookie[] getCookies()
Synchronizes HttpState.getCookies().
Overrides:
getCookies in class HttpState
Returns:
an array containing all the cookies

getCookies

public Cookie[] getCookies(java.lang.String domain,
                           int port,
                           java.lang.String path,
                           boolean secure,
                           java.util.Date now)
Synchronizes HttpState.getCookies().
Overrides:
getCookies in class HttpState
Returns:
all cookies matching the given parameters.

purgeExpiredCookies

public boolean purgeExpiredCookies(java.util.Date date)
Synchronizes HttpState.purgeExpiredCookies(Date).
Overrides:
purgeExpiredCookies in class HttpState
Parameters:
date - - purge cookies prior to this date.
Returns:
true if at least one cookie was purged.

setCredentials

public void setCredentials(java.lang.String realm,
                           Credentials credentials)
Synchronizes HttpState.setCredentials().
Overrides:
setCredentials in class HttpState
Parameters:
realm - - the authentication realm
credentials - - the authentication credentials

getCredentials

public Credentials getCredentials(java.lang.String realm)
Synchronizes HttpState.getCredentials().
Overrides:
getCredentials in class HttpState
Parameters:
realm - - the authorization realm.
Returns:
the authorizations credentials for the given realm


Copyright (c) 2001 - Apache Software Foundation