Source Code Cross Referenced for NativeAuthenticationProvider.java in  » Net » j2ssh » com » sshtools » daemon » platform » 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 » Net » j2ssh » com.sshtools.daemon.platform 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         *  SSHTools - Java SSH2 API
003:         *
004:         *  Copyright (C) 2002-2003 Lee David Painter and Contributors.
005:         *
006:         *  Contributions made by:
007:         *
008:         *  Brett Smith
009:         *  Richard Pernavas
010:         *  Erwin Bolwidt
011:         *
012:         *  This program is free software; you can redistribute it and/or
013:         *  modify it under the terms of the GNU General Public License
014:         *  as published by the Free Software Foundation; either version 2
015:         *  of the License, or (at your option) any later version.
016:         *
017:         *  This program is distributed in the hope that it will be useful,
018:         *  but WITHOUT ANY WARRANTY; without even the implied warranty of
019:         *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
020:         *  GNU General Public License for more details.
021:         *
022:         *  You should have received a copy of the GNU General Public License
023:         *  along with this program; if not, write to the Free Software
024:         *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
025:         */
026:        package com.sshtools.daemon.platform;
027:
028:        import com.sshtools.daemon.configuration.*;
029:
030:        import com.sshtools.j2ssh.configuration.*;
031:
032:        import org.apache.commons.logging.*;
033:
034:        import java.io.*;
035:
036:        /**
037:         *
038:         *
039:         * @author $author$
040:         * @version $Revision: 1.13 $
041:         */
042:        public abstract class NativeAuthenticationProvider {
043:            private static Log log = LogFactory
044:                    .getLog(NativeAuthenticationProvider.class);
045:            private static Class cls;
046:            private static NativeAuthenticationProvider instance;
047:
048:            static {
049:                try {
050:                    if (ConfigurationLoader
051:                            .isConfigurationAvailable(PlatformConfiguration.class)) {
052:                        cls = ConfigurationLoader
053:                                .getExtensionClass(((PlatformConfiguration) ConfigurationLoader
054:                                        .getConfiguration(PlatformConfiguration.class))
055:                                        .getNativeAuthenticationProvider());
056:
057:                        //
058:                    }
059:                } catch (Exception e) {
060:                    log.error("Failed to load native authentication provider",
061:                            e);
062:                    instance = null;
063:                }
064:            }
065:
066:            /**
067:             *
068:             *
069:             * @param cls
070:             */
071:            public static void setProvider(Class cls) {
072:                NativeAuthenticationProvider.cls = cls;
073:            }
074:
075:            /**
076:             *
077:             *
078:             * @param username
079:             *
080:             * @return
081:             *
082:             * @throws IOException
083:             */
084:            public abstract String getHomeDirectory(String username)
085:                    throws IOException;
086:
087:            /**
088:             *
089:             *
090:             * @param username
091:             * @param password
092:             *
093:             * @return
094:             *
095:             * @throws PasswordChangeException
096:             * @throws IOException
097:             */
098:            public abstract boolean logonUser(String username, String password)
099:                    throws PasswordChangeException, IOException;
100:
101:            /**
102:             *
103:             *
104:             * @param username
105:             *
106:             * @return
107:             *
108:             * @throws IOException
109:             */
110:            public abstract boolean logonUser(String username)
111:                    throws IOException;
112:
113:            /**
114:             *
115:             *
116:             * @throws IOException
117:             */
118:            public abstract void logoffUser() throws IOException;
119:
120:            /**
121:             *
122:             *
123:             * @param username
124:             * @param oldpassword
125:             * @param newpassword
126:             *
127:             * @return
128:             */
129:            public abstract boolean changePassword(String username,
130:                    String oldpassword, String newpassword);
131:
132:            /**
133:             *
134:             *
135:             * @return
136:             *
137:             * @throws IOException
138:             */
139:            public static NativeAuthenticationProvider getInstance()
140:                    throws IOException {
141:                if (instance == null) {
142:                    try {
143:                        if (cls == null) {
144:                            throw new IOException(
145:                                    "There is no authentication provider configured");
146:                        }
147:
148:                        instance = (NativeAuthenticationProvider) cls
149:                                .newInstance();
150:                    } catch (Exception e) {
151:                        throw new IOException(
152:                                "The authentication provider failed to initialize: "
153:                                        + e.getMessage());
154:                    }
155:                }
156:
157:                return instance;
158:            }
159:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.