com.caucho.portal.generic
Class SessionPreferencesStore

java.lang.Object
  extended by com.caucho.portal.generic.SessionPreferencesStore
All Implemented Interfaces:
PreferencesStore

public class SessionPreferencesStore
extends java.lang.Object
implements PreferencesStore

SessionPreferencesFactory creates or returns an existing store that is in the users's session. Each namespace is assigned an attribute name to use in the session, the attribute value is an instance of SessionPreferences.


Constructor Summary
SessionPreferencesStore()
           
 
Method Summary
 void finish(java.util.Map<java.lang.String,java.lang.String[]> preferences)
          Called when a Map previously returned by getPreferencesMap() is no longer needed.
 java.util.Map<java.lang.String,java.lang.String[]> getPreferencesMap(PortletRequest request, java.lang.String namespace)
          Return a map of preferences.
 void setAlwaysCreateSession(boolean alwaysCreateSession)
          If true then a session is always created for the user if there is not one already, default is true.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SessionPreferencesStore

public SessionPreferencesStore()
Method Detail

setAlwaysCreateSession

public void setAlwaysCreateSession(boolean alwaysCreateSession)
If true then a session is always created for the user if there is not one already, default is true.


getPreferencesMap

public java.util.Map<java.lang.String,java.lang.String[]> getPreferencesMap(PortletRequest request,
                                                                            java.lang.String namespace)
Description copied from interface: PreferencesStore
Return a map of preferences. Implementing classes use the information available from request to determine the identity of the user.

Specified by:
getPreferencesMap in interface PreferencesStore
Returns:
a Map of preference names to values, or null if no preferences are available.

finish

public void finish(java.util.Map<java.lang.String,java.lang.String[]> preferences)
Description copied from interface: PreferencesStore
Called when a Map previously returned by getPreferencesMap() is no longer needed. A call to finish() is not guaranteed to occur for every Map returned by getPreferencesMap(). If an error occurs when processing a request, the portal may not have an opportunity to call finish().

Specified by:
finish in interface PreferencesStore