Source Code Cross Referenced for AuthenticationUtils.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: AuthenticationUtils.java 3643 2007-01-12 15:29:45Z gbevin $
008:         */
009:        package com.uwyn.rife.authentication;
010:
011:        import com.uwyn.rife.authentication.credentialsmanagers.exceptions.AuthenticatedElementNotFoundException;
012:        import com.uwyn.rife.authentication.credentialsmanagers.exceptions.NotAuthenticatedElementException;
013:        import com.uwyn.rife.authentication.exceptions.SessionManagerException;
014:        import com.uwyn.rife.engine.ElementInfo;
015:        import com.uwyn.rife.engine.Site;
016:
017:        /**
018:         * This abstract class provides convenience shortcut methods to
019:         * perform common operations with the authentication framework
020:         * 
021:         * @author Geert Bevin (gbevin[remove] at uwyn dot com)
022:         * @version $Revision: 3643 $
023:         * @since 1.4
024:         */
025:        public abstract class AuthenticationUtils {
026:            /**
027:             * Starts a new authentication session for a particular user and 
028:             * {@link com.uwyn.rife.authentication.elements.Authenticated Authenticated}
029:             * element in a site.
030:             * 
031:             * @param site the site in which the authenticated element is declared
032:             * @param authElementId the absolute ID of the authenticated element that
033:             * provides all the authentication related managers
034:             * @param reference a reference element against which to resolve the id;
035:             * or {@code null} if the provided id is absolute
036:             * @param userId The id that uniquely identifies the user that is allowed
037:             * to use this session.
038:             * @param hostIp The ip address of the host from which the user accesses
039:             * the application.
040:             * @param remembered Indicates whether the session is started through
041:             * remember me or from scratch.
042:             * @return A {@code String} that uniquely identifies the
043:             * authentication session that was just started.
044:             * @exception AuthenticatedElementNotFoundException when the element ID
045:             * couldn't be found in the site
046:             * @exception NotAuthenticatedElementException when the element ID doesn't
047:             * refer to an {@code Authenticated} element
048:             * @exception SessionManagerException when an error occurred while startin
049:             * the authentication session in a manager
050:             * @since 1.4
051:             */
052:            public static String startAuthenticationSession(Site site,
053:                    String authElementId, ElementInfo reference, long userId,
054:                    String hostIp, boolean remembered)
055:                    throws AuthenticatedElementNotFoundException,
056:                    NotAuthenticatedElementException, SessionManagerException {
057:                if (null == site)
058:                    throw new IllegalArgumentException("site can't be null");
059:                if (null == authElementId)
060:                    throw new IllegalArgumentException(
061:                            "authElementId can't be null");
062:                if (0 == authElementId.length())
063:                    throw new IllegalArgumentException(
064:                            "authElementId can't be empty");
065:
066:                return SessionValidatorRetriever.getSessionValidator(site,
067:                        authElementId, reference).getSessionManager()
068:                        .startSession(userId, hostIp, remembered);
069:            }
070:
071:            /**
072:             * Starts a new authentication session for a particular user and 
073:             * {@link com.uwyn.rife.authentication.elements.Authenticated Authenticated}
074:             * element in a site.
075:             * 
076:             * @param authElementInfo the {@code ElementInfo} of the authenticated
077:             * element that provides all the authentication related managers
078:             * @param userId The id that uniquely identifies the user that is allowed
079:             * to use this session.
080:             * @param hostIp The ip address of the host from which the user accesses
081:             * the application.
082:             * @param remembered Indicates whether the session is started through
083:             * remember me or from scratch.
084:             * @return A {@code String} that uniquely identifies the
085:             * authentication session that was just started.
086:             * @exception AuthenticatedElementNotFoundException when the element ID
087:             * couldn't be found in the site
088:             * @exception NotAuthenticatedElementException when the element ID doesn't
089:             * refer to an {@code Authenticated} element
090:             * @exception SessionManagerException when an error occurred while startin
091:             * the authentication session in a manager
092:             * @since 1.4
093:             */
094:            public static String startAuthenticationSession(
095:                    ElementInfo authElementInfo, long userId, String hostIp,
096:                    boolean remembered)
097:                    throws AuthenticatedElementNotFoundException,
098:                    NotAuthenticatedElementException, SessionManagerException {
099:                if (null == authElementInfo)
100:                    throw new IllegalArgumentException(
101:                            "authElementInfo can't be null");
102:
103:                return SessionValidatorRetriever.getSessionValidator(
104:                        authElementInfo).getSessionManager().startSession(
105:                        userId, hostIp, remembered);
106:            }
107:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.