public class AsyncCookieManager2
extends java.lang.Object
Constructor and Description |
---|
AsyncCookieManager2()
Creates the cookie manager
|
Modifier and Type | Method and Description |
---|---|
void |
addCookiesToRequest(org.asynchttpclient.RequestBuilderBase<?> base)
Deprecated.
|
void |
addCookiesToRequest(java.lang.String url,
org.asynchttpclient.RequestBuilderBase<?> base)
Adds the cookies to the request
|
void |
clearAllCookies()
Clears all the cookies from the manager
|
java.util.Set<io.netty.handler.codec.http.cookie.Cookie> |
getAllCookies()
Returns a set of all cookies currently in the manager (these may include expired cookies)
|
java.util.Set<io.netty.handler.codec.http.cookie.Cookie> |
getCookies(java.util.List<java.lang.String> domainPath,
java.lang.String path,
boolean includeUnspecifiedCookies,
boolean includeSecure)
Returns a set of cookies for the current domain.
|
java.util.Set<io.netty.handler.codec.http.cookie.Cookie> |
getCookies(java.lang.String domain,
java.lang.String path,
boolean includeUnspecifiedCookies,
boolean includeSecure)
Returns a set of cookies for the current domain.
|
boolean |
isAutoTrimOldCookies()
Returns the AutoTrimOldCookies for the object
|
void |
setAutoTrimOldCookies(boolean autoTrimOldCookies)
Sets the AutoTrimOldCookies for the object
|
void |
trimOldCookies()
Trims the data structure to remove old cookies
|
void |
updateCookies(org.asynchttpclient.Response response)
Updates the cookie manager with cookies from the response
|
void |
updateCookies(org.asynchttpclient.uri.Uri uri,
java.util.List<io.netty.handler.codec.http.cookie.Cookie> cookies)
Updates the cookie manager with cookies given
|
public boolean isAutoTrimOldCookies()
public void setAutoTrimOldCookies(boolean autoTrimOldCookies)
autoTrimOldCookies
- The new value for AutoTrimOldCookies@Deprecated public void addCookiesToRequest(@NotNull org.asynchttpclient.RequestBuilderBase<?> base)
base
- The base requestpublic void addCookiesToRequest(@NotNull java.lang.String url, @NotNull org.asynchttpclient.RequestBuilderBase<?> base)
url
- The url to add cookies for (previously tried deriving this from the request base, but that caused some issuesbase
- The base requestpublic void updateCookies(@NotNull org.asynchttpclient.Response response)
response
- The response received from the serverpublic void updateCookies(@Nullable org.asynchttpclient.uri.Uri uri, @NotNull java.util.List<io.netty.handler.codec.http.cookie.Cookie> cookies)
uri
- The uri for the request that got these cookies as a responsecookies
- The cookies to addpublic java.util.Set<io.netty.handler.codec.http.cookie.Cookie> getAllCookies()
public void trimOldCookies()
public void clearAllCookies()
public java.util.Set<io.netty.handler.codec.http.cookie.Cookie> getCookies(@NotNull java.lang.String domain, @NotNull java.lang.String path, boolean includeUnspecifiedCookies, boolean includeSecure)
domain
- The domain for which to get cookiespath
- The path for the cookiesincludeUnspecifiedCookies
- True if we want cookies that are to be sent with a request but don't indicate secure or not secure onlyincludeSecure
- True if we want cookies that are to be sent with a secure requestpublic java.util.Set<io.netty.handler.codec.http.cookie.Cookie> getCookies(@NotNull java.util.List<java.lang.String> domainPath, @NotNull java.lang.String path, boolean includeUnspecifiedCookies, boolean includeSecure)
domainPath
- The domain for which to get cookies (such as ["www", "google", "com"])path
- The path for the cookies, inside the domainincludeUnspecifiedCookies
- True if we want cookies that are to be sent with a request but don't indicate secure or not secure onlyincludeSecure
- True if we want cookies that are to be sent with a secure request