| 
 | |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.jaffa.presentation.portlet.session.UserSession
This UserSession Object maintains all the state about the a specific user within the context of the Web Server. This object could be adapted to other context stores (apart from HttpSession) if needed.
| Field Summary | |
| static String | USER_ATTRIBUTEThe key used to add the UserSession object to a HTTP Session. | 
| Method Summary | |
|  void | addComponent(Component comp)Adds a component to the internal cache. | 
|  void | addImage(String key,
                 byte[] imageContents,
                 String mimeType)Adds the image and its mime-type to the UserSession. | 
|  void | dropSessionObject(String name)Drop a named attribute from the servlet session. | 
|  void | finalize()This ensures that a cleanup is performed at the time of garbage-collection. | 
|  void | garbageCollectIdleComponents(int timeOutMinutes)This will perform garbage collection of idle components. | 
|  Component | getComponent(String compId)Get a Component object based on a componentId from the list of created components that have been created by this user. | 
|  Collection | getComponents()Added for the administration tool to get data about the components | 
|  HttpSession | getHttpSession()Added for the administration tool to get data about the session | 
|  byte[] | getImageContents(String key)Returns the image for the input key. | 
|  String | getImageMimeType(String key)Returns the image mime-type for the input key. | 
|  String | getNextComponentId()Returns a new componentId. | 
|  String | getSessionId()Getter for property sessionId. | 
|  Object | getSessionObject(String name)Get a named attribute from the servlet session. | 
|  Object | getUserData()Returns an object that should contain user data useful to the consuming application. | 
|  String | getUserHostAddr()Get the host address of this user, this is based on the host obtained in the first request that was used to establish the session | 
|  String | getUserId()Getter for property userId. | 
| static UserSession | getUserSession(HttpServletRequest request)Get the UserSession object from the servlet session object. | 
|  String | getVariation()Getter for property variation. | 
|  WidgetCache | getWidgetCache(String key)Return an existing WidgetCache for the key. | 
| static boolean | isUserSession(HttpServletRequest request)Is there a user Session? | 
|  boolean | isValid()Check to see if the UserSession object is valid. | 
|  void | kill()This function kills the user session object. | 
|  void | killAllComponents()This function kills all related components. | 
|  void | removeComponent(Component comp)Remove the component from the internal cache. | 
|  void | removeImage(String key)Removes the image for the input key. | 
|  void | setSessionId(String sessionId)Setter for property sessionId. | 
|  void | setUserData(Object userData)This stores a user reslated object in the frameworks UserSession object. | 
|  void | setUserId(String userId)Setter for property userId. | 
|  void | setVariation(String variation)Setter for property variation. | 
|  void | showInfo()Display all internal Session Info in the System.out stream. | 
|  void | valueBound(HttpSessionBindingEvent httpSessionBindingEvent)This is invoked, whenever an instance of this class is added to the HttpSession object. | 
|  void | valueUnbound(HttpSessionBindingEvent httpSessionBindingEvent)This is invoked, whenever an instance of this class is removed from the HttpSession object. | 
| Methods inherited from class java.lang.Object | 
| clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Field Detail | 
public static final String USER_ATTRIBUTE
| Method Detail | 
public static boolean isUserSession(HttpServletRequest request)
request - The HTTP request we are processing.
public static UserSession getUserSession(HttpServletRequest request)
request - The HTTP request we are processing.
public String getSessionId()
public void setSessionId(String sessionId)
sessionId - New value of property sessionId.public String getUserId()
public void setUserId(String userId)
userId - New value of property userId.public boolean isValid()
public Object getUserData()
public void setUserData(Object userData)
userData - This is the application specific object that contains extra user information.public void addComponent(Component comp)
comp - the component to be added.public Component getComponent(String compId)
compId - the componentId.
public void removeComponent(Component comp)
comp - The component to be removed.public Object getSessionObject(String name)
name - The attribute name.
public void dropSessionObject(String name)
name - The attribute name.public void kill()
public void killAllComponents()
public String getNextComponentId()
public WidgetCache getWidgetCache(String key)
key - The key to be used for the widget cache.
public byte[] getImageContents(String key)
key - The key.
public String getImageMimeType(String key)
key - The key.
public void addImage(String key,
                     byte[] imageContents,
                     String mimeType)
key - The key to be used for storing the image.imageContents - The image.mimeType - The mime-type.public void removeImage(String key)
key - The key.
public void finalize()
              throws Throwable
Throwable - if any error occurs.public void showInfo()
public HttpSession getHttpSession()
public Collection getComponents()
public String getUserHostAddr()
public void garbageCollectIdleComponents(int timeOutMinutes)
timeOutMinutes - The minutes used to determine idle components.public void valueBound(HttpSessionBindingEvent httpSessionBindingEvent)
valueBound in interface HttpSessionBindingListenerhttpSessionBindingEvent - the event that identifies the session.public void valueUnbound(HttpSessionBindingEvent httpSessionBindingEvent)
valueUnbound in interface HttpSessionBindingListenerhttpSessionBindingEvent - the event that identifies the session.public String getVariation()
public void setVariation(String variation)
variation - New value of property variation.| 
 | |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||