Class RFC2965Spec

    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String SET_COOKIE2_KEY
      Deprecated.
      Cookie Response Header name for cookies processed by this spec.
    • Constructor Summary

      Constructors 
      Constructor Description
      RFC2965Spec()
      Deprecated.
      Default constructor
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      boolean domainMatch​(java.lang.String host, java.lang.String domain)
      Deprecated.
      Performs domain-match as defined by the RFC2965.
      java.lang.String formatCookie​(Cookie cookie)
      Deprecated.
      Return a string suitable for sending in a "Cookie" header as defined in RFC 2965
      java.lang.String formatCookies​(Cookie[] cookies)
      Deprecated.
      Create a RFC 2965 compliant "Cookie" header value containing all Cookies suitable for sending in a "Cookie" header
      int getVersion()
      Deprecated.
       
      Header getVersionHeader()
      Deprecated.
       
      boolean match​(java.lang.String host, int port, java.lang.String path, boolean secure, Cookie cookie)
      Deprecated.
      Return true if the cookie should be submitted with a request with given attributes, false otherwise.
      Cookie[] parse​(java.lang.String host, int port, java.lang.String path, boolean secure, java.lang.String header)
      Deprecated.
      Parses the Set-Cookie value into an array of Cookies.
      Cookie[] parse​(java.lang.String host, int port, java.lang.String path, boolean secure, Header header)
      Deprecated.
      Parses the Set-Cookie2 value into an array of Cookies.
      void parseAttribute​(NameValuePair attribute, Cookie cookie)
      Deprecated.
      Parse RFC 2965 specific cookie attribute and update the corresponsing Cookie properties.
      void validate​(java.lang.String host, int port, java.lang.String path, boolean secure, Cookie cookie)
      Deprecated.
      Performs RFC 2965 compliant Cookie validation
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • SET_COOKIE2_KEY

        public static final java.lang.String SET_COOKIE2_KEY
        Deprecated.
        Cookie Response Header name for cookies processed by this spec.
        See Also:
        Constant Field Values
    • Constructor Detail

      • RFC2965Spec

        public RFC2965Spec()
        Deprecated.
        Default constructor
    • Method Detail

      • parse

        public Cookie[] parse​(java.lang.String host,
                              int port,
                              java.lang.String path,
                              boolean secure,
                              Header header)
                       throws MalformedCookieException
        Deprecated.
        Parses the Set-Cookie2 value into an array of Cookies.

        The syntax for the Set-Cookie2 response header is:

         set-cookie      =    "Set-Cookie2:" cookies
         cookies         =    1#cookie
         cookie          =    NAME "=" VALUE * (";" cookie-av)
         NAME            =    attr
         VALUE           =    value
         cookie-av       =    "Comment" "=" value
                         |    "CommentURL" "=" <"> http_URL <">
                         |    "Discard"
                         |    "Domain" "=" value
                         |    "Max-Age" "=" value
                         |    "Path" "=" value
                         |    "Port" [ "=" <"> portlist <"> ]
                         |    "Secure"
                         |    "Version" "=" 1*DIGIT
         portlist        =       1#portnum
         portnum         =       1*DIGIT
         
        Specified by:
        parse in interface CookieSpec
        Overrides:
        parse in class CookieSpecBase
        Parameters:
        host - the host from which the Set-Cookie2 value was received
        port - the port from which the Set-Cookie2 value was received
        path - the path from which the Set-Cookie2 value was received
        secure - true when the Set-Cookie2 value was received over secure conection
        header - the Set-Cookie2 Header received from the server
        Returns:
        an array of Cookies parsed from the Set-Cookie2 value
        Throws:
        MalformedCookieException - if an exception occurs during parsing
        See Also:
        CookieSpec.validate(String, int, String, boolean, Cookie)
      • parse

        public Cookie[] parse​(java.lang.String host,
                              int port,
                              java.lang.String path,
                              boolean secure,
                              java.lang.String header)
                       throws MalformedCookieException
        Deprecated.
        Description copied from class: CookieSpecBase
        Parses the Set-Cookie value into an array of Cookies.

        The syntax for the Set-Cookie response header is:

         set-cookie      =    "Set-Cookie:" cookies
         cookies         =    1#cookie
         cookie          =    NAME "=" VALUE * (";" cookie-av)
         NAME            =    attr
         VALUE           =    value
         cookie-av       =    "Comment" "=" value
                         |    "Domain" "=" value
                         |    "Max-Age" "=" value
                         |    "Path" "=" value
                         |    "Secure"
                         |    "Version" "=" 1*DIGIT
         
        Specified by:
        parse in interface CookieSpec
        Overrides:
        parse in class CookieSpecBase
        Parameters:
        host - the host from which the Set-Cookie value was received
        port - the port from which the Set-Cookie value was received
        path - the path from which the Set-Cookie value was received
        secure - true when the Set-Cookie value was received over secure conection
        header - the Set-Cookie received from the server
        Returns:
        an array of Cookies parsed from the Set-Cookie value
        Throws:
        MalformedCookieException - if an exception occurs during parsing
        See Also:
        parse(String, int, String, boolean, org.apache.commons.httpclient.Header)
      • validate

        public void validate​(java.lang.String host,
                             int port,
                             java.lang.String path,
                             boolean secure,
                             Cookie cookie)
                      throws MalformedCookieException
        Deprecated.
        Performs RFC 2965 compliant Cookie validation
        Specified by:
        validate in interface CookieSpec
        Overrides:
        validate in class CookieSpecBase
        Parameters:
        host - the host from which the Cookie was received
        port - the port from which the Cookie was received
        path - the path from which the Cookie was received
        secure - true when the Cookie was received using a secure connection
        cookie - The cookie to validate
        Throws:
        MalformedCookieException - if an exception occurs during validation
      • match

        public boolean match​(java.lang.String host,
                             int port,
                             java.lang.String path,
                             boolean secure,
                             Cookie cookie)
        Deprecated.
        Return true if the cookie should be submitted with a request with given attributes, false otherwise.
        Specified by:
        match in interface CookieSpec
        Overrides:
        match in class CookieSpecBase
        Parameters:
        host - the host to which the request is being submitted
        port - the port to which the request is being submitted (ignored)
        path - the path to which the request is being submitted
        secure - true if the request is using a secure connection
        cookie - Cookie to be matched
        Returns:
        true if the cookie matches the criterium
      • formatCookie

        public java.lang.String formatCookie​(Cookie cookie)
        Deprecated.
        Return a string suitable for sending in a "Cookie" header as defined in RFC 2965
        Specified by:
        formatCookie in interface CookieSpec
        Overrides:
        formatCookie in class CookieSpecBase
        Parameters:
        cookie - a Cookie to be formatted as string
        Returns:
        a string suitable for sending in a "Cookie" header.
      • formatCookies

        public java.lang.String formatCookies​(Cookie[] cookies)
        Deprecated.
        Create a RFC 2965 compliant "Cookie" header value containing all Cookies suitable for sending in a "Cookie" header
        Specified by:
        formatCookies in interface CookieSpec
        Overrides:
        formatCookies in class CookieSpecBase
        Parameters:
        cookies - an array of Cookies to be formatted
        Returns:
        a string suitable for sending in a Cookie header.
      • domainMatch

        public boolean domainMatch​(java.lang.String host,
                                   java.lang.String domain)
        Deprecated.
        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.)
        Specified by:
        domainMatch in interface CookieSpec
        Overrides:
        domainMatch in class CookieSpecBase
        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.