Marked Cookie API methods obsoleted by RFC 6265 with @Obsolete annotation

git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1647643 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Oleg Kalnichevski 2014-12-23 19:02:41 +00:00
parent 70489c4bb0
commit cd41e8998d
5 changed files with 40 additions and 4 deletions

View File

@ -27,6 +27,8 @@
package org.apache.http.cookie; package org.apache.http.cookie;
import org.apache.http.annotation.Obsolete;
/** /**
* ClientCookie extends the standard {@link Cookie} interface with * ClientCookie extends the standard {@link Cookie} interface with
* additional client specific functionality such ability to retrieve * additional client specific functionality such ability to retrieve
@ -35,24 +37,29 @@
* header because some cookie specifications require that the * header because some cookie specifications require that the
* {@code Cookie} header should include certain attributes only if * {@code Cookie} header should include certain attributes only if
* they were specified in the {@code Set-Cookie} header. * they were specified in the {@code Set-Cookie} header.
* * <p>
* Please do not use attributes marked as @Obsolete. They have been rendered
* obsolete by RFC 6265.
* *
* @since 4.0 * @since 4.0
*/ */
public interface ClientCookie extends Cookie { public interface ClientCookie extends Cookie {
// RFC2109 attributes @Obsolete
public static final String VERSION_ATTR = "version"; public static final String VERSION_ATTR = "version";
public static final String PATH_ATTR = "path"; public static final String PATH_ATTR = "path";
public static final String DOMAIN_ATTR = "domain"; public static final String DOMAIN_ATTR = "domain";
public static final String MAX_AGE_ATTR = "max-age"; public static final String MAX_AGE_ATTR = "max-age";
public static final String SECURE_ATTR = "secure"; public static final String SECURE_ATTR = "secure";
@Obsolete
public static final String COMMENT_ATTR = "comment"; public static final String COMMENT_ATTR = "comment";
public static final String EXPIRES_ATTR = "expires"; public static final String EXPIRES_ATTR = "expires";
// RFC2965 attributes @Obsolete
public static final String PORT_ATTR = "port"; public static final String PORT_ATTR = "port";
@Obsolete
public static final String COMMENTURL_ATTR = "commenturl"; public static final String COMMENTURL_ATTR = "commenturl";
@Obsolete
public static final String DISCARD_ATTR = "discard"; public static final String DISCARD_ATTR = "discard";
String getAttribute(String name); String getAttribute(String name);

View File

@ -29,11 +29,16 @@
import java.util.Date; import java.util.Date;
import org.apache.http.annotation.Obsolete;
/** /**
* Cookie interface represents a token or short packet of state information * Cookie interface represents a token or short packet of state information
* (also referred to as "magic-cookie") that the HTTP agent and the target * (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 * server can exchange to maintain a session. In its simples form an HTTP
* cookie is merely a name / value pair. * cookie is merely a name / value pair.
* <p>
* Please do not use attributes marked as @Obsolete. They have been rendered
* obsolete by RFC 6265.
* *
* @since 4.0 * @since 4.0
*/ */
@ -59,12 +64,14 @@ public interface Cookie {
* *
* @return comment * @return comment
*/ */
@Obsolete
String getComment(); String getComment();
/** /**
* If a user agent (web browser) presents this cookie to a user, the * 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. * cookie's purpose will be described by the information at this URL.
*/ */
@Obsolete
String getCommentURL(); String getCommentURL();
/** /**
@ -107,6 +114,7 @@ public interface Cookie {
* Get the Port attribute. It restricts the ports to which a cookie * Get the Port attribute. It restricts the ports to which a cookie
* may be returned in a Cookie request header. * may be returned in a Cookie request header.
*/ */
@Obsolete
int[] getPorts(); int[] getPorts();
/** /**
@ -123,6 +131,7 @@ public interface Cookie {
* *
* @return the version of the cookie. * @return the version of the cookie.
*/ */
@Obsolete
int getVersion(); int getVersion();
/** /**

View File

@ -30,6 +30,7 @@
import java.util.List; import java.util.List;
import org.apache.http.Header; import org.apache.http.Header;
import org.apache.http.annotation.Obsolete;
/** /**
* Defines the cookie management specification. * Defines the cookie management specification.
@ -40,7 +41,9 @@
* <li> formatting of "Cookie" header * <li> formatting of "Cookie" header
* </ul> * </ul>
* for a given host, port and path of origin * for a given host, port and path of origin
* * <p>
* Please do not use methods marked as @Obsolete. They have been rendered
* obsolete by RFC 6265.
* *
* @since 4.0 * @since 4.0
*/ */
@ -52,6 +55,7 @@ public interface CookieSpec {
* *
* @return version of the state management specification * @return version of the state management specification
*/ */
@Obsolete
int getVersion(); int getVersion();
/** /**
@ -104,6 +108,7 @@ public interface CookieSpec {
* specification is understood. May be {@code null} if the cookie * specification is understood. May be {@code null} if the cookie
* specification does not support {@code Cookie2} header. * specification does not support {@code Cookie2} header.
*/ */
@Obsolete
Header getVersionHeader(); Header getVersionHeader();
} }

View File

@ -29,9 +29,14 @@
import java.util.Date; import java.util.Date;
import org.apache.http.annotation.Obsolete;
/** /**
* This interface represents a {@code Set-Cookie} response header sent by the * 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. * origin server to the HTTP agent in order to maintain a conversational state.
* <p>
* Please do not use methods marked as @Obsolete. They have been rendered
* obsolete by RFC 6265
* *
* @since 4.0 * @since 4.0
*/ */
@ -47,6 +52,7 @@ public interface SetCookie extends Cookie {
* *
* @see #getComment() * @see #getComment()
*/ */
@Obsolete
void setComment(String comment); void setComment(String comment);
/** /**
@ -103,6 +109,7 @@ public interface SetCookie extends Cookie {
* *
* @see Cookie#getVersion * @see Cookie#getVersion
*/ */
@Obsolete
void setVersion(int version); void setVersion(int version);
} }

View File

@ -27,9 +27,14 @@
package org.apache.http.cookie; package org.apache.http.cookie;
import org.apache.http.annotation.Obsolete;
/** /**
* This interface represents a {@code Set-Cookie2} response header sent by the * 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. * origin server to the HTTP agent in order to maintain a conversational state.
* <p>
* Please do not use methods marked as @Obsolete. They have been rendered
* obsolete by RFC 6265
* *
* @since 4.0 * @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 * 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. * cookie's purpose will be described by the information at this URL.
*/ */
@Obsolete
void setCommentURL(String commentURL); void setCommentURL(String commentURL);
/** /**
* Sets the Port attribute. It restricts the ports to which a cookie * Sets the Port attribute. It restricts the ports to which a cookie
* may be returned in a Cookie request header. * may be returned in a Cookie request header.
*/ */
@Obsolete
void setPorts(int[] ports); void setPorts(int[] ports);
/** /**
@ -54,6 +61,7 @@ public interface SetCookie2 extends SetCookie {
* *
* @see #isPersistent() * @see #isPersistent()
*/ */
@Obsolete
void setDiscard(boolean discard); void setDiscard(boolean discard);
} }