org.apache.http.impl.cookie
Class RFC2965DomainAttributeHandlerHC4

java.lang.Object
  extended by org.apache.http.impl.cookie.RFC2965DomainAttributeHandlerHC4
All Implemented Interfaces:
org.apache.http.cookie.CookieAttributeHandler

@Immutable
public class RFC2965DomainAttributeHandlerHC4
extends java.lang.Object
implements org.apache.http.cookie.CookieAttributeHandler

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

Since:
3.1

Constructor Summary
RFC2965DomainAttributeHandlerHC4()
           
 
Method Summary
 boolean domainMatch(java.lang.String host, java.lang.String domain)
          Performs domain-match as defined by the RFC2965.
 boolean match(org.apache.http.cookie.Cookie cookie, org.apache.http.cookie.CookieOrigin origin)
          Match cookie domain attribute.
 void parse(org.apache.http.cookie.SetCookie cookie, java.lang.String domain)
          Parse cookie domain attribute.
 void validate(org.apache.http.cookie.Cookie cookie, org.apache.http.cookie.CookieOrigin origin)
          Validate cookie domain attribute.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RFC2965DomainAttributeHandlerHC4

public RFC2965DomainAttributeHandlerHC4()
Method Detail

parse

public void parse(org.apache.http.cookie.SetCookie cookie,
                  java.lang.String domain)
           throws org.apache.http.cookie.MalformedCookieException
Parse cookie domain attribute.

Specified by:
parse in interface org.apache.http.cookie.CookieAttributeHandler
Throws:
org.apache.http.cookie.MalformedCookieException

domainMatch

public boolean domainMatch(java.lang.String host,
                           java.lang.String domain)
Performs domain-match as defined by the RFC2965.

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

      their host name strings string-compare equal; or
      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 - host name where cookie is received from or being sent to.
domain - The cookie domain attribute.
Returns:
true if the specified host matches the given domain.

validate

public void validate(org.apache.http.cookie.Cookie cookie,
                     org.apache.http.cookie.CookieOrigin origin)
              throws org.apache.http.cookie.MalformedCookieException
Validate cookie domain attribute.

Specified by:
validate in interface org.apache.http.cookie.CookieAttributeHandler
Throws:
org.apache.http.cookie.MalformedCookieException

match

public boolean match(org.apache.http.cookie.Cookie cookie,
                     org.apache.http.cookie.CookieOrigin origin)
Match cookie domain attribute.

Specified by:
match in interface org.apache.http.cookie.CookieAttributeHandler