diff --git a/httpclient/src/main/java/org/apache/http/cookie/ClientCookie.java b/httpclient/src/main/java/org/apache/http/cookie/ClientCookie.java index dde42d22d..aa5fee881 100644 --- a/httpclient/src/main/java/org/apache/http/cookie/ClientCookie.java +++ b/httpclient/src/main/java/org/apache/http/cookie/ClientCookie.java @@ -27,6 +27,8 @@ package org.apache.http.cookie; +import org.apache.http.annotation.Obsolete; + /** * ClientCookie extends the standard {@link Cookie} interface with * additional client specific functionality such ability to retrieve @@ -35,24 +37,29 @@ * header because some cookie specifications require that the * {@code Cookie} header should include certain attributes only if * they were specified in the {@code Set-Cookie} header. - * + *

+ * Please do not use attributes marked as @Obsolete. They have been rendered + * obsolete by RFC 6265. * * @since 4.0 */ public interface ClientCookie extends Cookie { - // RFC2109 attributes + @Obsolete public static final String VERSION_ATTR = "version"; public static final String PATH_ATTR = "path"; public static final String DOMAIN_ATTR = "domain"; public static final String MAX_AGE_ATTR = "max-age"; public static final String SECURE_ATTR = "secure"; + @Obsolete public static final String COMMENT_ATTR = "comment"; public static final String EXPIRES_ATTR = "expires"; - // RFC2965 attributes + @Obsolete public static final String PORT_ATTR = "port"; + @Obsolete public static final String COMMENTURL_ATTR = "commenturl"; + @Obsolete public static final String DISCARD_ATTR = "discard"; String getAttribute(String name); diff --git a/httpclient/src/main/java/org/apache/http/cookie/Cookie.java b/httpclient/src/main/java/org/apache/http/cookie/Cookie.java index 2b9b5b42a..e2592813a 100644 --- a/httpclient/src/main/java/org/apache/http/cookie/Cookie.java +++ b/httpclient/src/main/java/org/apache/http/cookie/Cookie.java @@ -29,11 +29,16 @@ import java.util.Date; +import org.apache.http.annotation.Obsolete; + /** * Cookie interface represents a token or short packet of state information * (also referred to as "magic-cookie") that the HTTP agent and the target * server can exchange to maintain a session. In its simples form an HTTP * cookie is merely a name / value pair. + *

+ * Please do not use attributes marked as @Obsolete. They have been rendered + * obsolete by RFC 6265. * * @since 4.0 */ @@ -59,12 +64,14 @@ public interface Cookie { * * @return comment */ + @Obsolete String getComment(); /** * If a user agent (web browser) presents this cookie to a user, the * cookie's purpose will be described by the information at this URL. */ + @Obsolete String getCommentURL(); /** @@ -107,6 +114,7 @@ public interface Cookie { * Get the Port attribute. It restricts the ports to which a cookie * may be returned in a Cookie request header. */ + @Obsolete int[] getPorts(); /** @@ -123,6 +131,7 @@ public interface Cookie { * * @return the version of the cookie. */ + @Obsolete int getVersion(); /** diff --git a/httpclient/src/main/java/org/apache/http/cookie/CookieSpec.java b/httpclient/src/main/java/org/apache/http/cookie/CookieSpec.java index 2443e612a..c3aceffdd 100644 --- a/httpclient/src/main/java/org/apache/http/cookie/CookieSpec.java +++ b/httpclient/src/main/java/org/apache/http/cookie/CookieSpec.java @@ -30,6 +30,7 @@ import java.util.List; import org.apache.http.Header; +import org.apache.http.annotation.Obsolete; /** * Defines the cookie management specification. @@ -40,7 +41,9 @@ *

  • formatting of "Cookie" header * * for a given host, port and path of origin - * + *

    + * Please do not use methods marked as @Obsolete. They have been rendered + * obsolete by RFC 6265. * * @since 4.0 */ @@ -52,6 +55,7 @@ public interface CookieSpec { * * @return version of the state management specification */ + @Obsolete int getVersion(); /** @@ -104,6 +108,7 @@ public interface CookieSpec { * specification is understood. May be {@code null} if the cookie * specification does not support {@code Cookie2} header. */ + @Obsolete Header getVersionHeader(); } diff --git a/httpclient/src/main/java/org/apache/http/cookie/SetCookie.java b/httpclient/src/main/java/org/apache/http/cookie/SetCookie.java index 432838ddd..7008bf5e0 100644 --- a/httpclient/src/main/java/org/apache/http/cookie/SetCookie.java +++ b/httpclient/src/main/java/org/apache/http/cookie/SetCookie.java @@ -29,9 +29,14 @@ import java.util.Date; +import org.apache.http.annotation.Obsolete; + /** * This interface represents a {@code Set-Cookie} response header sent by the * origin server to the HTTP agent in order to maintain a conversational state. + *

    + * Please do not use methods marked as @Obsolete. They have been rendered + * obsolete by RFC 6265 * * @since 4.0 */ @@ -47,6 +52,7 @@ public interface SetCookie extends Cookie { * * @see #getComment() */ + @Obsolete void setComment(String comment); /** @@ -103,6 +109,7 @@ public interface SetCookie extends Cookie { * * @see Cookie#getVersion */ + @Obsolete void setVersion(int version); } diff --git a/httpclient/src/main/java/org/apache/http/cookie/SetCookie2.java b/httpclient/src/main/java/org/apache/http/cookie/SetCookie2.java index 3bf5672fd..2f07298d0 100644 --- a/httpclient/src/main/java/org/apache/http/cookie/SetCookie2.java +++ b/httpclient/src/main/java/org/apache/http/cookie/SetCookie2.java @@ -27,9 +27,14 @@ package org.apache.http.cookie; +import org.apache.http.annotation.Obsolete; + /** * This interface represents a {@code Set-Cookie2} response header sent by the * origin server to the HTTP agent in order to maintain a conversational state. + *

    + * Please do not use methods marked as @Obsolete. They have been rendered + * obsolete by RFC 6265 * * @since 4.0 */ @@ -39,12 +44,14 @@ public interface SetCookie2 extends SetCookie { * If a user agent (web browser) presents this cookie to a user, the * cookie's purpose will be described by the information at this URL. */ + @Obsolete void setCommentURL(String commentURL); /** * Sets the Port attribute. It restricts the ports to which a cookie * may be returned in a Cookie request header. */ + @Obsolete void setPorts(int[] ports); /** @@ -54,6 +61,7 @@ public interface SetCookie2 extends SetCookie { * * @see #isPersistent() */ + @Obsolete void setDiscard(boolean discard); }