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


001:        package com.sun.portal.rproxy.configservlet.server;
002:
003:        import java.rmi.RemoteException;
004:        import java.util.Map;
005:
006:        import com.iplanet.am.sdk.AMException;
007:        import com.iplanet.am.sdk.AMStoreConnection;
008:        import com.iplanet.am.sdk.AMUser;
009:        import com.iplanet.sso.SSOException;
010:        import com.iplanet.sso.SSOToken;
011:        import com.iplanet.sso.SSOTokenManager;
012:        import com.sun.portal.rproxy.configservlet.Request;
013:        import com.sun.portal.rproxy.configservlet.Response;
014:        import com.sun.portal.rproxy.configservlet.ServiceHandler;
015:
016:        public class UserAttributesServiceHandler implements  ServiceHandler {
017:
018:            public UserAttributesServiceHandler() {
019:            }
020:
021:            public Response handleRequest(Request request)
022:                    throws RemoteException {
023:                // iDSAME Migration
024:                // Servlet User Profile Caching added
025:                // So modifying to use the cache instead of directly fetching.
026:                // - Mridul
027:                /*
028:                 * try { SSOToken token = getSSOToken(request); AMStoreConnection
029:                 * connection = new AMStoreConnection(token); AMUser user =
030:                 * connection.getUser(token.getPrincipal().getName()); Map attrs =
031:                 * user.getAttributes(); Response response = new
032:                 * Response(request.getServiceName(), request.getRequestType(), attrs);
033:                 * return response; } catch (SSOException ssoe) { throw new
034:                 * RemoteException("Not able to get Global Attributes", ssoe); } catch
035:                 * (AMException dpe) { throw new RemoteException("Not able to get Global
036:                 * Attributes", dpe); }
037:                 */
038:                // TODO::
039:                // Must add code here to check if this is a get request or a set
040:                // request.
041:                // Check this profile is present in the cache and if not fetch it and
042:                // add to cache.
043:                String tokid = request.getSSOTokenId();
044:                Response resp = UserProfileCache.getResponse(tokid);
045:                boolean valid = true;
046:
047:                // As a side-effect of the cache-cleaner thread in the UserProfileCache,
048:                // we don't need this.
049:                // When SessionListener gets properly implemented by iDSAME , this code
050:                // will have to come back.
051:                /*
052:                 * if (resp == null){
053:                 * 
054:                 * SSOToken token = getSSOToken(request); if (token != null){ // See
055:                 * whether this is a valid token. resp =
056:                 * fetchUserAttributes(request,token); try{ long dummy =
057:                 * token.getIdleTime(); UserProfileCache.addEntry(token , tokid , resp);
058:                 * }catch(SSOException ex){ valid = false; } } }
059:                 */
060:                resp.setRequestType(request.getRequestType());
061:                resp.setServiceName(request.getServiceName());
062:                resp.setNormal(valid);
063:                return resp;
064:            }
065:
066:            // private Response fetchUserAttributes(Request request,SSOToken token)
067:            // throws RemoteException{
068:            protected Response fetchUserAttributes(Request request,
069:                    SSOToken token) throws RemoteException {
070:
071:                try {
072:                    // SSOToken token = getSSOToken(request);
073:                    AMStoreConnection connection = new AMStoreConnection(token);
074:                    AMUser user = connection.getUser(token.getPrincipal()
075:                            .getName());
076:                    Map attrs = user.getAttributes();
077:                    Response response = new Response(request.getServiceName(),
078:                            request.getRequestType(), attrs);
079:                    return response;
080:                } catch (SSOException ssoe) {
081:                    throw new RemoteException(
082:                            "Not able to get Global Attributes", ssoe);
083:                } catch (AMException dpe) {
084:                    throw new RemoteException(
085:                            "Not able to get Global Attributes", dpe);
086:                }
087:            }
088:
089:            // private SSOToken getSSOToken(Request request) throws RemoteException {
090:            protected SSOToken getSSOToken(Request request)
091:                    throws RemoteException {
092:                try {
093:                    String tokenId = request.getSSOTokenId();
094:                    SSOTokenManager tokenManager = SSOTokenManager
095:                            .getInstance();
096:                    return tokenManager.createSSOToken(tokenId);
097:                } catch (SSOException ssoe) {
098:                    throw new RemoteException("Not able to get the token", ssoe);
099:                }
100:            }
101:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.