| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.commons.httpclient.cookie.CookiePolicy
public abstract class CookiePolicy
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:
| Field Summary | |
|---|---|
| static String | BROWSER_COMPATIBILITYThe policy that provides high degree of compatibilty with common cookie management of popular HTTP agents. | 
| static int | COMPATIBILITYDeprecated. Use BROWSER_COMPATIBILITY | 
| static String | DEFAULTThe default cookie policy. | 
| static String | IGNORE_COOKIESThe policy that ignores cookies. | 
| protected static Log | LOGLog object. | 
| static String | NETSCAPEThe Netscape cookie draft compliant policy. | 
| static int | NETSCAPE_DRAFTDeprecated. Use NETSCAPE | 
| static String | RFC_2109The RFC 2109 compliant policy. | 
| static String | RFC_2965The RFC 2965 compliant policy. | 
| static int | RFC2109Deprecated. Use RFC_2109 | 
| static int | RFC2965Deprecated. Use RFC_2965 | 
| Constructor Summary | |
|---|---|
| CookiePolicy() | |
| Method Summary | |
|---|---|
| static CookieSpec | getCompatibilitySpec()Deprecated. Use getCookieSpec(String) | 
| static CookieSpec | getCookieSpec(String id)Gets the cookie specificationwith the given ID. | 
| static int | getDefaultPolicy()Deprecated. Use getDefaultSpec() | 
| static CookieSpec | getDefaultSpec()Returns cookie specificationregistered asDEFAULT. | 
| static String[] | getRegisteredCookieSpecs()Obtains the currently registered cookie policy names. | 
| static CookieSpec | getSpecByPolicy(int policy)Deprecated. Use getCookieSpec(String) | 
| static CookieSpec | getSpecByVersion(int ver)Deprecated. Use getCookieSpec(String) | 
| static void | registerCookieSpec(String id,
                   Class clazz)Registers a new cookie specificationwith the given identifier. | 
| static void | setDefaultPolicy(int policy)Deprecated. Use registerCookieSpec(String, Class) | 
| static void | unregisterCookieSpec(String id)Unregisters the cookie specificationwith the given ID. | 
| Methods inherited from class java.lang.Object | 
|---|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Field Detail | 
|---|
public static final String BROWSER_COMPATIBILITY
public static final String NETSCAPE
public static final String RFC_2109
public static final String RFC_2965
public static final String IGNORE_COOKIES
public static final String DEFAULT
public static final int COMPATIBILITY
BROWSER_COMPATIBILITY
public static final int NETSCAPE_DRAFT
NETSCAPE
public static final int RFC2109
RFC_2109
public static final int RFC2965
RFC_2965
protected static final Log LOG
| Constructor Detail | 
|---|
public CookiePolicy()
| Method Detail | 
|---|
public static void registerCookieSpec(String id,
                                      Class clazz)
cookie specification with 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 the cookie specification 
 from getCookieSpec(String).
id - the identifier for this specificationclazz - the cookie specification class to registergetCookieSpec(String)public static void unregisterCookieSpec(String id)
cookie specification with the given ID.
id - the ID of the cookie specification to unregister
public static CookieSpec getCookieSpec(String id)
                                throws IllegalStateException
cookie specification with the given ID.
id - the cookie specification ID
cookie specification
IllegalStateException - if a policy with the ID cannot be foundpublic static int getDefaultPolicy()
getDefaultSpec()
getDefaultSpec()public static void setDefaultPolicy(int policy)
registerCookieSpec(String, Class)
policy - new default cookie policyDEFAULTpublic static CookieSpec getSpecByPolicy(int policy)
getCookieSpec(String)
policy - cookie policy to get the CookieSpec for
public static CookieSpec getDefaultSpec()
cookie specification registered as DEFAULT. 
 If no default cookie specification has been registered, 
 RFC2109 specification is returned.
cookie specificationDEFAULTpublic static CookieSpec getSpecByVersion(int ver)
getCookieSpec(String)
Supported versions:
ver - the cookie version to get the spec for
public static CookieSpec getCompatibilitySpec()
getCookieSpec(String)
public static String[] getRegisteredCookieSpecs()
| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||