gov.llnl.babel.url.cookie
Class CookieJar

java.lang.Object
  extended by gov.llnl.babel.url.cookie.CookieJar
All Implemented Interfaces:
java.io.Serializable

public class CookieJar
extends java.lang.Object
implements java.io.Serializable

CookieJar is a container for HTTP Cookie's. This container manages cookie expiration and determining which cookies are relevant to a particular URL.

See Also:
Serialized Form

Constructor Summary
CookieJar()
           
 
Method Summary
 void add(Cookie c)
          Add a cookie to the jar.
 java.util.Iterator getRelevantCookies(java.lang.String hostname, java.lang.String path, int port)
          Select and return cookies from this jar that are appropriate for the hostname, path and port given.
 void removeExpired()
          Remove stale cookies from the jar.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CookieJar

public CookieJar()
Method Detail

add

public void add(Cookie c)
Add a cookie to the jar.


getRelevantCookies

public java.util.Iterator getRelevantCookies(java.lang.String hostname,
                                             java.lang.String path,
                                             int port)
Select and return cookies from this jar that are appropriate for the hostname, path and port given. The document "HTTP State Management Mechanism" dated August 27, 1999 gives detailed rules for deciding whether a cookie should be sent with a particular request. This method attempts to implement those rules.


removeExpired

public void removeExpired()
Remove stale cookies from the jar.