final class CookieStore
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
private static class |
CookieStore.GetComparator |
private static class |
CookieStore.RemovalComparator |
Modifier and Type | Field and Description |
---|---|
private java.util.Map<java.lang.String,java.util.Map<Cookie,Cookie>> |
buckets
The mapping from domain names to cookie buckets.
|
private static java.util.logging.Logger |
logger |
private static int |
MAX_BUCKET_SIZE |
private static int |
TOTAL_COUNT_LOWER_THRESHOLD |
private static int |
TOTAL_COUNT_UPPER_THRESHOLD |
private int |
totalCount
The total number of cookies currently in the store.
|
Constructor and Description |
---|
CookieStore()
Creates a new
CookieStore . |
Modifier and Type | Method and Description |
---|---|
private void |
find(java.util.List<Cookie> list,
java.util.Map<Cookie,Cookie> bucket,
java.lang.String hostname,
java.lang.String path,
boolean secureProtocol,
boolean httpApi)
Finds all the cookies that are stored in the given bucket and
match the given query.
|
(package private) Cookie |
get(Cookie cookie)
Returns the currently stored cookie with the same name, domain, and
path as the given cookie.
|
(package private) java.util.List<Cookie> |
get(java.lang.String hostname,
java.lang.String path,
boolean secureProtocol,
boolean httpApi)
Returns all the currently stored cookies that match the given query.
|
private void |
log(java.lang.String message,
Cookie cookie,
java.util.Map<Cookie,Cookie> bucket)
Logs a cookie event.
|
private void |
purge()
Removes excess cookies globally.
|
private void |
purge(java.util.Map<Cookie,Cookie> bucket)
Removes excess cookies from a given bucket.
|
(package private) void |
put(Cookie cookie)
Stores the given cookie.
|
private static final java.util.logging.Logger logger
private static final int MAX_BUCKET_SIZE
private static final int TOTAL_COUNT_LOWER_THRESHOLD
private static final int TOTAL_COUNT_UPPER_THRESHOLD
private final java.util.Map<java.lang.String,java.util.Map<Cookie,Cookie>> buckets
private int totalCount
Cookie get(Cookie cookie)
java.util.List<Cookie> get(java.lang.String hostname, java.lang.String path, boolean secureProtocol, boolean httpApi)
private void find(java.util.List<Cookie> list, java.util.Map<Cookie,Cookie> bucket, java.lang.String hostname, java.lang.String path, boolean secureProtocol, boolean httpApi)
void put(Cookie cookie)
private void purge(java.util.Map<Cookie,Cookie> bucket)
private void purge()