wt.templateutil.processor
Class ServletSessionCookieManager

java.lang.Object
  extended bywt.templateutil.processor.ServletSessionCookieManager

public class ServletSessionCookieManager
extends Object


Nested Class Summary
(package private) static class ServletSessionCookieManager.MostRecentlyUsedCookieIds
           
 
Field Summary
static String BASE
           
private  HashMap cookieMap
           
private static int DEFAULT_MAX_CACHED_COOKIES
           
private  ServletSessionCookie globalCookie
           
private  String hostName
           
private static String MAX_CACHED_COOKIES_PREFIX
           
private static String MRU_COOKIE_IDS_KEY
           
private  String sessionId
           
 
Constructor Summary
ServletSessionCookieManager(HTTPRequest request)
           
ServletSessionCookieManager(String host, String sid)
           
 
Method Summary
 ServletSessionCookie getCookie(String id)
           
 ServletSessionCookie getCookie(String id, String cookieType)
          If using this method to specify a cookie type, then you should also call saveCookies() after you are finished with your work (even if you don't change any data in the cookie) so that the most recently used list of cookies is also saved.
private  ServletSessionCookieManager.MostRecentlyUsedCookieIds getMostRecentlyUsedCookieMap(String cookieType)
           
private  void markDirtyMostRecentlyUsedCookieMap(String cookieType)
           
 ServletSessionCookie newCookie(String id)
           
private  ServletSessionCookie newCookie(String id, boolean isGlobalCookie)
           
private  ServletSessionCookie newCookie(String id, boolean isGlobalCookie, String cookieType)
           
 void printSessionCache()
           
 void removeCookie(String id)
           
protected  void removedCookie(ServletSessionCookie cookie)
          This method should be called whenever a cookie is removed.
 void saveCookie(ServletSessionCookie cookie)
           
 void saveCookies()
           
protected  void touchedCookie(ServletSessionCookie cookie)
          This method should be called whenever a cookie is created or accessed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BASE

public static final String BASE
See Also:
Constant Field Values

MRU_COOKIE_IDS_KEY

private static final String MRU_COOKIE_IDS_KEY
See Also:
Constant Field Values

MAX_CACHED_COOKIES_PREFIX

private static final String MAX_CACHED_COOKIES_PREFIX
See Also:
Constant Field Values

DEFAULT_MAX_CACHED_COOKIES

private static final int DEFAULT_MAX_CACHED_COOKIES
See Also:
Constant Field Values

hostName

private String hostName

sessionId

private String sessionId

cookieMap

private HashMap cookieMap

globalCookie

private ServletSessionCookie globalCookie
Constructor Detail

ServletSessionCookieManager

public ServletSessionCookieManager(HTTPRequest request)

ServletSessionCookieManager

public ServletSessionCookieManager(String host,
                                   String sid)
Method Detail

getMostRecentlyUsedCookieMap

private ServletSessionCookieManager.MostRecentlyUsedCookieIds getMostRecentlyUsedCookieMap(String cookieType)

markDirtyMostRecentlyUsedCookieMap

private void markDirtyMostRecentlyUsedCookieMap(String cookieType)

touchedCookie

protected void touchedCookie(ServletSessionCookie cookie)
This method should be called whenever a cookie is created or accessed. This method will update the most-recently-used cookie cache to indicate that the specified cookie has just been accessed.


removedCookie

protected void removedCookie(ServletSessionCookie cookie)
This method should be called whenever a cookie is removed. This method will update the most-recently-used cookie cache to indicate that the specified cookie is no longer being used.


getCookie

public ServletSessionCookie getCookie(String id,
                                      String cookieType)
If using this method to specify a cookie type, then you should also call saveCookies() after you are finished with your work (even if you don't change any data in the cookie) so that the most recently used list of cookies is also saved.


getCookie

public ServletSessionCookie getCookie(String id)

newCookie

public ServletSessionCookie newCookie(String id)

newCookie

private ServletSessionCookie newCookie(String id,
                                       boolean isGlobalCookie)

newCookie

private ServletSessionCookie newCookie(String id,
                                       boolean isGlobalCookie,
                                       String cookieType)

removeCookie

public void removeCookie(String id)

saveCookie

public void saveCookie(ServletSessionCookie cookie)

saveCookies

public void saveCookies()

printSessionCache

public void printSessionCache()