org.apache.commons.httpclient.cookie
Class CookiePolicy

java.lang.Object
  |
  +--org.apache.commons.httpclient.cookie.CookiePolicy

public abstract class CookiePolicy
extends Object

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:

Default policy can be set on JVM start-up through the system property "apache.commons.httpclient.cookiespec". Recognized values: COMPATIBILITY, NETSCAPE_DRAFT, RFC2109.

Since:
2.0
Author:
Oleg Kalnichevski, Mike Bowler

Field Summary
static int COMPATIBILITY
          The COMPATIBILITY policy provides high compatibilty with common cookie management of popular HTTP agents.
protected static Log LOG
          Log object.
static int NETSCAPE_DRAFT
          The NETSCAPE_DRAFT Netscape draft compliant policy.
static int RFC2109
          The RFC2109 RFC 2109 compliant policy.
 
Constructor Summary
CookiePolicy()
           
 
Method Summary
(package private) static void ()
           
static CookieSpec getCompatibilitySpec()
           
static int getDefaultPolicy()
           
static CookieSpec getDefaultSpec()
           
static CookieSpec getSpecByPolicy(int policy)
           
static CookieSpec getSpecByVersion(int ver)
          Gets the CookieSpec for a particular cookie version.
static void setDefaultPolicy(int policy)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COMPATIBILITY

public static final int COMPATIBILITY
The COMPATIBILITY policy provides high compatibilty with common cookie management of popular HTTP agents.

NETSCAPE_DRAFT

public static final int NETSCAPE_DRAFT
The NETSCAPE_DRAFT Netscape draft compliant policy.

RFC2109

public static final int RFC2109
The RFC2109 RFC 2109 compliant policy.

LOG

protected static final Log LOG
Log object.
Constructor Detail

CookiePolicy

public CookiePolicy()
Method Detail

static void ()

getDefaultPolicy

public static int getDefaultPolicy()
Returns:
default cookie policy (COMPATIBILITY | NETSCAPE_DRAFT | RFC2109)

setDefaultPolicy

public static void setDefaultPolicy(int policy)
Parameters:
policy - new default cookie policy (COMPATIBILITY | NETSCAPE_DRAFT | RFC2109)

getSpecByPolicy

public static CookieSpec getSpecByPolicy(int policy)
Parameters:
policy - cookie policy to get the CookieSpec for
Returns:
cookie specification interface for the given policy (COMPATIBILITY | NETSCAPE_DRAFT | RFC2109)

getDefaultSpec

public static CookieSpec getDefaultSpec()
Returns:
default cookie specification interface

getSpecByVersion

public static CookieSpec getSpecByVersion(int ver)
Gets the CookieSpec for a particular cookie version.

Supported versions:


getCompatibilitySpec

public static CookieSpec getCompatibilitySpec()
Returns:
cookie specification interface that provides high compatibilty with common cookie management of popular HTTP agents


Copyright © 2001-2004 Apache Software Foundation. All Rights Reserved.