public final class ThreadSafeCookieStore extends Object implements CookieStore
| Modifier and Type | Class and Description |
|---|---|
static class |
ThreadSafeCookieStore.DomainUtils |
| Constructor and Description |
|---|
ThreadSafeCookieStore() |
| Modifier and Type | Method and Description |
|---|---|
void |
add(Uri uri,
io.netty.handler.codec.http.cookie.Cookie cookie)
Adds one
Cookie to the store. |
boolean |
clear()
Remove all cookies in this cookie store.
|
int |
count()
Return the current counter
|
int |
decrementAndGet()
Decrement counter and return the decremented value
|
void |
evictExpired()
Evicts all the cookies that expired as of the time this method is run.
|
List<io.netty.handler.codec.http.cookie.Cookie> |
get(Uri uri)
Retrieve cookies associated with given URI, or whose domain matches the given URI.
|
List<io.netty.handler.codec.http.cookie.Cookie> |
getAll()
Get all not-expired cookies in cookie store.
|
Map<String,Map<org.asynchttpclient.cookie.ThreadSafeCookieStore.CookieKey,org.asynchttpclient.cookie.ThreadSafeCookieStore.StoredCookie>> |
getUnderlying() |
int |
incrementAndGet()
Increment counter and return the incremented value
|
boolean |
remove(Predicate<io.netty.handler.codec.http.cookie.Cookie> predicate)
Remove a cookie from store.
|
public void add(Uri uri, io.netty.handler.codec.http.cookie.Cookie cookie)
CookieStoreCookie to the store. This is called for every incoming HTTP response.
If the given cookie has already expired it will not be added.
A cookie to store may or may not be associated with an URI. If it is not associated with an URI, the cookie's domain and path attribute will indicate where it comes from. If it is associated with an URI and its domain and path attribute are not specified, given URI will indicate where this cookie comes from.
If a cookie corresponding to the given URI already exists, then it is replaced with the new one.
add in interface CookieStoreuri - the uri this cookie associated with. if null, this cookie will not be associated with an URIcookie - the cookie to be addedpublic List<io.netty.handler.codec.http.cookie.Cookie> get(Uri uri)
CookieStoreget in interface CookieStoreuri - the uri associated with the cookies to be returnedpublic List<io.netty.handler.codec.http.cookie.Cookie> getAll()
CookieStoregetAll in interface CookieStorepublic boolean remove(Predicate<io.netty.handler.codec.http.cookie.Cookie> predicate)
CookieStoreremove in interface CookieStorepredicate - that indicates what cookies to removetrue if this store contained the specified cookiepublic boolean clear()
CookieStoreclear in interface CookieStorepublic void evictExpired()
CookieStoreevictExpired in interface CookieStorepublic int incrementAndGet()
CountedincrementAndGet in interface Countedpublic int decrementAndGet()
CounteddecrementAndGet in interface Countedpublic int count()
CountedCopyright © 2020. All rights reserved.