Java Doc for UserSession.java in  » J2EE » Jaffa » org » jaffa » presentation » portlet » session » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » J2EE » Jaffa » org.jaffa.presentation.portlet.session 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.jaffa.presentation.portlet.session.UserSession

UserSession
public class UserSession implements HttpSessionBindingListener(Code)
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
final public static  StringUSER_ATTRIBUTE
     The key used to add the UserSession object to a HTTP Session.


Method Summary
public  voidaddComponent(Component comp)
     Adds a component to the internal cache.
public  voidaddImage(String key, byte[] imageContents, String mimeType)
     Adds the image and its mime-type to the UserSession.
public  voiddropSessionObject(String name)
     Drop a named attribute from the servlet session.
public  voidfinalize()
     This ensures that a cleanup is performed at the time of garbage-collection.
public  voidgarbageCollectIdleComponents(int timeOutMinutes)
     This will perform garbage collection of idle components.
public  ComponentgetComponent(String compId)
     Get a Component object based on a componentId from the list of created components that have been created by this user.
Parameters:
  compId - the componentId.
public  CollectiongetComponents()
    
public  HttpSessiongetHttpSession()
    
public  byte[]getImageContents(String key)
     Returns the image for the input key. The ImageModel may store the image contents into the UserSession (instead of the local filesystem). The getImage.jsp will then use this method to display the image.
Parameters:
  key - The key.
public  StringgetImageMimeType(String key)
     Returns the image mime-type for the input key. The ImageModel may store the image contents into the UserSession (instead of the local filesystem). The getImage.jsp will then use this method to display the image.
Parameters:
  key - The key.
public  StringgetNextComponentId()
     Returns a new componentId.
public  StringgetSessionId()
     Getter for property sessionId.
public  ObjectgetSessionObject(String name)
     Get a named attribute from the servlet session.
Parameters:
  name - The attribute name.
public  ObjectgetUserData()
     Returns an object that should contain user data useful to the consuming application.
public  StringgetUserHostAddr()
    
public  StringgetUserId()
     Getter for property userId.
public static  UserSessiongetUserSession(HttpServletRequest request)
     Get the UserSession object from the servlet session object.
public  StringgetVariation()
     Getter for property variation.
public  WidgetCachegetWidgetCache(String key)
     Return an existing WidgetCache for the key. Create a new WidgetCache if it doesnt already exist. The key will preferrably be a componentId.
Parameters:
  key - The key to be used for the widget cache.
public static  booleanisUserSession(HttpServletRequest request)
     Is there a user Session? Returns true if there is a user session.
Parameters:
  request - The HTTP request we are processing.
public  booleanisValid()
     Check to see if the UserSession object is valid.
public  voidkill()
     This function kills the user session object.
public  voidkillAllComponents()
     This function kills all related components.
public  voidremoveComponent(Component comp)
     Remove the component from the internal cache.
public  voidremoveImage(String key)
     Removes the image for the input key.
public  voidsetSessionId(String sessionId)
     Setter for property sessionId.
public  voidsetUserData(Object userData)
     This stores a user reslated object in the frameworks UserSession object.
public  voidsetUserId(String userId)
     Setter for property userId.
public  voidsetVariation(String variation)
     Setter for property variation.
public  voidshowInfo()
     Display all internal Session Info in the System.out stream.
public  voidvalueBound(HttpSessionBindingEvent httpSessionBindingEvent)
     This is invoked, whenever an instance of this class is added to the HttpSession object.
public  voidvalueUnbound(HttpSessionBindingEvent httpSessionBindingEvent)
     This is invoked, whenever an instance of this class is removed from the HttpSession object.

Field Detail
USER_ATTRIBUTE
final public static String USER_ATTRIBUTE(Code)
The key used to add the UserSession object to a HTTP Session.





Method Detail
addComponent
public void addComponent(Component comp)(Code)
Adds a component to the internal cache.
Parameters:
  comp - the component to be added.



addImage
public void addImage(String key, byte[] imageContents, String mimeType)(Code)
Adds the image and its mime-type to the UserSession. The ImageModel may store the image contents into the UserSession (instead of the local filesystem). The getImage.jsp will then use this method to display the image.
Parameters:
  key - The key to be used for storing the image.
Parameters:
  imageContents - The image.
Parameters:
  mimeType - The mime-type.



dropSessionObject
public void dropSessionObject(String name)(Code)
Drop a named attribute from the servlet session.
Parameters:
  name - The attribute name.



finalize
public void finalize() throws Throwable(Code)
This ensures that a cleanup is performed at the time of garbage-collection.
throws:
  Throwable - if any error occurs.



garbageCollectIdleComponents
public void garbageCollectIdleComponents(int timeOutMinutes)(Code)
This will perform garbage collection of idle components. Idle components are those components which have had no activity performed in the last 'timeOutMinutes' minutes.
Parameters:
  timeOutMinutes - The minutes used to determine idle components.



getComponent
public Component getComponent(String compId)(Code)
Get a Component object based on a componentId from the list of created components that have been created by this user.
Parameters:
  compId - the componentId. the Component object based on the componentId.



getComponents
public Collection getComponents()(Code)
Added for the administration tool to get data about the components The list of components for the user.



getHttpSession
public HttpSession getHttpSession()(Code)
Added for the administration tool to get data about the session The HttpSession to which this object belongs.



getImageContents
public byte[] getImageContents(String key)(Code)
Returns the image for the input key. The ImageModel may store the image contents into the UserSession (instead of the local filesystem). The getImage.jsp will then use this method to display the image.
Parameters:
  key - The key. the image for the input key.



getImageMimeType
public String getImageMimeType(String key)(Code)
Returns the image mime-type for the input key. The ImageModel may store the image contents into the UserSession (instead of the local filesystem). The getImage.jsp will then use this method to display the image.
Parameters:
  key - The key. the image mime-type for the input key.



getNextComponentId
public String getNextComponentId()(Code)
Returns a new componentId. a new componentId.



getSessionId
public String getSessionId()(Code)
Getter for property sessionId. Value of property sessionId.



getSessionObject
public Object getSessionObject(String name)(Code)
Get a named attribute from the servlet session.
Parameters:
  name - The attribute name. The named object from HttpSession associated to the UserSession. Returns null if named obejct is not found.



getUserData
public Object getUserData()(Code)
Returns an object that should contain user data useful to the consuming application. an object that should contain user data useful to the consuming application.



getUserHostAddr
public String getUserHostAddr()(Code)
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 host address of this user.



getUserId
public String getUserId()(Code)
Getter for property userId. Value of property userId.



getUserSession
public static UserSession getUserSession(HttpServletRequest request)(Code)
Get the UserSession object from the servlet session object. If this is the first time this routine is called, a new Session Object will be created and returned. This new object will be added to the session cache, so the next time this is called the same UserSession object will be returned.
Parameters:
  request - The HTTP request we are processing. This returns either a new, or a current UserSession object.



getVariation
public String getVariation()(Code)
Getter for property variation. Value of property variation.



getWidgetCache
public WidgetCache getWidgetCache(String key)(Code)
Return an existing WidgetCache for the key. Create a new WidgetCache if it doesnt already exist. The key will preferrably be a componentId.
Parameters:
  key - The key to be used for the widget cache. a WidgetCache for the key.



isUserSession
public static boolean isUserSession(HttpServletRequest request)(Code)
Is there a user Session? Returns true if there is a user session.
Parameters:
  request - The HTTP request we are processing. true if there is a user session.



isValid
public boolean isValid()(Code)
Check to see if the UserSession object is valid. A UserSession is valid if the userId is not null. true if the userId is not null.



kill
public void kill()(Code)
This function kills the user session object. It remove itself from the HttpSession cache. It will kill all related components. It will de-register from the Session Manager. It will null out all internal references.



killAllComponents
public void killAllComponents()(Code)
This function kills all related components.



removeComponent
public void removeComponent(Component comp)(Code)
Remove the component from the internal cache.
Parameters:
  comp - The component to be removed.



removeImage
public void removeImage(String key)(Code)
Removes the image for the input key.
Parameters:
  key - The key.



setSessionId
public void setSessionId(String sessionId)(Code)
Setter for property sessionId.
Parameters:
  sessionId - New value of property sessionId.



setUserData
public void setUserData(Object userData)(Code)
This stores a user reslated object in the frameworks UserSession object.
Parameters:
  userData - This is the application specific object that contains extra user information.



setUserId
public void setUserId(String userId)(Code)
Setter for property userId.
Parameters:
  userId - New value of property userId.



setVariation
public void setVariation(String variation)(Code)
Setter for property variation.
Parameters:
  variation - New value of property variation.



showInfo
public void showInfo()(Code)
Display all internal Session Info in the System.out stream.



valueBound
public void valueBound(HttpSessionBindingEvent httpSessionBindingEvent)(Code)
This is invoked, whenever an instance of this class is added to the HttpSession object. Currently, this method will do nothing.
Parameters:
  httpSessionBindingEvent - the event that identifies the session.



valueUnbound
public void valueUnbound(HttpSessionBindingEvent httpSessionBindingEvent)(Code)
This is invoked, whenever an instance of this class is removed from the HttpSession object. This can happen by an explicit session.removeAttribute(), or if the HttpSession is invalidated or if the HttpSession times out. It will kill all related components. It will de-register from the Session Manager. It will null out all internal references.
Parameters:
  httpSessionBindingEvent - the event that identifies the session.



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.