Java Doc for SessionValidator.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.SessionValidator

All known Subclasses:   com.uwyn.rife.authentication.sessionvalidators.DatabaseSessionValidator,  com.uwyn.rife.authentication.sessionvalidators.AbstractSessionValidator,
SessionValidator
public interface SessionValidator (Code)
This interface defines the methods that classes with SessionValidator functionalities have to implement.

A SessionValidator is essentially a bridge between a CredentialsManager and a SessionManager . The validity of a session is often dependent on external attributes which define the context for a valid session that goes beyond a valid session id.

Typical uses can be:

  • a user can become blocked during an active session,
  • a user is a member of different groups (roles) and only has access to certain resources when being part of a particular group,
  • a user needs to provide information at the first valid log-in, without providing this information the user can't access any of the resources in the application.

All these scenarios require additional information and additional processing that are often specific to each implementation of a CredentialsManager .

Since any CredentialsManager can be combined with any SessionManager , performance would often not be optimal.

For example, if the credentials and the session information are stored in the same database. Completely isolating all fuctionalities would cause more database queries to be executed than what's really needed. By implementing the combined functionality of verifying a valid authentication session in a bridge class that implements the SessionValidator interface, only one query can be used to provide the same results. Thus, dramatically increasing performance.
author:
   Geert Bevin (gbevin[remove] at uwyn dot com)
version:
   $Revision: 3643 $
See Also:   com.uwyn.rife.authentication.sessionvalidators.AbstractSessionValidator
See Also:   com.uwyn.rife.authentication.SessionAttributes
See Also:   com.uwyn.rife.authentication.CredentialsManager
See Also:   com.uwyn.rife.authentication.SessionManager
since:
   1.0





Method Summary
public  CredentialsManagergetCredentialsManager()
     Retrieves the currently used CredentialsManager .
public  RememberManagergetRememberManager()
     Retrieves the currently used RememberManager .
public  SessionManagergetSessionManager()
     Retrieves the currently used SessionManager .
public  booleanisAccessAuthorized(int id)
     Indicates if the provided validity identifier is considered as valid and that the access to the secured resource is thus authorized.

Normally, specific business logic is only required for the situations in which access has prohibited.

public  voidsetCredentialsManager(CredentialsManager credentialsManager)
     Sets the CredentialsManager that will be used.
public  voidsetRememberManager(RememberManager rememberManager)
     Sets the RememberManager that will be used.
public  voidsetSessionManager(SessionManager sessionManager)
     Sets the SessionManager that will be used.
public  intvalidateSession(String authId, String hostIp, SessionAttributes attributes)
     Validates an existing session according to a set of attributes that define the context in which this validation occurs.

This method is typically executed for each access to a secured resource, performance is thus of critical importance.

The implementation of this method should be optimal for the combination of the used CredentialsManager and SessionManager .




Method Detail
getCredentialsManager
public CredentialsManager getCredentialsManager()(Code)
Retrieves the currently used CredentialsManager . The current CredentialsManager .
since:
   1.0



getRememberManager
public RememberManager getRememberManager()(Code)
Retrieves the currently used RememberManager . The current RememberManager .
since:
   1.0



getSessionManager
public SessionManager getSessionManager()(Code)
Retrieves the currently used SessionManager . The current SessionManager .
since:
   1.0



isAccessAuthorized
public boolean isAccessAuthorized(int id)(Code)
Indicates if the provided validity identifier is considered as valid and that the access to the secured resource is thus authorized.

Normally, specific business logic is only required for the situations in which access has prohibited. This method is used to make it possible to provide automatic access to the secured resource.
Parameters:
  id - The numeric identifier that is returned by the validateSession method. true if access to the secured resource wasauthorized; or

false if access was prohibited.
since:
   1.0




setCredentialsManager
public void setCredentialsManager(CredentialsManager credentialsManager)(Code)
Sets the CredentialsManager that will be used.
Parameters:
  credentialsManager - The new CredentialsManager .
since:
   1.0



setRememberManager
public void setRememberManager(RememberManager rememberManager)(Code)
Sets the RememberManager that will be used.
Parameters:
  rememberManager - The new RememberManager .
since:
   1.0



setSessionManager
public void setSessionManager(SessionManager sessionManager)(Code)
Sets the SessionManager that will be used.
Parameters:
  sessionManager - The new SessionManager .
since:
   1.0



validateSession
public int validateSession(String authId, String hostIp, SessionAttributes attributes) throws SessionValidatorException(Code)
Validates an existing session according to a set of attributes that define the context in which this validation occurs.

This method is typically executed for each access to a secured resource, performance is thus of critical importance.

The implementation of this method should be optimal for the combination of the used CredentialsManager and SessionManager . Specific code that combines the features of both managers should be written, instead of relying on the abstracted api of each manager. Paying attention to the implementation of this method can dramatically reduce the overhead of securing resources.
Parameters:
  authId - The unique id of the authentication session that needsto be validated.
Parameters:
  hostIp - The ip address of the host from which the user accessesthe application.
Parameters:
  attributes - Access to the attributes that define that contextin which the session has to be validated. A number that indicates the validation state of the session.This allows the application to go beyond valid orinvalid. Additional states like for example : blocked,initial login and disabled, can be used by usingdifferent numbers.
throws:
  SessionValidatorException - An undefined number of exceptionalcases or error situations can occur when a session is validated. They areall indicated by throwing an instance of SessionValidatorException . 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.