Source Code Cross Referenced for DavRealm.java in  » ERP-CRM-Financial » sakai » org » sakaiproject » dav » 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 » ERP CRM Financial » sakai » org.sakaiproject.dav 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /**********************************************************************************
002:         * $URL: https://source.sakaiproject.org/svn/dav/tags/sakai_2-4-1/dav-server/src/java/org/sakaiproject/dav/DavRealm.java $
003:         * $Id: DavRealm.java 8482 2006-04-28 20:28:09Z ggolden@umich.edu $
004:         ***********************************************************************************
005:         *
006:         * Copyright (c) 2003, 2004, 2005, 2006 The Sakai Foundation.
007:         * 
008:         * Licensed under the Educational Community License, Version 1.0 (the "License"); 
009:         * you may not use this file except in compliance with the License. 
010:         * You may obtain a copy of the License at
011:         * 
012:         *      http://www.opensource.org/licenses/ecl1.php
013:         * 
014:         * Unless required by applicable law or agreed to in writing, software 
015:         * distributed under the License is distributed on an "AS IS" BASIS, 
016:         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
017:         * See the License for the specific language governing permissions and 
018:         * limitations under the License.
019:         *
020:         **********************************************************************************/package org.sakaiproject.dav;
021:
022:        import java.security.Principal;
023:
024:        import org.apache.catalina.LifecycleException;
025:        import org.apache.catalina.realm.RealmBase;
026:
027:        /**
028:         * Simple implementation of <b>Realm</b> that consults the Sakai user directory service to provide container security equivalent to then application security in CHEF.
029:         * <p>
030:         * <strong>IMPLEMENTATION NOTE</strong>: The user is assumed to have all "roles" because servlets and teamlets will enforce roles within Sakai - so in this realm, we simply indicate "true".
031:         */
032:        public final class DavRealm extends RealmBase {
033:            /** Descriptive information about this Realm implementation. */
034:            protected final String info = "org.sakaiproject.realm.DavRealm/1.0";
035:
036:            /** Descriptive information about this Realm implementation. */
037:            protected static final String name = "DavRealm";
038:
039:            /**
040:             * Return descriptive information about this Realm implementation and the corresponding version number, in the format <code>&lt;description&gt;/&lt;version&gt;</code>.
041:             */
042:            public String getInfo() {
043:                return info;
044:            }
045:
046:            /**
047:             * Return the Principal associated with the specified username and credentials, if there is one; otherwise return <code>null</code>.
048:             * 
049:             * @param username
050:             *        Username of the Principal to look up
051:             * @param credentials
052:             *        Password or other credentials to use in authenticating this username
053:             */
054:            public Principal authenticate(String username, String credentials) {
055:                if (username == null || credentials == null)
056:                    return (null);
057:                if (username.length() <= 0 || credentials.length() <= 0)
058:                    return (null);
059:
060:                DavPrincipal prin = new DavPrincipal(username, credentials);
061:
062:                return prin;
063:            }
064:
065:            /**
066:             * Return a short name for this Realm implementation.
067:             */
068:            protected String getName() {
069:                return name;
070:            }
071:
072:            protected Principal getPrincipal(String username) {
073:                System.out.println("DavRealm.getPrincipal(" + username
074:                        + ") -- why is this being called?");
075:
076:                if (username == null)
077:                    return (null);
078:
079:                return new DavPrincipal(username, " ");
080:            }
081:
082:            /**
083:             * Return the password associated with the given principal's user name.
084:             */
085:            protected String getPassword(String username) {
086:                System.out.println("DavRealm.getPassword(" + username + ")");
087:                return (null);
088:            }
089:
090:            /**
091:             * Prepare for active use of the public methods of this Component.
092:             * 
093:             * @exception IllegalStateException
094:             *            if this component has already been started
095:             * @exception LifecycleException
096:             *            if this component detects a fatal error that prevents it from being started
097:             */
098:            public synchronized void start() throws LifecycleException {
099:                System.out.println("DavRealm.start()");
100:
101:                // Perform normal superclass initialization
102:                super .start();
103:            }
104:
105:            /**
106:             * Gracefully shut down active use of the public methods of this Component.
107:             * 
108:             * @exception IllegalStateException
109:             *            if this component has not been started
110:             * @exception LifecycleException
111:             *            if this component detects a fatal error that needs to be reported
112:             */
113:            public synchronized void stop() throws LifecycleException {
114:                // Perform normal superclass finalization
115:                super .stop();
116:
117:                // No shutdown activities required
118:            }
119:
120:            public boolean hasRole(Principal principal, String role) {
121:                return (true);
122:            }
123:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.