org.apache.tomcat.util.http

Class ServerCookie

Implemented Interfaces:
Serializable

public class ServerCookie
extends java.lang.Object
implements Serializable

Server-side cookie representation. Allows recycling and uses MessageBytes as low-level representation ( and thus the byte-> char conversion can be delayed until we know the charset ). Tomcat.core uses this recyclable object to represent cookies, and the facade will convert it to the external representation.

Constructor Summary

ServerCookie()

Method Summary

static void
appendCookieValue(StringBuffer buf, int version, String name, String value, String path, String domain, String comment, int maxAge, boolean isSecure)
static boolean
checkName(String name)
MessageBytes
getComment()
String
getCookieHeaderName()
Return the header name to set the cookie, based on cookie version
static String
getCookieHeaderName(int version)
Return the header name to set the cookie, based on cookie version
MessageBytes
getDomain()
int
getMaxAge()
MessageBytes
getName()
MessageBytes
getPath()
boolean
getSecure()
MessageBytes
getValue()
int
getVersion()
static boolean
isToken(String value)
static void
log(String s)
static void
maybeQuote(int version, StringBuffer buf, String value)
void
recycle()
void
setMaxAge(int expiry)
void
setSecure(boolean flag)
void
setVersion(int v)
String
toString()

Constructor Details

ServerCookie

public ServerCookie()

Method Details

appendCookieValue

public static void appendCookieValue(StringBuffer buf,
                                     int version,
                                     String name,
                                     String value,
                                     String path,
                                     String domain,
                                     String comment,
                                     int maxAge,
                                     boolean isSecure)


checkName

public static boolean checkName(String name)


getComment

public MessageBytes getComment()


getCookieHeaderName

public String getCookieHeaderName()
Return the header name to set the cookie, based on cookie version


getCookieHeaderName

public static String getCookieHeaderName(int version)
Return the header name to set the cookie, based on cookie version


getDomain

public MessageBytes getDomain()


getMaxAge

public int getMaxAge()


getName

public MessageBytes getName()


getPath

public MessageBytes getPath()


getSecure

public boolean getSecure()


getValue

public MessageBytes getValue()


getVersion

public int getVersion()


isToken

public static boolean isToken(String value)


log

public static void log(String s)


maybeQuote

public static void maybeQuote(int version,
                              StringBuffer buf,
                              String value)


recycle

public void recycle()


setMaxAge

public void setMaxAge(int expiry)


setSecure

public void setSecure(boolean flag)


setVersion

public void setVersion(int v)


toString

public String toString()


Copyright B) 2000-2003 Apache Software Foundation. All Rights Reserved.