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


001:        /**
002:         * $Id: NotesABStore.java,v 1.4 2005/06/13 21:56:23 rakeshn Exp $
003:         * Copyright 2002 Sun Microsystems, Inc. All rights reserved. Use of this
004:         * product is subject to license terms. Federal Acquisitions:
005:         * Commercial Software -- Government Users Subject to Standard License Terms
006:         * and Conditions.
007:         *
008:         * Sun, Sun Microsystems, the Sun logo, and Sun ONE are trademarks or 
009:         * registered trademarks of Sun Microsystems, Inc. in the United States
010:         * and other countries.
011:         */package com.sun.ssoadapter.ab.notes;
012:
013:        import com.sun.addressbook.ABSession;
014:        import com.sun.addressbook.ABStoreException;
015:        import com.sun.ssoadapter.ab.pim.JPimABStore;
016:
017:        import com.sun.addressbook.MissingPropertiesException;
018:
019:        import com.aligo.pim.PimContainerType;
020:        import com.aligo.pim.PimUserInfoParameter;
021:        import com.aligo.pim.interfaces.PimUserInfo;
022:
023:        //the following are required only for DominoSSO
024:        import com.aligo.pim.interfaces.PimContainer;
025:        import com.aligo.pim.exceptions.PimException; //The following is a private api of Aligo
026:        import com.aligo.pim.lotus.*;
027:
028:        public class NotesABStore extends JPimABStore {
029:            public static final String LTPA_TOKEN = "lotus.ltpatoken.value";
030:
031:            /**
032:             * Returns the Container Type corresponding to the notes backend
033:             */
034:            protected PimContainerType getPimContainerType(ABSession session) {
035:                return PimContainerType.LOTUS;
036:            }
037:
038:            public void init(ABSession session, PimUserInfo pimU)
039:                    throws MissingPropertiesException {
040:                String userName = session.getProperty(USERNAME);
041:                String userPasswd = session.getProperty(USERPASSWD);
042:                String jPimHost = session.getProperty(JPIMHOST);
043:                String jPimPort = session.getProperty(JPIMPORT);
044:                String ltpaToken = session.getProperty(LTPA_TOKEN);
045:
046:                if (ltpaToken != null) {
047:                    pimU.set(PimUserInfoParameter.LOTUS_LTPA_TOKEN, ltpaToken);
048:                    //To workaround the Aligo bug which throws exception for null user
049:                    userName = "sso";
050:                    userPasswd = "sso";
051:                }
052:
053:                if (userName == null) {
054:                    throw new MissingPropertiesException(
055:                            "Cannot connect to JPim server:: Missing Property: "
056:                                    + USERNAME);
057:                }
058:
059:                if (userPasswd == null) {
060:                    throw new MissingPropertiesException(
061:                            "Cannot connect to JPim server:: Missing Property: "
062:                                    + USERPASSWD);
063:                }
064:
065:                if (jPimHost == null) {
066:                    throw new MissingPropertiesException(
067:                            "Cannot connect to JPim server:: Missing Property: "
068:                                    + JPIMHOST);
069:                }
070:
071:                if (jPimPort != null) {
072:                    jPimHost += ":" + jPimPort; // host:port format
073:                }
074:
075:                pimU.set(PimUserInfoParameter.LOTUS_USERNAME, userName);
076:                pimU.set(PimUserInfoParameter.LOTUS_PASSWORD, userPasswd);
077:                pimU.set(PimUserInfoParameter.LOTUS_SERVER, jPimHost);
078:
079:                boolean debugEnabled = (new Boolean(session
080:                        .getProperty("ab.pim.debug"))).booleanValue();
081:                if (debugEnabled) {
082:                    pimU.set(PimUserInfoParameter.DEBUG, "true");
083:                }
084:            }
085:
086:            /**
087:             *  This postConnect does the required stuff 
088:             *  like getting the CurrentUser info from the remote server
089:             *  used for Notes in case of SSO
090:             */
091:            protected void postConnect(PimContainer pimContainer)
092:                    throws ABStoreException {
093:                try {
094:                    if (pimContainer.getCurrentUser() instanceof  LotusPimAddressEntryItem) {
095:                        LotusPimAddressEntryItem addrItem = (LotusPimAddressEntryItem) pimContainer
096:                                .getCurrentUser();
097:                        String mailFileName = addrItem.getMailFileName();
098:                        session.setProperty("lotus.mailFileName", mailFileName);
099:                        int i = mailFileName.lastIndexOf("/");
100:                        int j = mailFileName.lastIndexOf("\\");
101:                        int k = (i > j) ? i : j;
102:                        String userName = null;
103:                        if (k > 0)
104:                            userName = mailFileName.substring(k + 1);
105:                        if (userName != null)
106:                            session.setProperty("lotus.sso.user", userName);
107:                    }
108:                } catch (PimException ex) {
109:                    throw new ABStoreException("failed in postConnect" + ex);
110:                }
111:            }
112:
113:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.