Source Code Cross Referenced for AbstractSSOAdapter.java in  » Portal » Open-Portal » com » sun » ssoadapter » 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 » Open Portal » com.sun.ssoadapter 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /**
002:         * $Id: AbstractSSOAdapter.java,v 1.1 2005/06/13 18:08:49 rakeshn Exp $
003:         * Copyright 2002 Sun Microsystems, Inc. All
004:         * rights reserved. Use of this product is subject
005:         * to license terms. Federal Acquisitions:
006:         * Commercial Software -- Government Users
007:         * Subject to Standard License Terms and
008:         * Conditions.
009:         *
010:         * Sun, Sun Microsystems, the Sun logo, and iPlanet
011:         * are trademarks or registered trademarks of Sun Microsystems,
012:         * Inc. in the United States and other countries.
013:         */package com.sun.ssoadapter;
014:
015:        import java.util.Locale;
016:        import java.util.List;
017:        import java.util.Properties;
018:        import com.iplanet.sso.SSOToken;
019:        import com.iplanet.sso.SSOTokenListener;
020:        import com.iplanet.sso.SSOTokenEvent;
021:        import com.iplanet.sso.SSOException;
022:
023:        /**
024:         * This abstract class describes an object that implements SSOAdapter functionality.
025:         * <p>The primary purpose of an AbstractSSOAdapter is to provide SSO enablement
026:         *    of servlet based middleware, in regards to access to back-end services, e.g.,
027:         *    mail, calendar, or addressbook.
028:         * <p>An AbstractSSOAdapter acts as a bridge
029:         *    between the DSAME authentication and sessioning mechanism and
030:         *    whatever authentication and sessioning mechanism is employed
031:         *    by a particular back-end service.
032:         * <p> The derived class of AbstractSSOAdapter must implement
033:         * <ul>
034:         * <li>if init(...) implemeted , it should invoke the init(...) of the base AbstractSSOAdapter
035:         * <li>getConnection()
036:         * <li>closeConnection()
037:         * <li>ssoTokenChanged()
038:         * </ul>
039:         * <p>Other methods provided by a particular AbstractSSOAdapter implementation will
040:         *    probably depend on the API and service for which the helper is
041:         *    providing SSO enablement.
042:         *
043:         * @version 1.0
044:         * @see com.sun.ssoadapter.SSOAdapterFactory
045:         * @see com.sun.ssoadapter.SSOAdapterException
046:         *
047:         */
048:
049:        public abstract class AbstractSSOAdapter implements  SSOAdapter {
050:            /**
051:             * The adapterName
052:             */
053:            protected String adapterName;
054:            /**
055:             * TheadapterProperties
056:             */
057:            protected Properties adapterProperties;
058:            /**
059:             * the SSOToken
060:             */
061:            protected SSOToken token;
062:            /**
063:             * The locale for localized Error Message
064:             */
065:            protected Locale locale;
066:            /**
067:             * The identifier (DN) of the user
068:             */
069:            protected String identifier;
070:            /**
071:             * the user's PropertyList
072:             */
073:            protected List userPropertyList;
074:            /**
075:             * The encodedPropertyList
076:             */
077:            protected List encodedPropertyList;
078:
079:            /**
080:             * The no argument Constructor
081:             */
082:            protected AbstractSSOAdapter() {
083:            }
084:
085:            /**
086:             * Performs AbstractSSOAdapter initialization.
087:             * <p>When an AbstractSSOAdapter is instantiated by an SSOAdapterFactory,
088:             *    this method is invoked immediately following object creation.
089:             * <p>The init() method should not be used to perform any sort
090:             *    of authencation nor should it establish a connection with any
091:             *    backend service.
092:             * <p>The init() method is only invoked once during the lifetime of
093:             *    an AbstractSSOAdapter.
094:             * @param adapterName Used to identify the AbstractSSOAdapter
095:             * @param token Used to identify the user on who's behalf the request is
096:             *                     being processed.
097:             * @param adapterProperties Contains the adapter information that will drive
098:             *                          the operation of this instance of an AbstractSSOAdapter.
099:             * @param userPropertiesList a list on Strings , which contains the keys userConfigurableProperties
100:             * @param encodedProperteisList a list on Strings , which contains the keys encodedConfigurableProperties
101:             * @param locale locale if passed in to the SSOAdapterFactory.
102:             * @throws com.sun.ssoadapter.SSOAdapterException If fails
103:             */
104:            public void init(String adapterName, SSOToken token,
105:                    Properties adapterProperties, List userPropertiesList,
106:                    List encodedProperteisList, Locale locale)
107:                    throws SSOAdapterException {
108:                this .adapterName = adapterName;
109:                this .token = token;
110:                this .adapterProperties = adapterProperties;
111:                this .userPropertyList = userPropertiesList;
112:                this .encodedPropertyList = encodedProperteisList;
113:                this .locale = locale;
114:
115:                try {
116:                    identifier = "dn=" + token.getPrincipal().getName();
117:                } catch (Exception e) {
118:                    identifier = " ";
119:                }
120:
121:            }
122:
123:            /**
124:             * Adapter specific Connection.
125:             * It typically returns the MailStore for JavaMailSSOAdapter
126:             * @return This can be any Object like JavaMailStore
127:             */
128:            public abstract Object getConnection();
129:
130:            /**
131:             * Returns the SSOToken bound to this SSOAdapter.
132:             * @throws com.sun.ssoadapter.SSOAdapterException Exception if fails
133:             * @return The SSOToken
134:             */
135:            public SSOToken getSSOToken() throws SSOAdapterException {
136:                return token;
137:            }
138:
139:            /**
140:             * Returns the Name of this SSOAdapter.
141:             * @return The Name of this Adapter
142:             */
143:            public String getName() {
144:                return this .adapterName;
145:            }
146:
147:            /**
148:             * Returns the Properties bound to this SSOAdapter.
149:             * @return A list of properties which are set
150:             */
151:            public Properties getProperties() {
152:                return this .adapterProperties;
153:            }
154:
155:            /**
156:             * If the sepcified Property is a User configurable it will return true else false
157:             * @param propertyKey the key you want to check
158:             * @return true if the argument is a UserProperty else false
159:             * @since Portal 7
160:             */
161:            public boolean isUserProperty(String propertyKey) {
162:                if (userPropertyList != null
163:                        && userPropertyList.contains(propertyKey)) {
164:                    return true;
165:                }
166:                return false;
167:            }
168:
169:            /**
170:             * if this property can be configured only by Admin returns true else false
171:             * @param propertyKey the key you want to test
172:             * @return true if it is a admin Property else false
173:             * @since Portal 7
174:             */
175:            public boolean isAdminProperty(String propertyKey) {
176:                return !isUserProperty(propertyKey);
177:            }
178:
179:            /**
180:             * If this is a Encoded property returns true else false
181:             * @param propertyKey the key you want to test
182:             * @return true if it is a EncodedProperty else false
183:             * @since Portal 7
184:             */
185:            public boolean isEncodedProperty(String propertyKey) {
186:                if (encodedPropertyList != null
187:                        && encodedPropertyList.contains(propertyKey)) {
188:                    return true;
189:                }
190:                return false;
191:            }
192:
193:            /**
194:             * A List of the user Properties Keys. The values are available in getProperties
195:             * @return the List containing UserProperties keys.
196:             * @since Portal 7
197:             */
198:            public List getUserPropertiesList() {
199:                return userPropertyList;
200:            }
201:
202:            /**
203:             * A List of the encoded Properties Keys. The values are available in getProperties
204:             * @return the List containing EncodedProperties keys.
205:             * @since Portal 7
206:             */
207:            public List getEncodedPropertiesList() {
208:                return encodedPropertyList;
209:            }
210:
211:            /**
212:             * Adapter specific Connection termination.
213:             * @return true on success , false otherwise
214:             */
215:            public abstract boolean closeConnection();
216:
217:            /**
218:             * Implements SSOTokenListener "ssoTokenChanged" method.
219:             * @see com.iplanet.sso.SSOTokenListener
220:             * @param evt This is passed by AM with 
221:             *  clean if evtType != evt.SSO_TOKEN_DESTROY 
222:             *                   ||  evtType != evt.SSO_TOKEN_IDLE_TIMEOUT 
223:             *                   ||  evtType != evt.SSO_TOKEN_MAX_TIMEOUT
224:             */
225:            public abstract void ssoTokenChanged(SSOTokenEvent evt);
226:
227:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.