public class AsyncNingCookieManager
extends java.lang.Object
Constructor and Description |
---|
AsyncNingCookieManager()
Creates the cookie manager
|
Modifier and Type | Method and Description |
---|---|
void |
addCookiesToRequest(com.ning.http.client.RequestBuilderBase<?> base)
Deprecated.
|
void |
addCookiesToRequest(java.lang.String url,
com.ning.http.client.RequestBuilderBase<?> base)
Adds the cookies to the request
|
void |
clearAllCookies()
Clears all the cookies from the manager
|
java.util.Set<com.ning.http.client.cookie.Cookie> |
getAllCookies()
Returns a set of all cookies currently in the manager (these may include expired cookies)
|
java.util.Set<com.ning.http.client.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<com.ning.http.client.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(com.ning.http.client.Response response)
Updates the cookie manager with cookies from the response
|
void |
updateCookies(com.ning.http.client.uri.Uri uri,
java.util.List<com.ning.http.client.cookie.Cookie> cookies)
Updates the cookie manager with cookies given
|
public AsyncNingCookieManager()
public boolean isAutoTrimOldCookies()
public void setAutoTrimOldCookies(boolean autoTrimOldCookies)
autoTrimOldCookies
- The new value for AutoTrimOldCookies@Deprecated public void addCookiesToRequest(@NotNull com.ning.http.client.RequestBuilderBase<?> base)
base
- The base requestpublic void addCookiesToRequest(@NotNull java.lang.String url, @NotNull com.ning.http.client.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 com.ning.http.client.Response response)
response
- The response received from the serverpublic void updateCookies(@Nullable com.ning.http.client.uri.Uri uri, @NotNull java.util.List<com.ning.http.client.cookie.Cookie> cookies)
uri
- The uri for the request that got these cookies as a responsecookies
- The cookies to addpublic java.util.Set<com.ning.http.client.cookie.Cookie> getAllCookies()
public void trimOldCookies()
public void clearAllCookies()
public java.util.Set<com.ning.http.client.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<com.ning.http.client.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