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

public Class BasicDomainHandler

extends Object
implements CommonCookieAttributeHandler
Class Inheritance
All Implemented Interfaces
org.apache.hc.client5.http.cookie.CommonCookieAttributeHandler, org.apache.hc.client5.http.cookie.CookieAttributeHandler
Annotations
@Contract
threading:STATELESS
Imports
java.util.Locale, org.apache.hc.client5.http.cookie.CommonCookieAttributeHandler, .Cookie, .CookieOrigin, .CookieRestrictionViolationException, .MalformedCookieException, .SetCookie, org.apache.hc.core5.annotation.Contract, .ThreadingBehavior, org.apache.hc.core5.net.InetAddressUtils, org.apache.hc.core5.util.Args, .TextUtils

Cookie domain attribute handler.
Since
4.0

Field Summary

Modifier and TypeField and Description
public static final BasicDomainHandler
INSTANCE

Singleton instance.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
pack-priv static boolean
domainMatch(final String domain, final String host)

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

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

Matches the given value (property of the destination host where request is being submitted) with the corresponding cookie attribute.
public void
parse(final SetCookie cookie, final String
cookie attribute value from the cookie response header
value
)

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

Parse the given cookie attribute value and processChallenge the corresponding org.apache.hc.client5.http.cookie.Cookie property.
public void
validate(final Cookie cookie, final CookieOrigin
the cookie source to validate against
origin
)

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

Performs cookie validation for the given attribute value.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

INSTANCEback to summary
public static final BasicDomainHandler INSTANCE

Singleton instance.

Since
5.2

Constructor Detail

BasicDomainHandlerback to summary
public BasicDomainHandler()

Method Detail

domainMatchback to summary
pack-priv static boolean domainMatch(final String domain, final String host)
getAttributeNameback to summary
public String getAttributeName()

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

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

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

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

Matches the given value (property of the destination host where request is being submitted) with the corresponding cookie attribute.

Parameters
cookie:Cookie

org.apache.hc.client5.http.cookie.Cookie to match

origin:CookieOrigin

the cookie source to match against

Returns:boolean

true if the match is successful; false otherwise

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

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

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

Parse the given cookie attribute value and processChallenge the corresponding org.apache.hc.client5.http.cookie.Cookie property.

Parameters
cookie:SetCookie

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

value:String

cookie attribute value from the cookie response header

Annotations
@Override
Exceptions
MalformedCookieException:
if cookie parsing fails for this attribute
validateback to summary
public void validate(final Cookie cookie, final CookieOrigin origin) throws MalformedCookieException

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

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

Performs cookie validation for the given attribute value.

Parameters
cookie:Cookie

org.apache.hc.client5.http.cookie.Cookie to validate

origin:CookieOrigin

the cookie source to validate against

Annotations
@Override
Exceptions
MalformedCookieException:
if cookie validation fails for this attribute