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

public Class RFC2965DomainAttributeHandler

extends Object
implements CommonCookieAttributeHandler
Class Inheritance
All Implemented Interfaces
org.apache.http.cookie.CommonCookieAttributeHandler, org.apache.http.cookie.CookieAttributeHandler
Annotations
@Contract
threading:IMMUTABLE
Imports
java.util.Locale, org.apache.http.annotation.Contract, .ThreadingBehavior, org.apache.http.cookie.ClientCookie, .CommonCookieAttributeHandler, .Cookie, .CookieOrigin, .CookieRestrictionViolationException, .MalformedCookieException, .SetCookie, org.apache.http.util.Args

"Domain" cookie attribute handler for RFC 2965 cookie spec.
Since
3.1

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true if the specified host matches the given domain.
domainMatch
(final String
host name where cookie is received from or being sent to.
host
,
final String
The cookie domain attribute.
domain
)

Performs domain-match as defined by the RFC2965.

public String
public boolean
match(final Cookie cookie, final CookieOrigin
the cookie source to match against
origin
)

Implements org.apache.http.cookie.CookieAttributeHandler.match.

Match cookie domain attribute.
public void
parse(final SetCookie cookie, final String
cookie attribute value from the cookie response header
domain
)

Implements org.apache.http.cookie.CookieAttributeHandler.parse.

Parse cookie domain attribute.
public void
validate(final Cookie cookie, final CookieOrigin
the cookie source to validate against
origin
)

Implements org.apache.http.cookie.CookieAttributeHandler.validate.

Validate cookie domain attribute.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

RFC2965DomainAttributeHandlerback to summary
public RFC2965DomainAttributeHandler()

Method Detail

domainMatchback to summary
public boolean domainMatch(final String host, final String domain)

Performs domain-match as defined by the RFC2965.

Host A's name domain-matches host B's if

  1. their host name strings string-compare equal; or
  2. A is a HDN string and has the form NB, where N is a non-empty name string, B has the form .B', and B' is a HDN string. (So, x.y.com domain-matches .Y.com but not Y.com.)
Parameters
host:String

host name where cookie is received from or being sent to.

domain:String

The cookie domain attribute.

Returns:boolean

true if the specified host matches the given domain.

getAttributeNameback to summary
public String getAttributeName()

Implements org.apache.http.cookie.CommonCookieAttributeHandler.getAttributeName.

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

Implements org.apache.http.cookie.CookieAttributeHandler.match.

Match cookie domain attribute.

Parameters
cookie:Cookie

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

org.apache.http.cookie.Cookie to match

origin:CookieOrigin

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

the cookie source to match against

Returns:boolean

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

true if the match is successful; false otherwise

Annotations
@Override
parseback to summary
public void parse(final SetCookie cookie, final String domain) throws MalformedCookieException

Implements org.apache.http.cookie.CookieAttributeHandler.parse.

Parse cookie domain attribute.

Parameters
cookie:SetCookie

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

org.apache.http.cookie.Cookie to be updated

domain:String

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

cookie attribute value from the cookie response header

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

Implements org.apache.http.cookie.CookieAttributeHandler.validate.

Validate cookie domain attribute.

Parameters
cookie:Cookie

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

org.apache.http.cookie.Cookie to validate

origin:CookieOrigin

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

the cookie source to validate against

Annotations
@Override
Exceptions
MalformedCookieException:

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

if cookie validation fails for this attribute