|
NextApp Echo App Container 1.0.5 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object nextapp.echoservlet.CookieManager
A utility class used to cookies set by an application on the client browser.
Applications may obtain access to this object by retrieving their
ServerContext
from their EchoInstance
and calling
ServerContext.getCookieManager()
.
Field Summary | |
private javax.servlet.http.Cookie[] |
clientCookies
Contains the cookies that were most recently sent in by the client's most recent HTTP request. |
private java.util.Map |
localCookieMap
Contains the Echo applications "working copy" of the cookies. |
private java.util.Set |
updatedCookies
A set of cookies that have changed. |
Constructor Summary | |
CookieManager()
|
Method Summary | |
void |
add(javax.servlet.http.Cookie cookie)
Adds a new cookie or updates an existing one. |
private void |
clearLocalCookieMap()
Clears the locally held information about cookies. |
javax.servlet.http.Cookie |
get(java.lang.String name)
Returns a cookie with the given name if it is exists or null if it does not. |
private java.util.Map |
getLocalCookieMap()
Creates a new local cookie set, copying the client cookies array into it. |
java.util.Iterator |
iterator()
Returns an iterator over all present cookies. |
void |
remove(java.lang.String name)
Removes the specified cookie. |
(package private) void |
retrieveCookies(javax.servlet.http.HttpServletRequest request)
Retrieves cookies from a client HTTP request and stores them in the CookieManager. |
int |
size()
Returns the number of cookies present. |
(package private) void |
storeCookies(javax.servlet.http.HttpServletResponse response)
Stores cookies on the client by adding them to the HTTP response. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private transient javax.servlet.http.Cookie[] clientCookies
private java.util.Map localCookieMap
private java.util.Set updatedCookies
Constructor Detail |
public CookieManager()
Method Detail |
public void add(javax.servlet.http.Cookie cookie)
cookie
- The cookie to add or update.private void clearLocalCookieMap()
public javax.servlet.http.Cookie get(java.lang.String name)
name
- The name of the cookie to return.
name
.private java.util.Map getLocalCookieMap()
public java.util.Iterator iterator()
public void remove(java.lang.String name)
name
- The name of the cookie to remove.void retrieveCookies(javax.servlet.http.HttpServletRequest request)
request
- An HttpServletRequest
from which to
extract cookies.public int size()
void storeCookies(javax.servlet.http.HttpServletResponse response)
response
- An HttpServletResponse to feed the cookies to.
|
NextApp Echo App Container 1.0.5 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |