Source Code Cross Referenced for ProducerSessionManagerImpl.java in  » Portal » Open-Portal » com » sun » portal » wsrp » consumer » markup » impl » 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.wsrp.consumer.markup.impl 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /**
002:         * Copyright 2003 Sun Microsystems, Inc. All
003:         * rights reserved. Use of this product is subject
004:         * to license terms. Federal Acquisitions:
005:         * Commercial Software -- Government Users
006:         * Subject to Standard License Terms and
007:         * Conditions.
008:         *
009:         * Sun, Sun Microsystems, the Sun logo, and Sun ONE
010:         * are trademarks or registered trademarks of Sun Microsystems,
011:         * Inc. in the United States and other countries.
012:         */package com.sun.portal.wsrp.consumer.markup.impl;
013:
014:        import java.util.logging.Logger;
015:
016:        import com.sun.portal.container.ContainerRequest;
017:        import com.sun.portal.container.ContainerException;
018:        import com.sun.portal.container.ContentException;
019:        import com.sun.portal.wsrp.common.stubs.SessionContext;
020:        import com.sun.portal.wsrp.common.stubs.WSRP_v1_Markup_PortType;
021:        import com.sun.portal.wsrp.consumer.markup.MarkupConfig;
022:        import com.sun.portal.wsrp.consumer.markup.ProducerSessionManager;
023:        import com.sun.portal.wsrp.consumer.common.WSRPConsumerConfig;
024:
025:        /**
026:         * This is the implementation of ProducerSessionManager designed that
027:         * has methods to manage the session and cookies with a WSRP Producer.
028:         * This implementation basically delegates all its functionality to
029:         * AnonProducerSessionManager if the user is anonymous/authless or
030:         * to AuthProducerSessionManagerImpl if the user is a a regular user.
031:         * Basic difference and the reason for two such implementations is
032:         * that in our portal, Anonymous is not allowed to have session, so
033:         * anonymous desktop shouldn't be configured with a portlet from 
034:         * producer that requires initCookie. Having such portlet means
035:         * the markup stub needs to be saved for the session and for 
036:         * anonymous user, there is no place to store it.
037:         * Hence all session information is stored in client properties
038:         * for anonymous user and as providerContext.setSessionProperty 
039:         * for regular users.
040:         * 
041:         */
042:        public class ProducerSessionManagerImpl implements 
043:                ProducerSessionManager {
044:
045:            private ProducerSessionManager _anonProducerSessionManager = null;
046:            private ProducerSessionManager _authProducerSessionManager = null;
047:
048:            public ProducerSessionManagerImpl() {
049:
050:                _authProducerSessionManager = new ProducerSessionManagerInitCookie();
051:
052:                if (WSRPConsumerConfig.getInstance()
053:                        .doesAnonSupportInitCookie()) {
054:
055:                    // use the same implementation as used for regular user
056:
057:                    _anonProducerSessionManager = _authProducerSessionManager;
058:                } else {
059:                    _anonProducerSessionManager = new ProducerSessionManagerNoInitCookie();
060:                }
061:
062:            }
063:
064:            /**
065:             * This method processes the SessionContext sent by the producer
066:             * as part of the response. 
067:             * Information in SessionContext must be stored so that it can be returned
068:             * on following requests to maintain the session.
069:             * 
070:             * @param markupConfig markup configuration object.
071:             * @param request container request.
072:             * @param sessionContext session context sent back as a response from the producer.
073:             * @exception com.sun.portal.container.ContainerException
074:             * @exception com.sun.portal.container.ContentException
075:             */
076:
077:            public void processSessionContext(MarkupConfig markupConfig,
078:                    ContainerRequest request, SessionContext sessionContext)
079:                    throws ContainerException, ContentException {
080:
081:                if (MarkupUtil.isAuthless(request)) {
082:                    _anonProducerSessionManager.processSessionContext(
083:                            markupConfig, request, sessionContext);
084:                } else {
085:                    _authProducerSessionManager.processSessionContext(
086:                            markupConfig, request, sessionContext);
087:                }
088:
089:            }
090:
091:            /**
092:             * Get the session id to be returned back to producer
093:             * for this request
094:             * 
095:             * @param markupConfig
096:             * @param request
097:             * @exception com.sun.portal.container.ContainerException
098:             * @exception com.sun.portal.container.ContentException
099:             */
100:            public String getProducerSessionId(MarkupConfig markupConfig,
101:                    ContainerRequest request) throws ContainerException,
102:                    ContentException {
103:
104:                if (MarkupUtil.isAuthless(request)) {
105:                    return _anonProducerSessionManager.getProducerSessionId(
106:                            markupConfig, request);
107:                } else {
108:                    return _authProducerSessionManager.getProducerSessionId(
109:                            markupConfig, request);
110:                }
111:            }
112:
113:            /**
114:             * Invalidate or remove the session explicitly.
115:             * 
116:             * @param markupConfig
117:             * @param request
118:             * @exception com.sun.portal.container.ContainerException
119:             * @exception com.sun.portal.container.ContentException
120:             */
121:            public void resetSessionId(String invalidSessionId,
122:                    MarkupConfig markupConfig, ContainerRequest request)
123:                    throws ContainerException, ContentException {
124:
125:                if (MarkupUtil.isAuthless(request)) {
126:                    _anonProducerSessionManager.resetSessionId(
127:                            invalidSessionId, markupConfig, request);
128:                } else {
129:                    _authProducerSessionManager.resetSessionId(
130:                            invalidSessionId, markupConfig, request);
131:                }
132:
133:            }
134:
135:            /**
136:             * Returns a markup porttype stub that can be used 
137:             * for calling remote markup methods. If initCookie
138:             * requirement is on for this producer, this stub
139:             * is ornamented with all the right cookies.
140:             * 
141:             * @param markupConfig
142:             * @param request
143:             * @exception com.sun.portal.container.ContainerException
144:             * @exception com.sun.portal.container.ContentException
145:             */
146:
147:            public WSRP_v1_Markup_PortType getMarkupPortType(
148:                    MarkupConfig markupConfig, ContainerRequest request)
149:                    throws ContainerException, ContentException {
150:
151:                if (MarkupUtil.isAuthless(request)) {
152:                    return _anonProducerSessionManager.getMarkupPortType(
153:                            markupConfig, request);
154:                } else {
155:                    return _authProducerSessionManager.getMarkupPortType(
156:                            markupConfig, request);
157:                }
158:
159:            }
160:
161:            public void resetMarkupPortType(
162:                    WSRP_v1_Markup_PortType invalidPortType,
163:                    MarkupConfig markupConfig, ContainerRequest request)
164:                    throws ContainerException, ContentException {
165:                if (MarkupUtil.isAuthless(request)) {
166:                    _anonProducerSessionManager.resetMarkupPortType(
167:                            invalidPortType, markupConfig, request);
168:                } else {
169:                    _authProducerSessionManager.resetMarkupPortType(
170:                            invalidPortType, markupConfig, request);
171:                }
172:
173:            }
174:
175:            /**
176:             * We need to share this string with the proxy servlet
177:             * that also might want to read or update the cookies
178:             * when processing a url of type resource. 
179:             * 
180:             * @param markupConfig
181:             * @param request
182:             * @exception com.sun.portal.container.ContainerException
183:             * @exception com.sun.portal.container.ContentException
184:             */
185:            public String getCookieHandleKey(MarkupConfig markupConfig,
186:                    ContainerRequest request) throws ContainerException {
187:
188:                if (MarkupUtil.isAuthless(request)) {
189:                    return _anonProducerSessionManager.getCookieHandleKey(
190:                            markupConfig, request);
191:                } else {
192:                    return _authProducerSessionManager.getCookieHandleKey(
193:                            markupConfig, request);
194:                }
195:
196:            }
197:
198:        }
w_w__w_._java2__s___.___com_ | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.