Apache CXF API

org.apache.cxf.transport.http
Class Cookie

java.lang.Object
  extended by org.apache.cxf.transport.http.Cookie

public class Cookie
extends Object

Container for HTTP cookies used to track session state.


Field Summary
static String DISCARD_ATTRIBUTE
           
static String MAX_AGE_ATTRIBUTE
           
static String PATH_ATTRIBUTE
           
 
Constructor Summary
Cookie(String name, String value)
          Create a new cookie with the supplied name/value pair
 
Method Summary
 boolean equals(Object o)
           
 int getMaxAge()
          Get the max-age of this cookie
 String getName()
          Get the name of this cookie
 String getPath()
          Get the path of this cookie
 String getValue()
          Get the value of this cookie
 int hashCode()
           
 String requestCookieHeader()
          Convert a list of cookies into a string suitable for sending as a "Cookie:" header
 void setMaxAge(int maxAge)
          Set the max-age of this cookie.
 void setPath(String path)
          Set the path of this cookie
 void setValue(String value)
          Change the value of this cookie
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DISCARD_ATTRIBUTE

public static final String DISCARD_ATTRIBUTE
See Also:
Constant Field Values

MAX_AGE_ATTRIBUTE

public static final String MAX_AGE_ATTRIBUTE
See Also:
Constant Field Values

PATH_ATTRIBUTE

public static final String PATH_ATTRIBUTE
See Also:
Constant Field Values
Constructor Detail

Cookie

public Cookie(String name,
              String value)
Create a new cookie with the supplied name/value pair

Parameters:
name -
value -
Method Detail

getName

public String getName()
Get the name of this cookie

Returns:
cookie name

setValue

public void setValue(String value)
Change the value of this cookie

Parameters:
value -

getValue

public String getValue()
Get the value of this cookie

Returns:
cookie value

setPath

public void setPath(String path)
Set the path of this cookie

Parameters:
path -

getPath

public String getPath()
Get the path of this cookie

Returns:
cookie path

setMaxAge

public void setMaxAge(int maxAge)
Set the max-age of this cookie. If set to 0, it should be removed from the session.

Parameters:
maxAge -

getMaxAge

public int getMaxAge()
Get the max-age of this cookie

Returns:

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object o)
Overrides:
equals in class Object

requestCookieHeader

public String requestCookieHeader()
Convert a list of cookies into a string suitable for sending as a "Cookie:" header

Returns:
Cookie header text

Apache CXF API

Apache CXF