org.apache.http.cookie.CookieSpec |
Known Indirect Subclasses
AbstractCookieSpec |
Abstract cookie specification which can delegate the job of parsing,
validation or matching cookie attributes to a number of arbitrary
CookieAttributeHandler s. |
BestMatchSpec |
'Meta' cookie specification that picks up a cookie policy based on
the format of cookies sent with the HTTP response. |
BrowserCompatSpec |
Cookie specification that strives to closely mimic (mis)behavior of
common web browser applications such as Microsoft Internet Explorer
and Mozilla FireFox. |
CookieSpecBase |
Cookie management functions shared by all specification. |
IgnoreSpec |
CookieSpec that ignores all cookies |
NetscapeDraftSpec |
This CookieSpec implementation conforms to the original draft
specification published by Netscape Communications. |
RFC2109Spec |
RFC 2109 compliant CookieSpec implementation. |
RFC2965Spec |
RFC 2965 compliant CookieSpec implementation. |
|
Class Overview
Defines the cookie management specification.
Cookie management specification must define
- rules of parsing "Set-Cookie" header
- rules of validation of parsed cookies
- formatting of "Cookie" header
for a given host, port and path of origin
Summary
Public Methods |
abstract
List<Header>
|
formatCookies(List<Cookie> cookies)
Create "Cookie" headers for an array of Cookies.
|
abstract
int
|
getVersion()
Returns version of the state management this cookie specification
conforms to.
|
abstract
Header
|
getVersionHeader()
Returns a request header identifying what version of the state management
specification is understood.
|
abstract
boolean
|
match(Cookie cookie, CookieOrigin origin)
Determines if a Cookie matches the target location.
|
abstract
List<Cookie>
|
parse(Header header, CookieOrigin origin)
Parse the "Set-Cookie" Header into an array of Cookies.
|
abstract
void
|
validate(Cookie cookie, CookieOrigin origin)
Validate the cookie according to validation rules defined by the
cookie specification.
|
Public Methods
public
abstract
List<Header>
formatCookies
(List<Cookie> cookies)
Create "Cookie" headers for an array of Cookies.
Parameters
cookies
| the Cookies format into a Cookie header |
Returns
- a Header for the given Cookies.
public
abstract
int
getVersion
()
Returns version of the state management this cookie specification
conforms to.
Returns
- version of the state management specification
public
abstract
Header
getVersionHeader
()
Returns a request header identifying what version of the state management
specification is understood. May be null
if the cookie
specification does not support Cookie2 header.
public
abstract
boolean
match
(Cookie cookie, CookieOrigin origin)
Determines if a Cookie matches the target location.
Parameters
cookie
| the Cookie to be matched |
origin
| the target to test against |
Returns
- true if the cookie should be submitted with a request
with given attributes, false otherwise.
Parse the "Set-Cookie" Header into an array of Cookies.
This method will not perform the validation of the resultant
Cookie
s
Parameters
header
| the Set-Cookie received from the server |
origin
| details of the cookie origin |
Returns
- an array of Cookies parsed from the header
public
abstract
void
validate
(Cookie cookie, CookieOrigin origin)
Validate the cookie according to validation rules defined by the
cookie specification.
Parameters
cookie
| the Cookie to validate |
origin
| details of the cookie origin |