Package org.eclipse.jetty.http
Interface HttpCookieStore
- All Known Implementing Classes:
HttpCookieStore.Default
,HttpCookieStore.Empty
public interface HttpCookieStore
A container for HttpCookie
s.
HTTP cookies are stored along with a URI
via add(URI, HttpCookie)
and retrieved via match(URI)
, which implements the path matching algorithm
defined by RFC 6265.
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic class
A default implementation ofHttpCookieStore
.static class
An implementation ofHttpCookieStore
that does not store any cookie. -
Method Summary
Modifier and TypeMethodDescriptionboolean
add
(URI uri, HttpCookie cookie) Adds a cookie to this store, if possible.all()
boolean
clear()
Removes all the cookies from this store.Returns the cookies that match the givenURI
.boolean
remove
(URI uri, HttpCookie cookie) Removes the cookie associated with the givenURI
.
-
Method Details
-
add
Adds a cookie to this store, if possible.
The cookie may not be added for various reasons; for example, it may be already expired, or its domain attribute does not match that of the URI, etc.
The cookie is associated with the given
URI
, so that a call tomatch(URI)
returns the cookie only if the URIs match.- Parameters:
uri
- theURI
associated with the cookiecookie
- the cookie to add- Returns:
- whether the cookie has been added
-
all
List<HttpCookie> all()- Returns:
- all the cookies
-
match
Returns the cookies that match the given
URI
.- Parameters:
uri
- theURI
to match against- Returns:
- a list of cookies that match the given
URI
-
remove
Removes the cookie associated with the given
URI
.- Parameters:
uri
- theURI
associated with the cookie to removecookie
- the cookie to remove- Returns:
- whether the cookie has been removed
-
clear
boolean clear()Removes all the cookies from this store.
- Returns:
- whether the store modified by this call
-