Top Description Fields Constructors Methods
org.apache.http.impl.cookie

public Class RFC2965Spec

extends RFC2109Spec
Class Inheritance
Annotations
@Obsolete
@Contract
threading:SAFE
Imports
java.util.ArrayList, .HashMap, .List, .Locale, .Map, org.apache.http.Header, .HeaderElement, .NameValuePair, org.apache.http.annotation.Contract, .Obsolete, .ThreadingBehavior, org.apache.http.cookie.ClientCookie, .CommonCookieAttributeHandler, .Cookie, .CookieAttributeHandler, .CookieOrigin, .CookieRestrictionViolationException, .MalformedCookieException, .SM, org.apache.http.message.BufferedHeader, org.apache.http.util.Args, .CharArrayBuffer

RFC 2965 compliant org.apache.http.cookie.CookieSpec implementation.

Rendered obsolete by org.apache.http.impl.cookie.RFC6265StrictSpec.

Since
4.0
See Also
org.apache.http.impl.cookie.RFC6265StrictSpec

Field Summary

Inherited from org.apache.http.impl.cookie.RFC2109Spec:
DATE_PATTERNS

Constructor Summary

AccessConstructor and Description
public
RFC2965Spec()

Default constructor

public
RFC2965Spec(final String[] datepatterns, final boolean oneHeader)

pack-priv
RFC2965Spec(final boolean oneHeader, final CommonCookieAttributeHandler... handlers)

Method Summary

Modifier and TypeMethod and Description
private static CookieOrigin
adjustEffectiveHost(final CookieOrigin
origin where cookie is received from or being sent to.
origin
)

Set 'effective host name' as defined in RFC 2965.

private List<Cookie>
createCookies(final HeaderElement[] elems, final CookieOrigin origin)

protected void
formatCookieAsVer(final CharArrayBuffer
The char array buffer to use for output
buffer
,
final Cookie
The Cookie to be formatted as string
cookie
,
final int
The version to use.
version
)

Overrides org.apache.http.impl.cookie.RFC2109Spec.formatCookieAsVer.

Adds valid Port attribute value, e.g. "8000,8001,8002"
public int
getVersion()

Overrides org.apache.http.impl.cookie.RFC2109Spec.getVersion.

Implements org.apache.http.cookie.CookieSpec.getVersion.

Returns version of the state management this cookie specification conforms to.
public Header
getVersionHeader()

Overrides org.apache.http.impl.cookie.RFC2109Spec.getVersionHeader.

Implements org.apache.http.cookie.CookieSpec.getVersionHeader.

Returns a request header identifying what version of the state management specification is understood.
public boolean
match(final Cookie
the Cookie to be matched
cookie
,
final CookieOrigin
the target to test against
origin
)

Overrides org.apache.http.impl.cookie.CookieSpecBase.match.

Implements org.apache.http.cookie.CookieSpec.match.

Determines if a Cookie matches the target location.
public List<Cookie>
parse(final Header
the Set-Cookie received from the server
header
,
final CookieOrigin
details of the cookie origin
origin
)

Overrides org.apache.http.impl.cookie.RFC2109Spec.parse.

Implements org.apache.http.cookie.CookieSpec.parse.

Parse the "Set-Cookie" Header into an array of Cookies.
protected List<Cookie>
public String
toString()

Overrides org.apache.http.impl.cookie.RFC2109Spec.toString.

Returns a string representation of the object.
public void
validate(final Cookie
the Cookie to validate
cookie
,
final CookieOrigin
details of the cookie origin
origin
)

Overrides org.apache.http.impl.cookie.RFC2109Spec.validate.

Implements org.apache.http.cookie.CookieSpec.validate.

Validate the cookie according to validation rules defined by the cookie specification.
Inherited from org.apache.http.impl.cookie.RFC2109Spec:
formatCookiesformatParamAsVer

Constructor Detail

RFC2965Specback to summary
public RFC2965Spec()

Default constructor

RFC2965Specback to summary
public RFC2965Spec(final String[] datepatterns, final boolean oneHeader)
RFC2965Specback to summary
pack-priv RFC2965Spec(final boolean oneHeader, final CommonCookieAttributeHandler... handlers)

Method Detail

adjustEffectiveHostback to summary
private static CookieOrigin adjustEffectiveHost(final CookieOrigin origin)

Set 'effective host name' as defined in RFC 2965.

If a host name contains no dots, the effective host name is that name with the string .local appended to it. Otherwise the effective host name is the same as the host name. Note that all effective host names contain at least one dot.

Parameters
origin:CookieOrigin

origin where cookie is received from or being sent to.

createCookiesback to summary
private List<Cookie> createCookies(final HeaderElement[] elems, final CookieOrigin origin) throws MalformedCookieException
formatCookieAsVerback to summary
protected void formatCookieAsVer(final CharArrayBuffer buffer, final Cookie cookie, final int version)

Overrides org.apache.http.impl.cookie.RFC2109Spec.formatCookieAsVer.

Adds valid Port attribute value, e.g. "8000,8001,8002"

Parameters
buffer:CharArrayBuffer

Doc from org.apache.http.impl.cookie.RFC2109Spec.formatCookieAsVer.

The char array buffer to use for output

cookie:Cookie

Doc from org.apache.http.impl.cookie.RFC2109Spec.formatCookieAsVer.

The Cookie to be formatted as string

version:int

Doc from org.apache.http.impl.cookie.RFC2109Spec.formatCookieAsVer.

The version to use.

Annotations
@Override
getVersionback to summary
public int getVersion()

Overrides org.apache.http.impl.cookie.RFC2109Spec.getVersion.

Implements org.apache.http.cookie.CookieSpec.getVersion.

Doc from org.apache.http.cookie.CookieSpec.getVersion.

Returns version of the state management this cookie specification conforms to.

Returns:int

version of the state management specification

Annotations
@Override
getVersionHeaderback to summary
public Header getVersionHeader()

Overrides org.apache.http.impl.cookie.RFC2109Spec.getVersionHeader.

Implements org.apache.http.cookie.CookieSpec.getVersionHeader.

Doc from org.apache.http.cookie.CookieSpec.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.

Annotations
@Override
matchback to summary
public boolean match(final Cookie cookie, final CookieOrigin origin)

Overrides org.apache.http.impl.cookie.CookieSpecBase.match.

Implements org.apache.http.cookie.CookieSpec.match.

Doc from org.apache.http.cookie.CookieSpec.match.

Determines if a Cookie matches the target location.

Parameters
cookie:Cookie

the Cookie to be matched

origin:CookieOrigin

the target to test against

Returns:boolean

true if the cookie should be submitted with a request with given attributes, false otherwise.

Annotations
@Override
parseback to summary
public List<Cookie> parse(final Header header, final CookieOrigin origin) throws MalformedCookieException

Overrides org.apache.http.impl.cookie.RFC2109Spec.parse.

Implements org.apache.http.cookie.CookieSpec.parse.

Doc from org.apache.http.cookie.CookieSpec.parse.

Parse the "Set-Cookie" Header into an array of Cookies.

This method will not perform the validation of the resultant Cookies

Parameters
header:Header

the Set-Cookie received from the server

origin:CookieOrigin

details of the cookie origin

Returns:List<Cookie>

an array of Cookies parsed from the header

Annotations
@Override
Exceptions
MalformedCookieException:
if an exception occurs during parsing
parseback to summary
protected List<Cookie> parse(final HeaderElement[] elems, final CookieOrigin origin) throws MalformedCookieException

Overrides org.apache.http.impl.cookie.CookieSpecBase.parse.

Annotations
@Override
toStringback to summary
public String toString()

Overrides org.apache.http.impl.cookie.RFC2109Spec.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override
validateback to summary
public void validate(final Cookie cookie, final CookieOrigin origin) throws MalformedCookieException

Overrides org.apache.http.impl.cookie.RFC2109Spec.validate.

Implements org.apache.http.cookie.CookieSpec.validate.

Doc from org.apache.http.cookie.CookieSpec.validate.

Validate the cookie according to validation rules defined by the cookie specification.

Parameters
cookie:Cookie

the Cookie to validate

origin:CookieOrigin

details of the cookie origin

Annotations
@Override
Exceptions
MalformedCookieException:
if the cookie is invalid