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


001:        /**
002:         * $Id: ProducerImpl.java,v 1.8 2006/06/16 10:59:45 kk155903 Exp $
003:         * Copyright 2003 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 Sun ONE
011:         * are trademarks or registered trademarks of Sun Microsystems,
012:         * Inc. in the United States and other countries.
013:         */package com.sun.portal.wsrp.producer.impl;
014:
015:        import java.util.Set;
016:
017:        import javax.servlet.http.HttpServletRequest;
018:        import javax.servlet.ServletContext;
019:        import com.iplanet.am.sdk.AMOrganizationalUnit;
020:        import com.iplanet.sso.SSOToken;
021:
022:        import com.sun.portal.desktop.dp.DPRoot;
023:
024:        import com.sun.portal.wsrp.producer.Producer;
025:        import com.sun.portal.wsrp.producer.ISConnection;
026:        import com.sun.portal.wsrp.producer.ISConstants;
027:        import com.sun.portal.wsrp.producer.ProducerException;
028:        import com.sun.portal.wsrp.producer.DPConnection;
029:        import com.sun.portal.wsrp.producer.ProducerRegistryManager;
030:        import com.sun.portal.wsrp.producer.ProducerDN;
031:
032:        import com.sun.portal.wsrp.producer.markup.MarkupManager;
033:        import com.sun.portal.wsrp.producer.markup.impl.MarkupManagerImpl;
034:
035:        import com.sun.portal.wsrp.producer.registration.RegistrationManager;
036:        import com.sun.portal.wsrp.producer.registration.impl.RegistrationManagerImpl;
037:
038:        import com.sun.portal.wsrp.producer.servicedescription.ServiceDescriptionManager;
039:        import com.sun.portal.wsrp.producer.servicedescription.impl.ServiceDescriptionManagerImpl;
040:
041:        import com.sun.portal.wsrp.producer.portletmanagement.PortletManagementManager;
042:        import com.sun.portal.wsrp.producer.portletmanagement.impl.PortletManagementManagerImpl;
043:
044:        public class ProducerImpl implements  Producer, ISConstants {
045:            private ServiceDescriptionManager serviceDescriptionManager = null;
046:            private MarkupManager markupManager = null;
047:            private RegistrationManager registrationManager = null;
048:            private PortletManagementManager portletManagementManager = null;
049:
050:            private ISConnection isConnection = null;
051:
052:            private String producerKey = null;
053:            private String organization = null;
054:            private String instanceName = null;
055:            private String producerDN = null;
056:
057:            private AMOrganizationalUnit producer = null;
058:
059:            private HttpServletRequest req = null;
060:            private ServletContext ctx = null;
061:            private SSOToken token = null;
062:            private String portalId = null;
063:
064:            private void init(HttpServletRequest req, ServletContext ctx,
065:                    SSOToken token, String producerKey, String organization,
066:                    String instanceName) throws ProducerException {
067:                this .req = req;
068:                this .ctx = ctx;
069:                this .token = token;
070:                this .producerKey = producerKey;
071:                this .organization = organization;
072:                this .instanceName = instanceName;
073:                this .isConnection = new ISConnection(token);
074:                this .producerDN = ProducerDN.getProducerDN(organization,
075:                        instanceName, portalId);
076:            }
077:
078:            private void init(SSOToken token, String producerKey,
079:                    String organization, String instanceName)
080:                    throws ProducerException {
081:                this .token = token;
082:                this .producerKey = producerKey;
083:                this .organization = organization;
084:                this .instanceName = instanceName;
085:                this .isConnection = new ISConnection(token, portalId);
086:                this .producerDN = ProducerDN.getProducerDN(organization,
087:                        instanceName, portalId);
088:            }
089:
090:            public ProducerImpl(HttpServletRequest req, ServletContext ctx,
091:                    SSOToken token, String key) throws ProducerException {
092:                ProducerRegistryManager prm = ProducerRegistryManager
093:                        .getRegistryManager();
094:                String org = prm.getOrganization(key);
095:                String name = prm.getInstance(key);
096:
097:                init(req, ctx, token, key, org, name);
098:            }
099:
100:            public ProducerImpl(SSOToken token, String key, String portalId)
101:                    throws ProducerException {
102:                this .portalId = portalId;
103:                ProducerRegistryManager prm = ProducerRegistryManager
104:                        .getRegistryManager(portalId);
105:                String org = prm.getOrganization(key);
106:                String name = prm.getInstance(key);
107:
108:                init(token, key, org, name);
109:            }
110:
111:            public ProducerImpl(HttpServletRequest req, ServletContext ctx,
112:                    SSOToken token, String organization, String instance)
113:                    throws ProducerException {
114:                ProducerRegistryManager prm = ProducerRegistryManager
115:                        .getRegistryManager();
116:                String pk = prm.getKey(organization, instance);
117:
118:                init(req, ctx, token, pk, organization, instance);
119:            }
120:
121:            public boolean requiresRegistration() throws ProducerException {
122:                String requiresRegistration = isConnection.getStringAttribute(
123:                        producerDN, ATTR_REQUIRES_REGISTRATION);
124:
125:                if (requiresRegistration == null) {
126:                    return true;
127:                }
128:
129:                if (requiresRegistration.equalsIgnoreCase("true")) {
130:                    return true;
131:                }
132:
133:                return false;
134:            }
135:
136:            public void setRequiresRegistration(boolean requires)
137:                    throws ProducerException {
138:                Boolean newValue = requires ? Boolean.TRUE : Boolean.FALSE;
139:                isConnection.setStringAttribute(producerDN,
140:                        ATTR_REQUIRES_REGISTRATION, newValue.toString());
141:            }
142:
143:            public boolean inbandRegistrationSupported()
144:                    throws ProducerException {
145:                String isInbandRegistrationSupported = isConnection
146:                        .getStringAttribute(producerDN,
147:                                ATTR_SUPPORTS_IN_BAND_REGISTRATION);
148:
149:                if (isInbandRegistrationSupported == null) {
150:                    return false;
151:                }
152:
153:                if (isInbandRegistrationSupported.equalsIgnoreCase("true")) {
154:                    return true;
155:                }
156:
157:                return false;
158:            }
159:
160:            public void setInbandRegistrationSupported(boolean supported)
161:                    throws ProducerException {
162:                Boolean newValue = supported ? Boolean.TRUE : Boolean.FALSE;
163:                isConnection
164:                        .setStringAttribute(producerDN,
165:                                ATTR_SUPPORTS_IN_BAND_REGISTRATION, newValue
166:                                        .toString());
167:            }
168:
169:            public Set getPortletChannelNames() throws ProducerException {
170:                DPFilter filter = null;
171:                if (req != null) {
172:                    filter = new DPFilter(req, organization);
173:                } else {
174:                    filter = new DPFilter(portalId, organization);
175:                }
176:                return filter.getExistingChannels();
177:            }
178:
179:            public String getProducerKey() {
180:                return producerKey;
181:            }
182:
183:            public String getOrganization() {
184:                return organization;
185:            }
186:
187:            public String getInstanceName() {
188:                return instanceName;
189:            }
190:
191:            public boolean isEnabled() throws ProducerException {
192:                String dn = ProducerDN.getProducerDN(organization,
193:                        instanceName, portalId);
194:                String enabled = isConnection.getStringAttribute(dn,
195:                        ATTR_STATUS);
196:                return Boolean.valueOf(enabled).booleanValue();
197:            }
198:
199:            public void setIsEnabled(boolean enabled) throws ProducerException {
200:                String dn = ProducerDN.getProducerDN(organization,
201:                        instanceName, portalId);
202:                Boolean newValue = enabled ? Boolean.TRUE : Boolean.FALSE;
203:                isConnection.setStringAttribute(dn, ATTR_STATUS, newValue
204:                        .toString());
205:            }
206:
207:            public ServiceDescriptionManager getServiceDescriptionManager()
208:                    throws ProducerException {
209:                if (serviceDescriptionManager == null) {
210:                    //
211:                    // get the org-level dp root 
212:                    //
213:                    DPConnection dpc = null;
214:                    DPRoot dpr = null;
215:
216:                    if (req != null) {
217:                        dpc = new DPConnection(req);
218:                        dpr = dpc.getDPRoot(organization);
219:                        serviceDescriptionManager = new ServiceDescriptionManagerImpl(
220:                                ctx, req, token, getProducerKey(), dpr);
221:                    } else {
222:                        dpc = new DPConnection(portalId);
223:                        dpr = dpc.getDPRoot(organization);
224:                        serviceDescriptionManager = new ServiceDescriptionManagerImpl(
225:                                token, getProducerKey(), dpr, portalId);
226:                    }
227:                }
228:
229:                return serviceDescriptionManager;
230:            }
231:
232:            public MarkupManager getMarkupManager() throws ProducerException {
233:                if (markupManager == null) {
234:                    markupManager = new MarkupManagerImpl(req, ctx, token,
235:                            getProducerKey());
236:                }
237:
238:                return markupManager;
239:            }
240:
241:            public RegistrationManager getRegistrationManager()
242:                    throws ProducerException {
243:                if (registrationManager == null) {
244:                    registrationManager = new RegistrationManagerImpl(token,
245:                            getProducerKey(), portalId);
246:                }
247:
248:                return registrationManager;
249:            }
250:
251:            public PortletManagementManager getPortletManagementManager()
252:                    throws ProducerException {
253:                if (portletManagementManager == null) {
254:                    portletManagementManager = new PortletManagementManagerImpl(
255:                            req, ctx, token, getProducerKey());
256:                }
257:
258:                return portletManagementManager;
259:            }
260:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.