Java Doc for CmsSessionManager.java in  » Content-Management-System » opencms » org » opencms » main » 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 » Content Management System » opencms » org.opencms.main 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.opencms.main.CmsSessionManager

CmsSessionManager
public class CmsSessionManager (Code)
Keeps track of the sessions running on the OpenCms server and provides a session info storage which is used to get an overview about currently authenticated OpenCms users, as well as sending broadcasts between users.

For each authenticated OpenCms user, a org.opencms.main.CmsSessionInfo object holds the information about the users status.

When a user session is invalidated, the user info will be removed. This happens when a user log out, or when his session times out.

Please Note: The current implementation does not provide any permission checking, so all users can access the methods of this manager. Permission checking based on the current users OpenCms context may be added in a future OpenCms release.


author:
   Alexander Kandzior
version:
   $Revision: 1.17 $
since:
   6.0.0




Constructor Summary
protected  CmsSessionManager()
    

Method Summary
protected  voidaddSessionInfo(CmsSessionInfo sessionInfo)
    
public  BuffergetBroadcastQueue(String sessionId)
    
public  intgetSessionCountAuthenticated()
    
public  intgetSessionCountCurrent()
    
public  intgetSessionCountTotal()
    
public  CmsSessionInfogetSessionInfo(CmsUUID sessionId)
    
public  CmsSessionInfogetSessionInfo(HttpServletRequest req)
    
public  CmsSessionInfogetSessionInfo(HttpSession session)
    
public  CmsSessionInfogetSessionInfo(String sessionId)
    
public  ListgetSessionInfos()
    
public  ListgetSessionInfos(CmsUUID userId)
     Returns a list of all active session info objects for the specified user.

An OpenCms user can have many active sessions.

protected  CmsUUIDgetSessionUUID(String sessionId)
    
protected  voidinitialize(I_CmsSessionStorageProvider sessionStorageProvider)
    
public  voidsendBroadcast(CmsObject cms, String message)
    
public  voidsendBroadcast(CmsObject cms, String message, String sessionId)
    
public  voidsendBroadcast(CmsUser fromUser, String message, CmsUser toUser)
    
protected  voidsessionCreated(HttpSessionEvent event)
    
protected  voidsessionDestroyed(HttpSessionEvent event)
    
protected  voidshutdown()
    
public  voidswitchUser(CmsObject cms, HttpServletRequest req, CmsUser user)
     Switches the current user to the given user.
public  StringtoString()
    
protected  voidupdateSessionInfo(CmsObject cms, HttpServletRequest req)
     Updates the the OpenCms session data used for quick authentication of users.

This is required if the user data (current group or project) was changed in the requested document.

The user data is only updated if the user was authenticated to the system.

public  voidupdateSessionInfos(CmsObject cms)
    
protected  voidvalidateSessionInfos()
    


Constructor Detail
CmsSessionManager
protected CmsSessionManager()(Code)
Creates a new instance of the OpenCms session manager.





Method Detail
addSessionInfo
protected void addSessionInfo(CmsSessionInfo sessionInfo)(Code)
Adds a new session info into the session storage.


Parameters:
  sessionInfo - the session info to store for the id




getBroadcastQueue
public Buffer getBroadcastQueue(String sessionId)(Code)
Returns the broadcast queue for the given OpenCms session id.


Parameters:
  sessionId - the OpenCms session id to get the broadcast queue for the broadcast queue for the given OpenCms session id




getSessionCountAuthenticated
public int getSessionCountAuthenticated()(Code)
Returns the number of sessions currently authenticated in the OpenCms security system.

the number of sessions currently authenticated in the OpenCms security system




getSessionCountCurrent
public int getSessionCountCurrent()(Code)
Returns the number of current sessions, including the sessions of not authenticated guest users.

the number of current sessions, including the sessions of not authenticated guest users




getSessionCountTotal
public int getSessionCountTotal()(Code)
Returns the number of total sessions generated so far, including already destroyed sessions.

the number of total sessions generated so far, including already destroyed sessions




getSessionInfo
public CmsSessionInfo getSessionInfo(CmsUUID sessionId)(Code)
Returns the complete user session info of a user from the session storage, or null if this session id has no session info attached.


Parameters:
  sessionId - the OpenCms session id to return the session info for the complete user session info of a user from the session storage




getSessionInfo
public CmsSessionInfo getSessionInfo(HttpServletRequest req)(Code)
Returns the OpenCms user session info for the given request, or null if no user session is available.


Parameters:
  req - the current request the OpenCms user session info for the given request, or null if no user session is available




getSessionInfo
public CmsSessionInfo getSessionInfo(HttpSession session)(Code)
Returns the OpenCms user session info for the given http session, or null if no user session is available.


Parameters:
  session - the current http session the OpenCms user session info for the given http session, or null if no user session is available




getSessionInfo
public CmsSessionInfo getSessionInfo(String sessionId)(Code)
Returns the complete user session info of a user from the session storage, or null if this session id has no session info attached.


Parameters:
  sessionId - the OpenCms session id to return the session info for,this must be a String representation of a CmsUUID the complete user session info of a user from the session storage
See Also:   CmsSessionManager.getSessionInfo(CmsUUID)




getSessionInfos
public List getSessionInfos()(Code)
Returns all current session info objects.

all current session info objects




getSessionInfos
public List getSessionInfos(CmsUUID userId)(Code)
Returns a list of all active session info objects for the specified user.

An OpenCms user can have many active sessions. This is e.g. possible when two people have logged in to the system using the same username. Even one person can have multiple sessions if he is logged in to OpenCms with several browser windows at the same time.


Parameters:
  userId - the id of the user a list of all active session info objects for the specified user




getSessionUUID
protected CmsUUID getSessionUUID(String sessionId)(Code)
Returns the UUID representation for the given session id String.


Parameters:
  sessionId - the session id String to return the UUID representation for the UUID representation for the given session id String




initialize
protected void initialize(I_CmsSessionStorageProvider sessionStorageProvider)(Code)
Sets the storage provider.


Parameters:
  sessionStorageProvider - the storage provider implementation




sendBroadcast
public void sendBroadcast(CmsObject cms, String message)(Code)
Sends a broadcast to all sessions of all currently authenticated users.


Parameters:
  cms - the OpenCms user context of the user sending the broadcast
Parameters:
  message - the message to broadcast




sendBroadcast
public void sendBroadcast(CmsObject cms, String message, String sessionId)(Code)
Sends a broadcast to the specified user session.


Parameters:
  cms - the OpenCms user context of the user sending the broadcast
Parameters:
  message - the message to broadcast
Parameters:
  sessionId - the OpenCms session uuid target (receiver) of the broadcast




sendBroadcast
public void sendBroadcast(CmsUser fromUser, String message, CmsUser toUser)(Code)
Sends a broadcast to all sessions of a given user.

The user sending the message may be a real user like cms.getRequestContext().currentUser() or null for a system message.


Parameters:
  fromUser - the user sending the broadcast
Parameters:
  message - the message to broadcast
Parameters:
  toUser - the target (receiver) of the broadcast




sessionCreated
protected void sessionCreated(HttpSessionEvent event)(Code)
Called by the OpenCmsListener when a http session is created.


Parameters:
  event - the http session event
See Also:   javax.servlet.http.HttpSessionListener.sessionCreated(javax.servlet.http.HttpSessionEvent)
See Also:   OpenCmsListener.sessionCreated(HttpSessionEvent)




sessionDestroyed
protected void sessionDestroyed(HttpSessionEvent event)(Code)
Called by the OpenCmsListener when a http session is destroyed.


Parameters:
  event - the http session event
See Also:   javax.servlet.http.HttpSessionListener.sessionDestroyed(javax.servlet.http.HttpSessionEvent)
See Also:   OpenCmsListener.sessionDestroyed(HttpSessionEvent)




shutdown
protected void shutdown() throws Exception(Code)
Removes all stored session info objects.


throws:
  Exception - if something goes wrong




switchUser
public void switchUser(CmsObject cms, HttpServletRequest req, CmsUser user) throws CmsException(Code)
Switches the current user to the given user. The session info is rebuild as if the given user performs a login at the workplace.
Parameters:
  cms - the current CmsObject
Parameters:
  req - the current request
Parameters:
  user - the user to switch to
throws:
  CmsException - if something goes wrong



toString
public String toString()(Code)

See Also:   java.lang.Object.toString



updateSessionInfo
protected void updateSessionInfo(CmsObject cms, HttpServletRequest req)(Code)
Updates the the OpenCms session data used for quick authentication of users.

This is required if the user data (current group or project) was changed in the requested document.

The user data is only updated if the user was authenticated to the system.
Parameters:
  cms - the current OpenCms user context
Parameters:
  req - the current request




updateSessionInfos
public void updateSessionInfos(CmsObject cms)(Code)
Updates all session info objects, so that invalid projects are replaced by the Online project.


Parameters:
  cms - the cms context




validateSessionInfos
protected void validateSessionInfos()(Code)
Validates the sessions stored in this manager and removes any sessions that have become invalidated.




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.