Source Code Cross Referenced for AuthenticationProviderImpl.java in  » Portal » jetspeed-2.1.3 » org » apache » jetspeed » security » impl » 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 » Portal » jetspeed 2.1.3 » org.apache.jetspeed.security.impl 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /* 
002:         * Licensed to the Apache Software Foundation (ASF) under one or more
003:         * contributor license agreements.  See the NOTICE file distributed with
004:         * this work for additional information regarding copyright ownership.
005:         * The ASF licenses this file to You under the Apache License, Version 2.0
006:         * (the "License"); you may not use this file except in compliance with
007:         * the License.  You may obtain a copy of the License at
008:         *
009:         *     http://www.apache.org/licenses/LICENSE-2.0
010:         *
011:         * Unless required by applicable law or agreed to in writing, software
012:         * distributed under the License is distributed on an "AS IS" BASIS,
013:         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014:         * See the License for the specific language governing permissions and
015:         * limitations under the License.
016:         */
017:        package org.apache.jetspeed.security.impl;
018:
019:        import java.net.URL;
020:
021:        import org.apache.commons.logging.Log;
022:        import org.apache.commons.logging.LogFactory;
023:
024:        import org.apache.jetspeed.components.util.system.SystemResourceUtil;
025:        import org.apache.jetspeed.components.util.system.ClassLoaderSystemResourceUtilImpl;
026:        import org.apache.jetspeed.security.AuthenticationProvider;
027:        import org.apache.jetspeed.security.spi.CredentialHandler;
028:        import org.apache.jetspeed.security.spi.UserSecurityHandler;
029:
030:        /**
031:         * @see org.apache.jetspeed.security.AuthenticationProvider
032:         * @author <a href="mailto:LeStrat_David@emc.com">David Le Strat </a>
033:         */
034:        public class AuthenticationProviderImpl implements 
035:                AuthenticationProvider {
036:
037:            /** The logger. */
038:            private static final Log log = LogFactory
039:                    .getLog(AuthenticationProviderImpl.class);
040:
041:            /** The provider name. */
042:            private String providerName;
043:
044:            /** The provider description. */
045:            private String providerDescription;
046:
047:            /** The {@link CredentialHandler}. */
048:            private CredentialHandler credHandler;
049:
050:            /** The {@link UserSecurityHandler}. */
051:            private UserSecurityHandler userSecurityHandler;
052:
053:            /**
054:             * <p>
055:             * Constructor to configure authenticatino user security and credential
056:             * handlers.
057:             * </p>
058:             * 
059:             * @param providerName The provider name.
060:             * @param providerDescription The provider description.
061:             * @param credHandler The credential handler.
062:             * @param userSecurityHandler The user security handler.
063:             */
064:            public AuthenticationProviderImpl(String providerName,
065:                    String providerDescription, CredentialHandler credHandler,
066:                    UserSecurityHandler userSecurityHandler) {
067:                // The provider name.
068:                this .providerName = providerName;
069:                // The provider description.
070:                this .providerDescription = providerDescription;
071:
072:                // The credential handler.
073:                this .credHandler = credHandler;
074:                // The user security handler.
075:                this .userSecurityHandler = userSecurityHandler;
076:            }
077:
078:            /**
079:             * <p>
080:             * Constructor configuring the security service with the correct
081:             * <code>java.security.auth.login.config</code>.
082:             * </p>
083:             * 
084:             * @param providerName The provider name.
085:             * @param providerDescription The provider description.
086:             * @param loginConfig The login module config.
087:             * @param credHandler The credential handler.
088:             * @param userSecurityHandler The user security handler.
089:             */
090:            public AuthenticationProviderImpl(String providerName,
091:                    String providerDescription, String loginConfig,
092:                    CredentialHandler credHandler,
093:                    UserSecurityHandler userSecurityHandler) {
094:                this (providerName, providerDescription, credHandler,
095:                        userSecurityHandler);
096:
097:                ClassLoader cl = Thread.currentThread().getContextClassLoader();
098:                SystemResourceUtil resourceUtil = new ClassLoaderSystemResourceUtilImpl(
099:                        cl);
100:                URL loginConfigUrl = null;
101:                // The login module config.
102:                try {
103:                    loginConfigUrl = resourceUtil.getURL(loginConfig);
104:                } catch (Exception e) {
105:                    throw new IllegalStateException(
106:                            "Could not locate the login config.  Bad URL. "
107:                                    + e.toString());
108:                }
109:                if (null != loginConfigUrl) {
110:                    if (log.isDebugEnabled())
111:                        log.debug("java.security.auth.login.config = "
112:                                + loginConfigUrl.toString());
113:                    System.setProperty("java.security.auth.login.config",
114:                            loginConfigUrl.toString());
115:                }
116:            }
117:
118:            /**
119:             * @return Returns the providerDescription.
120:             */
121:            public String getProviderDescription() {
122:                return providerDescription;
123:            }
124:
125:            /**
126:             * @param providerDescription The providerDescription to set.
127:             */
128:            public void setProviderDescription(String providerDescription) {
129:                this .providerDescription = providerDescription;
130:            }
131:
132:            /**
133:             * @return Returns the providerName.
134:             */
135:            public String getProviderName() {
136:                return providerName;
137:            }
138:
139:            /**
140:             * @param providerName The providerName to set.
141:             */
142:            public void setProviderName(String providerName) {
143:                this .providerName = providerName;
144:            }
145:
146:            /**
147:             * @see org.apache.jetspeed.security.AuthenticationProvider#getCredentialHandler()
148:             */
149:            public CredentialHandler getCredentialHandler() {
150:                return this .credHandler;
151:            }
152:
153:            /**
154:             * @see org.apache.jetspeed.security.AuthenticationProvider#getUserSecurityHandler()
155:             */
156:            public UserSecurityHandler getUserSecurityHandler() {
157:                return this .userSecurityHandler;
158:            }
159:
160:            /**
161:             * @see org.apache.jetspeed.security.AuthenticationProvider#setCredentialHandler(CredentialHandler)
162:             */
163:            public void setCredentialHandler(CredentialHandler credHandler) {
164:                this .credHandler = credHandler;
165:            }
166:
167:            /**
168:             * @see org.apache.jetspeed.security.AuthenticationProvider#setUserSecurityHandler(UserSecurityHandler)
169:             */
170:            public void setUserSecurityHandler(
171:                    UserSecurityHandler userSecurityHandler) {
172:                this.userSecurityHandler = userSecurityHandler;
173:            }
174:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.