1 /*
2 * Copyright 2012 The Netty Project
3 *
4 * The Netty Project licenses this file to you under the Apache License,
5 * version 2.0 (the "License"); you may not use this file except in compliance
6 * with the License. You may obtain a copy of the License at:
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 * License for the specific language governing permissions and limitations
14 * under the License.
15 */
16 package org.jboss.netty.handler.codec.http;
17
18 import java.util.Set;
19
20 /**
21 * An interface defining an
22 * <a href="http://en.wikipedia.org/wiki/HTTP_cookie">HTTP cookie</a>.
23 * @deprecated Use {@link org.jboss.netty.handler.codec.http.cookie.Cookie} instead.
24 */
25 @Deprecated
26 public interface Cookie extends org.jboss.netty.handler.codec.http.cookie.Cookie {
27
28 /**
29 * @deprecated Use {@link #name()} instead.
30 */
31 @Deprecated
32 String getName();
33
34 /**
35 * @deprecated Use {@link #value()} instead.
36 */
37 @Deprecated
38 String getValue();
39
40 /**
41 * @deprecated Use {@link #domain()} instead.
42 */
43 @Deprecated
44 String getDomain();
45
46 /**
47 * @deprecated Use {@link #path()} instead.
48 */
49 @Deprecated
50 String getPath();
51
52 /**
53 * @deprecated Use {@link #comment()} instead.
54 */
55 @Deprecated
56 String getComment();
57
58 /**
59 * Returns the comment of this {@link Cookie}.
60 *
61 * @return The comment of this {@link Cookie}
62 *
63 * @deprecated Not part of RFC6265
64 */
65 @Deprecated
66 String comment();
67
68 /**
69 * Sets the comment of this {@link Cookie}.
70 *
71 * @param comment The comment to use
72 *
73 * @deprecated Not part of RFC6265
74 */
75 @Deprecated
76 void setComment(String comment);
77
78 /**
79 * @deprecated Use {@link #maxAge()} instead.
80 */
81 @Deprecated
82 int getMaxAge();
83
84 /**
85 * Returns the maximum age of this {@link Cookie} in seconds or {@link Integer#MIN_VALUE} if unspecified
86 *
87 * @return The maximum age of this {@link Cookie}
88 *
89 * @deprecated Not part of RFC6265
90 */
91 @Deprecated
92 int maxAge();
93
94 /**
95 * Sets the maximum age of this {@link Cookie} in seconds.
96 * If an age of {@code 0} is specified, this {@link Cookie} will be
97 * automatically removed by browser because it will expire immediately.
98 * If {@link Integer#MIN_VALUE} is specified, this {@link Cookie} will be removed when the
99 * browser is closed.
100 *
101 * @param maxAge The maximum age of this {@link Cookie} in seconds
102 *
103 * @deprecated Not part of RFC6265
104 */
105 @Deprecated
106 void setMaxAge(int maxAge);
107
108 /**
109 * @deprecated Use {@link #version()} instead.
110 */
111 @Deprecated
112 int getVersion();
113
114 /**
115 * Returns the version of this {@link Cookie}.
116 *
117 * @return The version of this {@link Cookie}
118 *
119 * @deprecated Not part of RFC6265
120 */
121 @Deprecated
122 int version();
123
124 /**
125 * Sets the version of this {@link Cookie}.
126 *
127 * @param version The new version to use
128 *
129 * @deprecated Not part of RFC6265
130 */
131 @Deprecated
132 void setVersion(int version);
133
134 /**
135 * @deprecated Use {@link #commentUrl()} instead.
136 */
137 @Deprecated
138 String getCommentUrl();
139
140 /**
141 * Returns the comment URL of this {@link Cookie}.
142 *
143 * @return The comment URL of this {@link Cookie}
144 *
145 * @deprecated Not part of RFC6265
146 */
147 @Deprecated
148 String commentUrl();
149
150 /**
151 * Sets the comment URL of this {@link Cookie}.
152 *
153 * @param commentUrl The comment URL to use
154 *
155 * @deprecated Not part of RFC6265
156 */
157 @Deprecated
158 void setCommentUrl(String commentUrl);
159
160 /**
161 * Checks to see if this {@link Cookie} is to be discarded by the browser
162 * at the end of the current session.
163 *
164 * @return True if this {@link Cookie} is to be discarded, otherwise false
165 *
166 * @deprecated Not part of RFC6265
167 */
168 @Deprecated
169 boolean isDiscard();
170
171 /**
172 * Sets the discard flag of this {@link Cookie}.
173 * If set to true, this {@link Cookie} will be discarded by the browser
174 * at the end of the current session
175 *
176 * @param discard True if the {@link Cookie} is to be discarded
177 *
178 * @deprecated Not part of RFC6265
179 */
180 @Deprecated
181 void setDiscard(boolean discard);
182
183 /**
184 * @deprecated Use {@link #ports()} instead.
185 */
186 @Deprecated
187 Set<Integer> getPorts();
188
189 /**
190 * Returns the ports that this {@link Cookie} can be accessed on.
191 *
192 * @return The {@link Set} of ports that this {@link Cookie} can use
193 *
194 * @deprecated Not part of RFC6265
195 */
196 @Deprecated
197 Set<Integer> ports();
198
199 /**
200 * Sets the ports that this {@link Cookie} can be accessed on.
201 *
202 * @param ports The ports that this {@link Cookie} can be accessed on
203 *
204 * @deprecated Not part of RFC6265
205 */
206 @Deprecated
207 void setPorts(int... ports);
208
209 /**
210 * Sets the ports that this {@link Cookie} can be accessed on.
211 *
212 * @param ports The {@link Iterable} collection of ports that this
213 * {@link Cookie} can be accessed on.
214 *
215 * @deprecated Not part of RFC6265
216 */
217 @Deprecated
218 void setPorts(Iterable<Integer> ports);
219 }