Source Code Cross Referenced for SessionValidatorRetriever.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 Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright 2001-2007 Geert Bevin <gbevin[remove] at uwyn dot com> and
003:         * JR Boyens <gnu-jrb[remove] at gmx dot net>
004:         * Distributed under the terms of either:
005:         * - the common development and distribution license (CDDL), v1.0; or
006:         * - the GNU Lesser General Public License, v2.1 or later
007:         * $Id: SessionValidatorRetriever.java 3643 2007-01-12 15:29:45Z gbevin $
008:         */
009:        package com.uwyn.rife.authentication;
010:
011:        import com.uwyn.rife.authentication.SessionValidator;
012:        import com.uwyn.rife.authentication.credentialsmanagers.exceptions.AuthenticatedElementNotFoundException;
013:        import com.uwyn.rife.authentication.credentialsmanagers.exceptions.NotAuthenticatedElementException;
014:        import com.uwyn.rife.authentication.elements.AuthenticatedDeployer;
015:        import com.uwyn.rife.engine.ElementDeployer;
016:        import com.uwyn.rife.engine.ElementInfo;
017:        import com.uwyn.rife.engine.Site;
018:
019:        /**
020:         * This abstract class provides the functionalities to retrieve a {@link
021:         * com.uwyn.rife.authentication.SessionValidator SessionValidator} from a
022:         * particular {@link com.uwyn.rife.authentication.elements.Authenticated
023:         * Authenticated} element in a site.
024:         * <p>Since you can have many authentication schemes and backends being active
025:         * in a single web application. it's quite verbose to retrieve a
026:         * {@code SessionValidator} when you want to perform some operations on
027:         * its stored credentials. This class provides the functionalities to quickly
028:         * perform this retrieval.
029:         * 
030:         * @author Geert Bevin (gbevin[remove] at uwyn dot com)
031:         * @author JR Boyens (gnu-jrb[remove] at gmx dot net)
032:         * @see com.uwyn.rife.authentication.SessionValidator
033:         * @see com.uwyn.rife.authentication.elements.Authenticated
034:         * @version $Revision: 3643 $
035:         * @since 1.0
036:         */
037:        public abstract class SessionValidatorRetriever {
038:            /**
039:             * Retrieves a {@code SessionValidator} manager from an
040:             * {@code Authenticated} element in a {@code Site}.
041:             * 
042:             * @param site the site in which the authenticated element is declared
043:             * @param authElementId the absolute ID of the authenticated element that
044:             * provides all the authentication related managers
045:             * @param reference a reference element against which to resolve the id;
046:             * or {@code null} if the provided id is absolute
047:             * @exception AuthenticatedElementNotFoundException when the element ID
048:             * couldn't be found in the site
049:             * @exception NotAuthenticatedElementException when the element ID doesn't
050:             * refer to an {@code Authenticated} element
051:             * @since 1.0
052:             */
053:            public static SessionValidator getSessionValidator(Site site,
054:                    String authElementId, ElementInfo reference) {
055:                if (null == site)
056:                    throw new IllegalArgumentException("site can't be null");
057:                if (null == authElementId)
058:                    throw new IllegalArgumentException(
059:                            "authElementId can't be null");
060:                if (0 == authElementId.length())
061:                    throw new IllegalArgumentException(
062:                            "authElementId can't be empty");
063:
064:                ElementInfo auth_elementinfo = site.resolveId(authElementId,
065:                        reference);
066:                if (null == auth_elementinfo) {
067:                    throw new AuthenticatedElementNotFoundException(
068:                            authElementId);
069:                }
070:
071:                return getSessionValidator(auth_elementinfo);
072:            }
073:
074:            /**
075:             * Retrieves a {@code SessionValidator} manager from an
076:             * {@code Authenticated} element in a {@code Site}.
077:             * 
078:             * @param authElementInfo the {@code ElementInfo} of the authenticated
079:             * element that provides all the authentication related managers
080:             * @exception NotAuthenticatedElementException when the provided element info
081:             * doesn't refer to an {@code Authenticated} element
082:             * @since 1.4
083:             */
084:            public static SessionValidator getSessionValidator(
085:                    ElementInfo authElementInfo) {
086:                if (null == authElementInfo)
087:                    throw new IllegalArgumentException(
088:                            "authElementInfo can't be null");
089:
090:                ElementDeployer deployer = authElementInfo.getDeployer();
091:                if (null == deployer
092:                        || !(deployer instanceof  AuthenticatedDeployer)) {
093:                    throw new NotAuthenticatedElementException(authElementInfo
094:                            .getId());
095:                }
096:                AuthenticatedDeployer auth_deployer = (AuthenticatedDeployer) deployer;
097:
098:                SessionValidator validator = auth_deployer
099:                        .getSessionValidator();
100:
101:                return validator;
102:            }
103:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.