org.apache.commons.httpclient.cookie
Class CookiePolicy

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

public abstract class CookiePolicy
extends java.lang.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

Field Summary
static int COMPATIBILITY
          The COMPATIBILITY policy provides high compatibilty with common cookie management of popular HTTP agents
static int NETSCAPE_DRAFT
          The NETSCAPE_DRAFT Netscape draft compliant policy
static int RFC2109
          The RFC2109 RFC 2109 compliant policy (default)
 
Constructor Summary
CookiePolicy()
           
 
Method Summary
static CookieSpec getCompatibilitySpec()
           
static int getDefaultPolicy()
           
static CookieSpec getDefaultSpec()
           
static CookieSpec getSpecByPolicy(int policy)
           
static CookieSpec getSpecByVersion(int ver)
           
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

See Also:
Constant Field Values

NETSCAPE_DRAFT

public static final int NETSCAPE_DRAFT
The NETSCAPE_DRAFT Netscape draft compliant policy

See Also:
Constant Field Values

RFC2109

public static final int RFC2109
The RFC2109 RFC 2109 compliant policy (default)

See Also:
Constant Field Values
Constructor Detail

CookiePolicy

public CookiePolicy()
Method Detail

getDefaultPolicy

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

setDefaultPolicy

public static void setDefaultPolicy(int policy)

getSpecByPolicy

public static CookieSpec getSpecByPolicy(int policy)
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)
Returns:
cookie specification interface intended for processing cookies with the given version Supported versions:
  • version 0 corresponds to the NETSCAPE_DRAFT
  • version 1 corresponds to the RFC2109
  • Any unsupported cookie version number corresponds to the current default cookie specification

    getCompatibilitySpec

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


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