Top Description Inners Fields Constructors Methods
com.sun.webkit.network

pack-priv final Class CookieStore

extends Object
Class Inheritance
Imports
com.sun.javafx.logging.PlatformLogger, .PlatformLogger.Level, java.util.LinkedHashMap, .Comparator, .Collections, .ArrayList, .HashMap, .Iterator, .List, .Map, .PriorityQueue, .Queue

A cookie store.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
private static class

Field Summary

Modifier and TypeField and Description
private final Map<String, Map<Cookie, Cookie>>
buckets

The mapping from domain names to cookie buckets.

private static final PlatformLogger
private static final int
private static final int
private static final int
private int
totalCount

The total number of cookies currently in the store.

Constructor Summary

AccessConstructor and Description
pack-priv
CookieStore()

Creates a new CookieStore.

Method Summary

Modifier and TypeMethod and Description
private void
find(List<Cookie> list, Map<Cookie, Cookie> bucket, String hostname, String path, boolean secureProtocol, boolean httpApi)

Finds all the cookies that are stored in the given bucket and match the given query.

pack-priv Cookie
get(Cookie cookie)

Returns the currently stored cookie with the same name, domain, and path as the given cookie.

pack-priv List<Cookie>
get(String hostname, String path, boolean secureProtocol, boolean httpApi)

Returns all the currently stored cookies that match the given query.

private void
log(String message, Cookie cookie, Map<Cookie, Cookie> bucket)

Logs a cookie event.

private void
purge(Map<Cookie, Cookie> bucket)

Removes excess cookies from a given bucket.

private void
purge()

Removes excess cookies globally.

pack-priv void
put(Cookie cookie)

Stores the given cookie.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

bucketsback to summary
private final Map<String, Map<Cookie, Cookie>> buckets

The mapping from domain names to cookie buckets. Each cookie bucket stores the cookies associated with the corresponding domain. Each cookie bucket is represented by a Map to facilitate retrieval of a cookie by another cookie with the same name, domain, and path.

loggerback to summary
private static final PlatformLogger logger
MAX_BUCKET_SIZEback to summary
private static final int MAX_BUCKET_SIZE
TOTAL_COUNT_LOWER_THRESHOLDback to summary
private static final int TOTAL_COUNT_LOWER_THRESHOLD
TOTAL_COUNT_UPPER_THRESHOLDback to summary
private static final int TOTAL_COUNT_UPPER_THRESHOLD
totalCountback to summary
private int totalCount

The total number of cookies currently in the store.

Constructor Detail

CookieStoreback to summary
pack-priv CookieStore()

Creates a new CookieStore.

Method Detail

findback to summary
private void find(List<Cookie> list, Map<Cookie, Cookie> bucket, String hostname, String path, boolean secureProtocol, boolean httpApi)

Finds all the cookies that are stored in the given bucket and match the given query.

getback to summary
pack-priv Cookie get(Cookie cookie)

Returns the currently stored cookie with the same name, domain, and path as the given cookie.

getback to summary
pack-priv List<Cookie> get(String hostname, String path, boolean secureProtocol, boolean httpApi)

Returns all the currently stored cookies that match the given query.

logback to summary
private void log(String message, Cookie cookie, Map<Cookie, Cookie> bucket)

Logs a cookie event.

purgeback to summary
private void purge(Map<Cookie, Cookie> bucket)

Removes excess cookies from a given bucket.

purgeback to summary
private void purge()

Removes excess cookies globally.

putback to summary
pack-priv void put(Cookie cookie)

Stores the given cookie.

com.sun.webkit.network back to summary

private final Class CookieStore.GetComparator

extends Object
implements Comparator<Cookie>
Class Inheritance
All Implemented Interfaces
java.util.Comparator

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public int
compare(Cookie
the first object to be compared.
c1
,
Cookie
the second object to be compared.
c2
)

Implements java.util.Comparator.compare.

Compares its two arguments for order.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

GetComparatorback to summary
private GetComparator()

Method Detail

compareback to summary
public int compare(Cookie c1, Cookie c2)

Implements java.util.Comparator.compare.

Doc from java.util.Comparator.compare.

Compares its two arguments for order. Returns a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second.

The implementor must ensure that signum(compare(x, y)) == -signum(compare(y, x)) for all x and y. (This implies that compare(x, y) must throw an exception if and only if compare(y, x) throws an exception.)

The implementor must also ensure that the relation is transitive: ((compare(x, y)>0) && (compare(y, z)>0)) implies compare(x, z)>0.

Finally, the implementor must ensure that compare(x, y)==0 implies that signum(compare(x, z))==signum(compare(y, z)) for all z.

Parameters
c1:Cookie

the first object to be compared.

c2:Cookie

the second object to be compared.

Returns:int

a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second.

Annotations
@Override
com.sun.webkit.network back to summary

private final Class CookieStore.RemovalComparator

extends Object
implements Comparator<Cookie>
Class Inheritance
All Implemented Interfaces
java.util.Comparator

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public int
compare(Cookie
the first object to be compared.
c1
,
Cookie
the second object to be compared.
c2
)

Implements java.util.Comparator.compare.

Compares its two arguments for order.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

RemovalComparatorback to summary
private RemovalComparator()

Method Detail

compareback to summary
public int compare(Cookie c1, Cookie c2)

Implements java.util.Comparator.compare.

Doc from java.util.Comparator.compare.

Compares its two arguments for order. Returns a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second.

The implementor must ensure that signum(compare(x, y)) == -signum(compare(y, x)) for all x and y. (This implies that compare(x, y) must throw an exception if and only if compare(y, x) throws an exception.)

The implementor must also ensure that the relation is transitive: ((compare(x, y)>0) && (compare(y, z)>0)) implies compare(x, z)>0.

Finally, the implementor must ensure that compare(x, y)==0 implies that signum(compare(x, z))==signum(compare(y, z)) for all z.

Parameters
c1:Cookie

the first object to be compared.

c2:Cookie

the second object to be compared.

Returns:int

a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second.

Annotations
@Override