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 * https://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 io.netty.handler.codec.http; 17 18 import java.util.Set; 19 20 /** 21 * An interface defining an 22 * <a href="https://en.wikipedia.org/wiki/HTTP_cookie">HTTP cookie</a>. 23 * @deprecated Use {@link io.netty.handler.codec.http.cookie.Cookie} instead. 24 */ 25 @Deprecated 26 public interface Cookie extends io.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 long getMaxAge(); 83 84 /** 85 * Returns the maximum age of this {@link Cookie} in seconds or {@link Long#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 @Override 93 long maxAge(); 94 95 /** 96 * Sets the maximum age of this {@link Cookie} in seconds. 97 * If an age of {@code 0} is specified, this {@link Cookie} will be 98 * automatically removed by browser because it will expire immediately. 99 * If {@link Long#MIN_VALUE} is specified, this {@link Cookie} will be removed when the 100 * browser is closed. 101 * 102 * @param maxAge The maximum age of this {@link Cookie} in seconds 103 * 104 * @deprecated Not part of RFC6265 105 */ 106 @Deprecated 107 @Override 108 void setMaxAge(long maxAge); 109 110 /** 111 * @deprecated Use {@link #version()} instead. 112 */ 113 @Deprecated 114 int getVersion(); 115 116 /** 117 * Returns the version of this {@link Cookie}. 118 * 119 * @return The version of this {@link Cookie} 120 * 121 * @deprecated Not part of RFC6265 122 */ 123 @Deprecated 124 int version(); 125 126 /** 127 * Sets the version of this {@link Cookie}. 128 * 129 * @param version The new version to use 130 * 131 * @deprecated Not part of RFC6265 132 */ 133 @Deprecated 134 void setVersion(int version); 135 136 /** 137 * @deprecated Use {@link #commentUrl()} instead. 138 */ 139 @Deprecated 140 String getCommentUrl(); 141 142 /** 143 * Returns the comment URL of this {@link Cookie}. 144 * 145 * @return The comment URL of this {@link Cookie} 146 * 147 * @deprecated Not part of RFC6265 148 */ 149 @Deprecated 150 String commentUrl(); 151 152 /** 153 * Sets the comment URL of this {@link Cookie}. 154 * 155 * @param commentUrl The comment URL to use 156 * 157 * @deprecated Not part of RFC6265 158 */ 159 @Deprecated 160 void setCommentUrl(String commentUrl); 161 162 /** 163 * Checks to see if this {@link Cookie} is to be discarded by the browser 164 * at the end of the current session. 165 * 166 * @return True if this {@link Cookie} is to be discarded, otherwise false 167 * 168 * @deprecated Not part of RFC6265 169 */ 170 @Deprecated 171 boolean isDiscard(); 172 173 /** 174 * Sets the discard flag of this {@link Cookie}. 175 * If set to true, this {@link Cookie} will be discarded by the browser 176 * at the end of the current session 177 * 178 * @param discard True if the {@link Cookie} is to be discarded 179 * 180 * @deprecated Not part of RFC6265 181 */ 182 @Deprecated 183 void setDiscard(boolean discard); 184 185 /** 186 * @deprecated Use {@link #ports()} instead. 187 */ 188 @Deprecated 189 Set<Integer> getPorts(); 190 191 /** 192 * Returns the ports that this {@link Cookie} can be accessed on. 193 * 194 * @return The {@link Set} of ports that this {@link Cookie} can use 195 * 196 * @deprecated Not part of RFC6265 197 */ 198 @Deprecated 199 Set<Integer> ports(); 200 201 /** 202 * Sets the ports that this {@link Cookie} can be accessed on. 203 * 204 * @param ports The ports that this {@link Cookie} can be accessed on 205 * 206 * @deprecated Not part of RFC6265 207 */ 208 @Deprecated 209 void setPorts(int... ports); 210 211 /** 212 * Sets the ports that this {@link Cookie} can be accessed on. 213 * 214 * @param ports The {@link Iterable} collection of ports that this 215 * {@link Cookie} can be accessed on. 216 * 217 * @deprecated Not part of RFC6265 218 */ 219 @Deprecated 220 void setPorts(Iterable<Integer> ports); 221 }