Java Doc for SessionManager.java in  » Web-Framework » rife-1.6.1 » com » uwyn » rife » authentication » 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 » Web Framework » rife 1.6.1 » com.uwyn.rife.authentication 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


com.uwyn.rife.authentication.SessionManager

All known Subclasses:   com.uwyn.rife.authentication.sessionmanagers.PurgingSessionManager,  com.uwyn.rife.authentication.sessionmanagers.DatabaseSessions,  com.uwyn.rife.authentication.sessionmanagers.CustomSessionManager,  com.uwyn.rife.authentication.sessionmanagers.MemorySessions,
SessionManager
public interface SessionManager (Code)
This interface defines the methods that classes with SessionManager functionalities have to implement.

A SessionManager is reponsible for handling all tasks related to the lifetime of a session in which a user is successfully authenticated.

This kind of session doesn't provide any state persistance across requests and doesn't store any additional business data on the server-side. It merely provides a unique authentication id which can be used to identify a successfully authenticated user.

For safety's sake, sessions time out after a certain period of inactivity and their validity is bound only to a unique user id and a host ip. No assumptions are being made about the actual meaning or structure of a 'user'. A unique numeric identifier is all that's required.
author:
   Geert Bevin (gbevin[remove] at uwyn dot com)
version:
   $Revision: 3643 $
See Also:   com.uwyn.rife.authentication.SessionValidator
since:
   1.0





Method Summary
public  booleancontinueSession(String authId)
     Continues an already active session.
public  longcountSessions()
     Counts the number of active sessions. The number of active sessions.
exception:
  SessionManagerException - An undefined number of exceptionalcases or error situations can occur when a session is counted.
public  voideraseAllSessions()
     Removes all available sessions.
public  booleaneraseSession(String authId)
     Removes all traces of an authentication session.
public  booleaneraseUserSessions(long userId)
     Removes all traces of all authentication sessions for a particular user.
public  booleangetRestrictHostIp()
     Obtains the restriction policy of the authentication ID with regards to the user's host IP.
public  longgetSessionDuration()
     Obtains the maximum time that a user can stay inactive before an active session becomes invalid.
public  longgetSessionUserId(String authId)
     Retrieves the id of a user that has access to a particular session.
Parameters:
  authId - The unique id of the authentication session for which theuser needs to be looked up.
public  booleanisSessionValid(String authId, String hostIp)
     Verifies if a session is valid and still active.
Parameters:
  authId - The unique id of the authentication session that needs tobe verified.
Parameters:
  hostIp - The ip address of the host from which the user accessesthe application.
public  booleanlistSessions(ListSessions processor)
     Lists the active sessions.
Parameters:
  processor - The row processor that will be used to list the activesessions.
public  voidpurgeSessions()
     Removes all sessions that are inactive.
public  voidsetRestrictHostIp(boolean flag)
     Sets the restriction policy of the authentication ID with regards to the user's host IP.
public  voidsetSessionDuration(long milliseconds)
     Sets the maximum time that a user can stay inactive before an active session becomes invalid.
public  StringstartSession(long userId, String hostIp, boolean remembered)
     Starts a new session.
Parameters:
  userId - The id that uniquely identifies the user that is allowedto use this session.
Parameters:
  hostIp - The ip address of the host from which the user accessesthe application.
Parameters:
  remembered - Indicates whether the session is started throughremember me or from scratch.
public  booleanwasRemembered(String authId)
     Checks if a session was previously automatically created from remembered data.
Parameters:
  authId - The unique id of the authentication session that needs tobe erased.



Method Detail
continueSession
public boolean continueSession(String authId) throws SessionManagerException(Code)
Continues an already active session. This means that the inactivity time-out is reset to the maximal value. This is typically called each time a user accesses an application.
Parameters:
  authId - The unique id of the authentication session that needs tobe continued. true if the session was successfully continued; or

false if this was not possible (ie. the sessioncouldn't be found).
exception:
  SessionManagerException - An undefined number of exceptionalcases or error situations can occur when a session is continued. Theyare all indicated by throwing an instance of SessionManagerException . It's up to the implementations ofthis interface to give more specific meanings to these exceptions.
since:
   1.0




countSessions
public long countSessions() throws SessionManagerException(Code)
Counts the number of active sessions. The number of active sessions.
exception:
  SessionManagerException - An undefined number of exceptionalcases or error situations can occur when a session is counted. They areall indicated by throwing an instance of SessionManagerException . It's up to the implementations ofthis interface to give more specific meanings to these exceptions.
since:
   1.0



eraseAllSessions
public void eraseAllSessions() throws SessionManagerException(Code)
Removes all available sessions. This makes all sessions instantly invalid and inactive for all users.
exception:
  SessionManagerException - An undefined number of exceptionalcases or error situations can occur when a session is erased. They areall indicated by throwing an instance of SessionManagerException . It's up to the implementations ofthis interface to give more specific meanings to these exceptions.
since:
   1.0



eraseSession
public boolean eraseSession(String authId) throws SessionManagerException(Code)
Removes all traces of an authentication session. This makes the session instantly inactive and invalid.
Parameters:
  authId - The unique id of the authentication session that needs tobe erased. true if the session was successfully erased; or

false if this was not possible (ie. the sessioncouldn't be found).
exception:
  SessionManagerException - An undefined number of exceptionalcases or error situations can occur when a session is erased. They areall indicated by throwing an instance of SessionManagerException . It's up to the implementations ofthis interface to give more specific meanings to these exceptions.
since:
   1.0




eraseUserSessions
public boolean eraseUserSessions(long userId) throws SessionManagerException(Code)
Removes all traces of all authentication sessions for a particular user. This makes all sessions of this user instantly inactive and invalid.
Parameters:
  userId - The id that uniquely identifies the user whose sessionsare to be erased. true if the sessions were successfully erased; or

false if this was not possible (ie. no sessionscouldn't be found).
exception:
  SessionManagerException - An undefined number of exceptionalcases or error situations can occur when a session is erased. They areall indicated by throwing an instance of SessionManagerException . It's up to the implementations ofthis interface to give more specific meanings to these exceptions.
since:
   1.0




getRestrictHostIp
public boolean getRestrictHostIp()(Code)
Obtains the restriction policy of the authentication ID with regards to the user's host IP.

The default is false , or no restriction. true if the authentication is restricted to one host IP; or

false if the authentication ID can be used with any host IP
since:
   1.0




getSessionDuration
public long getSessionDuration()(Code)
Obtains the maximum time that a user can stay inactive before an active session becomes invalid. The maximum time of inactivity in milliseconds.
since:
   1.0



getSessionUserId
public long getSessionUserId(String authId) throws SessionManagerException(Code)
Retrieves the id of a user that has access to a particular session.
Parameters:
  authId - The unique id of the authentication session for which theuser needs to be looked up. A long >= 0 that corresponds to the user idthat has access to the session; or

-1 if the session couldn't be found.
exception:
  SessionManagerException - An undefined number of exceptionalcases or error situations can occur when user id of a session isretrieved. They are all indicated by throwing an instance of SessionManagerException . It's up to the implementations ofthis interface to give more specific meanings to these exceptions.
since:
   1.0




isSessionValid
public boolean isSessionValid(String authId, String hostIp) throws SessionManagerException(Code)
Verifies if a session is valid and still active.
Parameters:
  authId - The unique id of the authentication session that needs tobe verified.
Parameters:
  hostIp - The ip address of the host from which the user accessesthe application. true if a valid active session was found; or

false if this was not possible.
exception:
  SessionManagerException - An undefined number of exceptionalcases or error situations can occur when a session is verified. Theyare all indicated by throwing an instance of SessionManagerException . It's up to the implementations ofthis interface to give more specific meanings to these exceptions.
since:
   1.0




listSessions
public boolean listSessions(ListSessions processor) throws SessionManagerException(Code)
Lists the active sessions.
Parameters:
  processor - The row processor that will be used to list the activesessions. true if active sessions were found; or

false if no session was active.
exception:
  SessionManagerException - An undefined number of exceptionalcases or error situations can occur when session are listed. They areall indicated by throwing an instance of SessionManagerException . It's up to the implementations ofthis interface to give more specific meanings to these exceptions.
since:
   1.0




purgeSessions
public void purgeSessions() throws SessionManagerException(Code)
Removes all sessions that are inactive. This means that all sessions where the inactivity time has been exceeded, will be removed.
exception:
  SessionManagerException - An undefined number of exceptionalcases or error situations can occur when a session is purged. They areall indicated by throwing an instance of SessionManagerException . It's up to the implementations ofthis interface to give more specific meanings to these exceptions.
since:
   1.0



setRestrictHostIp
public void setRestrictHostIp(boolean flag)(Code)
Sets the restriction policy of the authentication ID with regards to the user's host IP.

The default is false , or no restriction.
Parameters:
  flag - true to activate the host IP restriction; or

false otherwise
since:
   1.0




setSessionDuration
public void setSessionDuration(long milliseconds)(Code)
Sets the maximum time that a user can stay inactive before an active session becomes invalid.
Parameters:
  milliseconds - The maximum time of inactivity in milliseconds.
since:
   1.0



startSession
public String startSession(long userId, String hostIp, boolean remembered) throws SessionManagerException(Code)
Starts a new session.
Parameters:
  userId - The id that uniquely identifies the user that is allowedto use this session.
Parameters:
  hostIp - The ip address of the host from which the user accessesthe application.
Parameters:
  remembered - Indicates whether the session is started throughremember me or from scratch. A String that uniquely identifies theauthentication session that was just started.
exception:
  SessionManagerException - An undefined number of exceptionalcases or error situations can occur when a session is started. They areall indicated by throwing an instance of SessionManagerException . It's up to the implementations ofthis interface to give more specific meanings to these exceptions.
since:
   1.0



wasRemembered
public boolean wasRemembered(String authId) throws SessionManagerException(Code)
Checks if a session was previously automatically created from remembered data.
Parameters:
  authId - The unique id of the authentication session that needs tobe erased. true if the session was created automatically fromremembered data; or

false if it was created from full credentials or if thesession couldn't be found.
exception:
  SessionManagerException - An undefined number of exceptionalcases or error situations can occur when a session is erased. They areall indicated by throwing an instance of SessionManagerException . It's up to the implementations ofthis interface to give more specific meanings to these exceptions.
since:
   1.0




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