com.caucho.portal.generic
Class CacheKey

java.lang.Object
  extended by com.caucho.portal.generic.CacheKey

public class CacheKey
extends java.lang.Object

XXX: Cache implementation currently not complete. The ConnectionContext should start building a CacheKey as soon as it sees a window with expiration-cache != 0. It should do this in the action stage, because each window is seen in the action stage. It should add parameters for every child namespace encountered, to whatever depth. Then when it gets to the render stage, it can use the CacheKey to see if a cached value is available. If not, it inserts a CachingPortletWriteStream, and fills the cache.


Constructor Summary
CacheKey()
           
 
Method Summary
 void addParameter(java.lang.String name, java.lang.String[] values)
           
 boolean equals(java.lang.Object o)
           
 java.lang.String getContentType()
           
 java.util.Locale getLocale()
           
 java.lang.String getNamespace()
           
 PortletMode getPortletMode()
           
 java.lang.String getRequestedSessionId()
          Return a session id if isPrivate() is true, null if isPrivate() is false.
 WindowState getWindowState()
           
 int hashCode()
           
 boolean isPrivate()
           
 void reset()
          Reset to a state similar to that following construction.
 void setContentType(java.lang.String contentType)
           
 void setLocale(java.util.Locale locale)
          When a cache key is created to check for a cached response the locale is set to the value of request.getLocale().
 void setNamespace(java.lang.String namespace)
           
 void setPortletMode(PortletMode portletMode)
           
 void setPrivate(boolean isPrivate)
           
 void setRequestedSessionId(java.lang.String sessionId)
           
 void setWindowState(WindowState windowState)
           
 java.lang.String toString()
          Return a string that uniquely identifies this CacheKey.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CacheKey

public CacheKey()
Method Detail

setNamespace

public void setNamespace(java.lang.String namespace)

setPortletMode

public void setPortletMode(PortletMode portletMode)

setWindowState

public void setWindowState(WindowState windowState)

addParameter

public void addParameter(java.lang.String name,
                         java.lang.String[] values)

setContentType

public void setContentType(java.lang.String contentType)

setLocale

public void setLocale(java.util.Locale locale)
When a cache key is created to check for a cached response the locale is set to the value of request.getLocale(). A cache should first check the cache for an entry with the cacheKey as it is received, and then call cacheKey.setLocale(null) and try again. When a cache key is created to cache a response the locale is only set in the cache key if a portlet has called request.getLocale() or request.getLocales() or request.setLocale() method. It is set to the locale set by the portlet with response.setLocale(), or if the portlet does not call response.setLocale(), the value of request.getLocale().


setPrivate

public void setPrivate(boolean isPrivate)

setRequestedSessionId

public void setRequestedSessionId(java.lang.String sessionId)

isPrivate

public boolean isPrivate()

getNamespace

public java.lang.String getNamespace()

getPortletMode

public PortletMode getPortletMode()

getWindowState

public WindowState getWindowState()

getContentType

public java.lang.String getContentType()

getLocale

public java.util.Locale getLocale()

getRequestedSessionId

public java.lang.String getRequestedSessionId()
Return a session id if isPrivate() is true, null if isPrivate() is false.


reset

public void reset()
Reset to a state similar to that following construction.


hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

toString

public java.lang.String toString()
Return a string that uniquely identifies this CacheKey. The set of characters that form the string is "A-Z a-z 0-9 _". That means the returned string is suitable as a file name, for example.

Overrides:
toString in class java.lang.Object