netty5/codec-http/src/main/java/io/netty/handler/codec/http/Cookie.java

222 lines
5.4 KiB
Java
Raw Normal View History

2009-02-17 18:13:13 +01:00
/*
2012-06-04 22:31:44 +02:00
* Copyright 2012 The Netty Project
2009-06-19 19:48:17 +02:00
*
* The Netty Project licenses this file to you under the Apache License,
* version 2.0 (the "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at:
2009-02-17 18:13:13 +01:00
*
2012-06-04 22:31:44 +02:00
* http://www.apache.org/licenses/LICENSE-2.0
2009-02-17 18:13:13 +01:00
*
2009-08-28 09:15:49 +02:00
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
2009-08-28 09:15:49 +02:00
* License for the specific language governing permissions and limitations
* under the License.
2009-02-17 18:13:13 +01:00
*/
2011-12-09 04:38:59 +01:00
package io.netty.handler.codec.http;
2009-02-17 18:13:13 +01:00
import java.util.Set;
2009-02-17 18:13:13 +01:00
/**
2012-06-29 10:59:12 +02:00
* An interface defining an
* <a href="http://en.wikipedia.org/wiki/HTTP_cookie">HTTP cookie</a>.
* @deprecated Use {@link io.netty.handler.codec.http.cookie.Cookie} instead.
2009-02-17 18:13:13 +01:00
*/
@Deprecated
public interface Cookie extends io.netty.handler.codec.http.cookie.Cookie {
2009-06-19 16:49:26 +02:00
/**
* @deprecated Use {@link #name()} instead.
*/
@Deprecated
String getName();
/**
* @deprecated Use {@link #value()} instead.
*/
@Deprecated
String getValue();
2009-06-19 16:49:26 +02:00
/**
* @deprecated Use {@link #domain()} instead.
*/
@Deprecated
String getDomain();
/**
* @deprecated Use {@link #path()} instead.
*/
@Deprecated
String getPath();
/**
* @deprecated Use {@link #comment()} instead.
*/
@Deprecated
String getComment();
2009-06-19 16:49:26 +02:00
/**
* Returns the comment of this {@link Cookie}.
2012-06-29 10:59:12 +02:00
*
* @return The comment of this {@link Cookie}
*
* @deprecated Not part of RFC6265
2009-06-19 16:49:26 +02:00
*/
@Deprecated
String comment();
2009-06-19 16:49:26 +02:00
/**
2012-06-29 10:59:12 +02:00
* Sets the comment of this {@link Cookie}.
*
* @param comment The comment to use
*
* @deprecated Not part of RFC6265
2009-06-19 16:49:26 +02:00
*/
@Deprecated
void setComment(String comment);
2009-06-19 16:49:26 +02:00
/**
* @deprecated Use {@link #maxAge()} instead.
*/
@Deprecated
long getMaxAge();
2009-06-19 16:49:26 +02:00
/**
* Returns the maximum age of this {@link Cookie} in seconds or {@link Long#MIN_VALUE} if unspecified
2012-06-29 10:59:12 +02:00
*
* @return The maximum age of this {@link Cookie}
*
* @deprecated Not part of RFC6265
2009-06-19 16:49:26 +02:00
*/
@Deprecated
@Override
long maxAge();
2009-06-19 16:49:26 +02:00
/**
2012-06-29 10:59:12 +02:00
* Sets the maximum age of this {@link Cookie} in seconds.
* If an age of {@code 0} is specified, this {@link Cookie} will be
* automatically removed by browser because it will expire immediately.
* If {@link Long#MIN_VALUE} is specified, this {@link Cookie} will be removed when the
2012-06-29 10:59:12 +02:00
* browser is closed.
*
* @param maxAge The maximum age of this {@link Cookie} in seconds
*
* @deprecated Not part of RFC6265
2009-06-19 16:49:26 +02:00
*/
@Deprecated
@Override
void setMaxAge(long maxAge);
2009-06-19 16:49:26 +02:00
/**
* @deprecated Use {@link #version()} instead.
*/
@Deprecated
int getVersion();
2009-06-19 16:49:26 +02:00
/**
* Returns the version of this {@link Cookie}.
2012-06-29 10:59:12 +02:00
*
* @return The version of this {@link Cookie}
*
* @deprecated Not part of RFC6265
2009-06-19 16:49:26 +02:00
*/
@Deprecated
int version();
2009-06-19 16:49:26 +02:00
/**
2012-06-29 10:59:12 +02:00
* Sets the version of this {@link Cookie}.
*
* @param version The new version to use
*
* @deprecated Not part of RFC6265
2009-06-19 16:49:26 +02:00
*/
@Deprecated
void setVersion(int version);
/**
* @deprecated Use {@link #commentUrl()} instead.
*/
@Deprecated
String getCommentUrl();
2009-06-19 16:49:26 +02:00
/**
* Returns the comment URL of this {@link Cookie}.
2012-06-29 10:59:12 +02:00
*
* @return The comment URL of this {@link Cookie}
*
* @deprecated Not part of RFC6265
2009-06-19 16:49:26 +02:00
*/
@Deprecated
String commentUrl();
2009-06-19 16:49:26 +02:00
/**
2012-06-29 10:59:12 +02:00
* Sets the comment URL of this {@link Cookie}.
*
* @param commentUrl The comment URL to use
*
* @deprecated Not part of RFC6265
2009-06-19 16:49:26 +02:00
*/
@Deprecated
void setCommentUrl(String commentUrl);
2009-06-19 16:49:26 +02:00
/**
2012-06-29 10:59:12 +02:00
* Checks to see if this {@link Cookie} is to be discarded by the browser
* at the end of the current session.
*
* @return True if this {@link Cookie} is to be discarded, otherwise false
*
* @deprecated Not part of RFC6265
2009-06-19 16:49:26 +02:00
*/
@Deprecated
boolean isDiscard();
2009-06-19 16:49:26 +02:00
/**
2012-06-29 10:59:12 +02:00
* Sets the discard flag of this {@link Cookie}.
* If set to true, this {@link Cookie} will be discarded by the browser
* at the end of the current session
*
* @param discard True if the {@link Cookie} is to be discarded
*
* @deprecated Not part of RFC6265
2009-06-19 16:49:26 +02:00
*/
@Deprecated
void setDiscard(boolean discard);
2009-06-19 16:49:26 +02:00
/**
* @deprecated Use {@link #ports()} instead.
*/
@Deprecated
Set<Integer> getPorts();
2009-06-19 16:49:26 +02:00
/**
2012-06-29 10:59:12 +02:00
* Returns the ports that this {@link Cookie} can be accessed on.
*
* @return The {@link Set} of ports that this {@link Cookie} can use
*
* @deprecated Not part of RFC6265
2009-06-19 16:49:26 +02:00
*/
@Deprecated
Set<Integer> ports();
2009-06-19 16:49:26 +02:00
/**
2012-06-29 10:59:12 +02:00
* Sets the ports that this {@link Cookie} can be accessed on.
*
* @param ports The ports that this {@link Cookie} can be accessed on
*
* @deprecated Not part of RFC6265
2009-06-19 16:49:26 +02:00
*/
@Deprecated
void setPorts(int... ports);
2009-06-19 16:49:26 +02:00
/**
2012-06-29 10:59:12 +02:00
* Sets the ports that this {@link Cookie} can be accessed on.
*
* @param ports The {@link Iterable} collection of ports that this
* {@link Cookie} can be accessed on.
*
* @deprecated Not part of RFC6265
2009-06-19 16:49:26 +02:00
*/
@Deprecated
void setPorts(Iterable<Integer> ports);
2009-08-28 09:15:49 +02:00
}