Class CookiePolicy
- java.lang.Object
-
- org.apache.commons.httpclient.cookie.CookiePolicy
-
@Deprecated public abstract class CookiePolicy extends java.lang.ObjectDeprecated.Jakarta Commons HttpClient 3.x is deprecated in the Jenkins project. It is not recommended to use it in any new code. Instead, use HTTP client API plugins as a dependency in your code. E.g. Apache HttpComponents Client API 4.x Plugin or Async HTTP Client Plugin.Cookie management policy class. The cookie policy provides corresponding cookie management interfrace for a given type or version of cookie.RFC 2109 specification is used per default. Other supported specification can be chosen when appropriate or set default when desired
The following specifications are provided:
- BROWSER_COMPATIBILITY: compatible with the common cookie management practices (even if they are not 100% standards compliant)
- NETSCAPE: Netscape cookie draft compliant
- RFC_2109: RFC2109 compliant (default)
- IGNORE_COOKIES: do not automcatically process cookies
- Since:
- 2.0
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringBROWSER_COMPATIBILITYDeprecated.The policy that provides high degree of compatibilty with common cookie management of popular HTTP agents.static intCOMPATIBILITYDeprecated.static java.lang.StringDEFAULTDeprecated.The default cookie policy.static java.lang.StringIGNORE_COOKIESDeprecated.The policy that ignores cookies.static java.lang.StringNETSCAPEDeprecated.The Netscape cookie draft compliant policy.static intNETSCAPE_DRAFTDeprecated.UseNETSCAPEstatic java.lang.StringRFC_2109Deprecated.The RFC 2109 compliant policy.static java.lang.StringRFC_2965Deprecated.The RFC 2965 compliant policy.static intRFC2109Deprecated.UseRFC_2109static intRFC2965Deprecated.UseRFC_2965
-
Constructor Summary
Constructors Constructor Description CookiePolicy()Deprecated.
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static CookieSpecgetCompatibilitySpec()Deprecated.static CookieSpecgetCookieSpec(java.lang.String id)Deprecated.Gets thecookie specificationwith the given ID.static intgetDefaultPolicy()Deprecated.UsegetDefaultSpec()static CookieSpecgetDefaultSpec()Deprecated.Returnscookie specificationregistered asDEFAULT.static java.lang.String[]getRegisteredCookieSpecs()Deprecated.Obtains the currently registered cookie policy names.static CookieSpecgetSpecByPolicy(int policy)Deprecated.static CookieSpecgetSpecByVersion(int ver)Deprecated.static voidregisterCookieSpec(java.lang.String id, java.lang.Class clazz)Deprecated.Registers a newcookie specificationwith the given identifier.static voidsetDefaultPolicy(int policy)Deprecated.static voidunregisterCookieSpec(java.lang.String id)Deprecated.Unregisters thecookie specificationwith the given ID.
-
-
-
Field Detail
-
BROWSER_COMPATIBILITY
public static final java.lang.String BROWSER_COMPATIBILITY
Deprecated.The policy that provides high degree of compatibilty with common cookie management of popular HTTP agents.- Since:
- 3.0
- See Also:
- Constant Field Values
-
NETSCAPE
public static final java.lang.String NETSCAPE
Deprecated.The Netscape cookie draft compliant policy.- Since:
- 3.0
- See Also:
- Constant Field Values
-
RFC_2109
public static final java.lang.String RFC_2109
Deprecated.The RFC 2109 compliant policy.- Since:
- 3.0
- See Also:
- Constant Field Values
-
RFC_2965
public static final java.lang.String RFC_2965
Deprecated.The RFC 2965 compliant policy.- Since:
- 3.0
- See Also:
- Constant Field Values
-
IGNORE_COOKIES
public static final java.lang.String IGNORE_COOKIES
Deprecated.The policy that ignores cookies.- Since:
- 3.0
- See Also:
- Constant Field Values
-
DEFAULT
public static final java.lang.String DEFAULT
Deprecated.The default cookie policy.- Since:
- 3.0
- See Also:
- Constant Field Values
-
COMPATIBILITY
public static final int COMPATIBILITY
Deprecated.The COMPATIBILITY policy provides high compatibilty with common cookie management of popular HTTP agents.- See Also:
- Constant Field Values
-
NETSCAPE_DRAFT
public static final int NETSCAPE_DRAFT
Deprecated.UseNETSCAPEThe NETSCAPE_DRAFT Netscape draft compliant policy.- See Also:
- Constant Field Values
-
RFC2109
public static final int RFC2109
Deprecated.UseRFC_2109The RFC2109 RFC 2109 compliant policy.- See Also:
- Constant Field Values
-
RFC2965
public static final int RFC2965
Deprecated.UseRFC_2965The RFC2965 RFC 2965 compliant policy.- See Also:
- Constant Field Values
-
-
Method Detail
-
registerCookieSpec
public static void registerCookieSpec(java.lang.String id, java.lang.Class clazz)Deprecated.Registers a newcookie specificationwith the given identifier. If a specification with the given ID already exists it will be overridden. This ID is the same one used to retrieve thecookie specificationfromgetCookieSpec(String).- Parameters:
id- the identifier for this specificationclazz- thecookie specificationclass to register- Since:
- 3.0
- See Also:
getCookieSpec(String)
-
unregisterCookieSpec
public static void unregisterCookieSpec(java.lang.String id)
Deprecated.Unregisters thecookie specificationwith the given ID.- Parameters:
id- the ID of thecookie specificationto unregister- Since:
- 3.0
-
getCookieSpec
public static CookieSpec getCookieSpec(java.lang.String id) throws java.lang.IllegalStateException
Deprecated.Gets thecookie specificationwith the given ID.- Parameters:
id- thecookie specificationID- Returns:
cookie specification- Throws:
java.lang.IllegalStateException- if a policy with the ID cannot be found- Since:
- 3.0
-
getDefaultPolicy
public static int getDefaultPolicy()
Deprecated.UsegetDefaultSpec()- Returns:
- default cookie policy
- See Also:
getDefaultSpec()
-
setDefaultPolicy
public static void setDefaultPolicy(int policy)
Deprecated.- Parameters:
policy- new default cookie policy- See Also:
DEFAULT
-
getSpecByPolicy
public static CookieSpec getSpecByPolicy(int policy)
Deprecated.- Parameters:
policy- cookie policy to get the CookieSpec for- Returns:
- cookie specification interface for the given policy
-
getDefaultSpec
public static CookieSpec getDefaultSpec()
Deprecated.Returnscookie specificationregistered asDEFAULT. If no defaultcookie specificationhas been registered,RFC2109 specificationis returned.- Returns:
- default
cookie specification - See Also:
DEFAULT
-
getSpecByVersion
public static CookieSpec getSpecByVersion(int ver)
Deprecated.Gets the CookieSpec for a particular cookie version.Supported versions:
- version 0 corresponds to the Netscape draft
- version 1 corresponds to the RFC 2109
- Any other cookie value coresponds to the default spec
- Parameters:
ver- the cookie version to get the spec for- Returns:
- cookie specification interface intended for processing cookies with the given version
-
getCompatibilitySpec
public static CookieSpec getCompatibilitySpec()
Deprecated.- Returns:
- cookie specification interface that provides high compatibilty with common cookie management of popular HTTP agents
-
getRegisteredCookieSpecs
public static java.lang.String[] getRegisteredCookieSpecs()
Deprecated.Obtains the currently registered cookie policy names. Note that the DEFAULT policy (if present) is likely to be the same as one of the other policies, but does not have to be.- Returns:
- array of registered cookie policy names
- Since:
- 3.1
-
-