Source Code Cross Referenced for WebserviceGatewayServiceLocator.java in  » Authentication-Authorization » josso-1.7 » org » josso » gateway » 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 » Authentication Authorization » josso 1.7 » org.josso.gateway 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * JOSSO: Java Open Single Sign-On
003:         *
004:         * Copyright 2004-2008, Atricore, Inc.
005:         *
006:         * This is free software; you can redistribute it and/or modify it
007:         * under the terms of the GNU Lesser General Public License as
008:         * published by the Free Software Foundation; either version 2.1 of
009:         * the License, or (at your option) any later version.
010:         *
011:         * This software is distributed in the hope that it will be useful,
012:         * but WITHOUT ANY WARRANTY; without even the implied warranty of
013:         * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
014:         * Lesser General Public License for more details.
015:         *
016:         * You should have received a copy of the GNU Lesser General Public
017:         * License along with this software; if not, write to the Free
018:         * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
019:         * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
020:         */
021:        package org.josso.gateway;
022:
023:        import org.apache.commons.logging.Log;
024:        import org.apache.commons.logging.LogFactory;
025:        import org.josso.ComponentKeeper;
026:        import org.josso.Lookup;
027:        import org.josso.MBeanComponentKeeper;
028:        import org.josso.gateway.session.service.ws.WebserviceSSOSessionManager;
029:        import org.josso.gateway.identity.service.SSOIdentityProvider;
030:
031:        /**
032:         * Service Locator for Gateway Services available as Webservices.
033:         *
034:         * @author <a href="mailto:gbrigand@josso.org">Gianluca Brigandi</a>
035:         * @version CVS $Id: WebserviceGatewayServiceLocator.java 508 2008-02-18 13:32:29Z sgonzalez $
036:         */
037:
038:        public class WebserviceGatewayServiceLocator extends
039:                GatewayServiceLocator {
040:
041:            private static final Log logger = LogFactory
042:                    .getLog(WebserviceGatewayServiceLocator.class);
043:
044:            private static final String TRANSPORT_SECURITY_NONE = "none";
045:            private static final String TRANSPORT_SECURITY_CONFIDENTIAL = "confidential";
046:
047:            private String _endpoint;
048:            private String _username;
049:            private String _transportSecurity = TRANSPORT_SECURITY_NONE;
050:            private String _servicesWebContext;
051:
052:            /**
053:             * Package private Constructor so that it can only be instantiated
054:             * by the GatewayServiceLocator Class.
055:             */
056:            public WebserviceGatewayServiceLocator() {
057:            }
058:
059:            /**
060:             * Locates the SSO Session Manager Service Webservice implementation.
061:             *
062:             * @return the SSO session manager WS implementation.
063:             * @throws Exception
064:             */
065:            public org.josso.gateway.session.service.SSOSessionManager getSSOSessionManager()
066:                    throws Exception {
067:
068:                org.josso.gateway.session.service.ws.impl.SSOSessionManagerServiceLocator ssoManagerServiceLocator = new org.josso.gateway.session.service.ws.impl.SSOSessionManagerServiceLocator();
069:                org.josso.gateway.session.service.ws.impl.SSOSessionManager ssoSessionManagerWebservice;
070:
071:                String smEndpoint = getEndpointBase()
072:                        + "/services/SSOSessionManager";
073:
074:                logger.debug("Using SSOSessionManager endpoint '" + smEndpoint
075:                        + "'");
076:
077:                ssoManagerServiceLocator
078:                        .setSSOSessionManagerEndpointAddress(smEndpoint);
079:
080:                ssoSessionManagerWebservice = ssoManagerServiceLocator
081:                        .getSSOSessionManager();
082:
083:                WebserviceSSOSessionManager wsm = new WebserviceSSOSessionManager(
084:                        ssoSessionManagerWebservice);
085:
086:                ComponentKeeper ck = Lookup.getInstance().getComponentKeeper();
087:                if (ck instanceof  MBeanComponentKeeper) {
088:                    MBeanComponentKeeper mbeanCk = (MBeanComponentKeeper) ck;
089:                    mbeanCk.registerResource(mbeanCk.buildObjectName(wsm,
090:                            "WebserviceSSOSessionManager"), wsm);
091:                }
092:
093:                return wsm;
094:            }
095:
096:            /**
097:             * Locates the SSO Identity Manager Service Webservice implementation.
098:             *
099:             * @return the SSO session manager WS implementation.
100:             * @throws Exception
101:             */
102:            public org.josso.gateway.identity.service.SSOIdentityManager getSSOIdentityManager()
103:                    throws Exception {
104:                org.josso.gateway.identity.service.ws.impl.SSOIdentityManagerServiceLocator ssoIdentityManagerServiceLocator = new org.josso.gateway.identity.service.ws.impl.SSOIdentityManagerServiceLocator();
105:                org.josso.gateway.identity.service.ws.impl.SSOIdentityManager ssoIdentityManagerWebservice;
106:
107:                String imEndpoint = getEndpointBase()
108:                        + "/services/SSOIdentityManager";
109:
110:                logger.debug("Using SSOIdentityManager endpoint '" + imEndpoint
111:                        + "'");
112:
113:                ssoIdentityManagerServiceLocator
114:                        .setSSOIdentityManagerEndpointAddress(imEndpoint);
115:
116:                ssoIdentityManagerWebservice = ssoIdentityManagerServiceLocator
117:                        .getSSOIdentityManager();
118:
119:                org.josso.gateway.identity.service.ws.WebserviceSSOIdentityManager wim = new org.josso.gateway.identity.service.ws.WebserviceSSOIdentityManager(
120:                        ssoIdentityManagerWebservice);
121:
122:                ComponentKeeper ck = Lookup.getInstance().getComponentKeeper();
123:                if (ck instanceof  MBeanComponentKeeper) {
124:                    MBeanComponentKeeper mbeanCk = (MBeanComponentKeeper) ck;
125:                    mbeanCk.registerResource(mbeanCk.buildObjectName(wim,
126:                            "WebserviceSSOIdentityManager"), wim);
127:                }
128:
129:                return wim;
130:            }
131:
132:            /**
133:             * Locates the SSO Identity Provider Service Webservice implementation.
134:             *
135:             * @return the SSO identity provider manager WS implementation.
136:             * @throws Exception
137:             */
138:            public org.josso.gateway.identity.service.SSOIdentityProvider getSSOIdentityProvider()
139:                    throws Exception {
140:                org.josso.gateway.identity.service.ws.impl.SSOIdentityProviderServiceLocator ssoIdentityProviderServiceLocator = new org.josso.gateway.identity.service.ws.impl.SSOIdentityProviderServiceLocator();
141:                org.josso.gateway.identity.service.ws.impl.SSOIdentityProvider ssoIdentityProviderWebservice;
142:
143:                String ipEndpoint = getEndpointBase()
144:                        + "/services/SSOIdentityProvider";
145:
146:                logger.debug("Using SSOIdentityProvider endpoint '"
147:                        + ipEndpoint + "'");
148:
149:                ssoIdentityProviderServiceLocator
150:                        .setSSOIdentityProviderEndpointAddress(ipEndpoint);
151:
152:                ssoIdentityProviderWebservice = ssoIdentityProviderServiceLocator
153:                        .getSSOIdentityProvider();
154:
155:                org.josso.gateway.identity.service.ws.WebserviceSSOIdentityProvider wip = new org.josso.gateway.identity.service.ws.WebserviceSSOIdentityProvider(
156:                        ssoIdentityProviderWebservice);
157:
158:                ComponentKeeper ck = Lookup.getInstance().getComponentKeeper();
159:                if (ck instanceof  MBeanComponentKeeper) {
160:                    MBeanComponentKeeper mbeanCk = (MBeanComponentKeeper) ck;
161:                    mbeanCk.registerResource(mbeanCk.buildObjectName(wip,
162:                            "WebserviceSSOIdentityProvider"), wip);
163:                }
164:
165:                return wip;
166:            }
167:
168:            /**
169:             * Builds the endpoint base string.
170:             *
171:             * @return the endpoint base
172:             */
173:            private String getEndpointBase() {
174:                return (_transportSecurity
175:                        .equalsIgnoreCase(TRANSPORT_SECURITY_CONFIDENTIAL) ? "https"
176:                        : "http")
177:                        + "://"
178:                        + _endpoint
179:                        + "/"
180:                        + (_servicesWebContext != null ? _servicesWebContext
181:                                : "josso");
182:
183:            }
184:
185:            //----------------------------------------------------------------- Configuration Properties
186:
187:            /**
188:             * SOAP end point, e.g. localhost:8080
189:             */
190:            public void setEndpoint(String endpoint) {
191:                _endpoint = endpoint;
192:            }
193:
194:            /**
195:             * SOAP end point, e.g. localhost:8080
196:             */
197:            public String getEndpoint() {
198:                return _endpoint;
199:            }
200:
201:            /**
202:             * SOAP end point services web context, e.g. myjosso
203:             */
204:            public void setServicesWebContext(String servicesWebContext) {
205:                _servicesWebContext = servicesWebContext;
206:            }
207:
208:            /**
209:             * SOAP end point services web context, e.g. myjosso
210:             */
211:            public String getServicesWebContext() {
212:                return _servicesWebContext;
213:            }
214:
215:            /**
216:             * Set the username used to authenticate SOAP messages.
217:             *
218:             * @param username the username used to authenticate the SOAP message.
219:             */
220:            public void setUsername(String username) {
221:                WebserviceClientAuthentication.setUsername(username);
222:                _username = username;
223:            }
224:
225:            /**
226:             * Getter for username used to authenticate SOAP messages.
227:             */
228:            public String getUsername() {
229:                return _username;
230:            }
231:
232:            /**
233:             * Set the password used to authenticate SOAP messages.
234:             *
235:             * @param password the password used to authenticate the SOAP message.
236:             */
237:            public void setPassword(String password) {
238:                WebserviceClientAuthentication.setPassword(password);
239:            }
240:
241:            public String getPassword() {
242:                return "*";
243:            }
244:
245:            /**
246:             * Transport security used in SOAP messages, valid values are : none, confidential 
247:             * @param transportSecurity valid values are none, confidential
248:             */
249:            public void setTransportSecurity(String transportSecurity) {
250:                _transportSecurity = transportSecurity;
251:            }
252:
253:            /**
254:             * Transport security used in SOAP messages, valid values are : none|confidential
255:             */
256:            public String getTransportSecurity() {
257:                return _transportSecurity;
258:            }
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.