Source Code Cross Referenced for SecurityServiceConfigMBeanImpl.java in  » ESB » open-esb » com » sun » jbi » internal » security » mbeans » 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 » ESB » open esb » com.sun.jbi.internal.security.mbeans 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * BEGIN_HEADER - DO NOT EDIT
003:         *
004:         * The contents of this file are subject to the terms
005:         * of the Common Development and Distribution License
006:         * (the "License").  You may not use this file except
007:         * in compliance with the License.
008:         *
009:         * You can obtain a copy of the license at
010:         * https://open-esb.dev.java.net/public/CDDLv1.0.html.
011:         * See the License for the specific language governing
012:         * permissions and limitations under the License.
013:         *
014:         * When distributing Covered Code, include this CDDL
015:         * HEADER in each file and include the License file at
016:         * https://open-esb.dev.java.net/public/CDDLv1.0.html.
017:         * If applicable add the following below this CDDL HEADER,
018:         * with the fields enclosed by brackets "[]" replaced with
019:         * your own identifying information: Portions Copyright
020:         * [year] [name of copyright owner]
021:         */
022:
023:        /*
024:         * @(#)SecurityServiceConfigMBeanImpl.java
025:         * Copyright 2004-2007 Sun Microsystems, Inc. All Rights Reserved.
026:         *
027:         * END_HEADER - DO NOT EDIT
028:         */
029:        /**
030:         *  SecurityServiceConfigMBeanImpl.java
031:         *
032:         *  SUN PROPRIETARY/CONFIDENTIAL.
033:         *  This software is the proprietary information of Sun Microsystems, Inc.
034:         *  Use is subject to license terms.
035:         *
036:         *  Created on December 16, 2004, 1:45 PM
037:         */package com.sun.jbi.internal.security.mbeans;
038:
039:        import com.sun.jbi.StringTranslator;
040:        import com.sun.jbi.management.common.GenericConfigurationMBean;
041:
042:        import com.sun.jbi.internal.security.Constants;
043:        import com.sun.jbi.internal.security.config.SecurityInstallConfig;
044:
045:        /**
046:         * This MBean interface extends the Configuration MBean interface for the
047:         * Security Service installation configuration.
048:         *
049:         * @author Sun Microsystems, Inc.
050:         */
051:        public class SecurityServiceConfigMBeanImpl implements 
052:                SecurityServiceConfigMBean {
053:
054:            /**
055:             * The Environment Context.
056:             */
057:            private com.sun.jbi.EnvironmentContext mEnvCtx;
058:
059:            /**
060:             * The Installation time security configuration. 
061:             */
062:            private SecurityInstallConfig mSecInstCfg;
063:
064:            /**
065:             * The String Translator.
066:             */
067:            private StringTranslator mTranslator;
068:
069:            /**
070:             * Why is the Logger in ModelSystemService Private ?
071:             */
072:            //private Logger mLogger;
073:            /** 
074:             * Basic Configuration MBean to delegate the basic tasks to.
075:             */
076:            private GenericConfigurationMBean mConfigMBean;
077:
078:            /**
079:             *
080:             * @param aContext is the Environment Context.
081:             * @param configMBean is an instance of the GenericConfigurationMBean to 
082:             * delegate the basic tasks to.
083:             * @throws javax.jbi.JBIException one errors
084:             */
085:            public SecurityServiceConfigMBeanImpl(
086:                    GenericConfigurationMBean configMBean,
087:                    com.sun.jbi.EnvironmentContext aContext)
088:                    throws javax.jbi.JBIException {
089:                mEnvCtx = aContext;
090:                mTranslator = mEnvCtx.getStringTranslator(Constants.PACKAGE);
091:                mConfigMBean = configMBean;
092:                mSecInstCfg = SecurityInstallConfig
093:                        .createSecurityInstallConfig(mConfigMBean, mTranslator);
094:            }
095:
096:            /*-------------------------------------------------------------------------------*\
097:             *                           User Domain Operations                              *
098:            \*-------------------------------------------------------------------------------*/
099:
100:            /**
101:             * @param defUserDomain is the default User Domain.
102:             */
103:            public void setDefaultUserDomainName(String defUserDomain) {
104:                mSecInstCfg.setDefaultUserDomainName(defUserDomain);
105:            }
106:
107:            /**
108:             * @return the default User Domain name.
109:             */
110:            public String getDefaultUserDomainName() {
111:                return mSecInstCfg.getDefaultUserDomainName();
112:            }
113:
114:            /**
115:             * Add a new User Domain. If a User Domain by the specified name exists, it is
116:             * overwritten with the new one.
117:             *
118:             * @param name of the domain.
119:             * @param domain is the implementation class that implements the UserDomain interface.
120:             */
121:            public void addUserDomain(String name, String domain) {
122:                mSecInstCfg.addUserDomain(name, domain);
123:            }
124:
125:            /**
126:             * Remove a User Domain. 
127:             *
128:             * @param name of the domain.
129:             */
130:            public void removeUserDomain(String name) {
131:                mSecInstCfg.removeUserDomain(name);
132:            }
133:
134:            /**
135:             * Add a parameter to a User Domain, if the domain does not exist, the parameter is
136:             * not added.
137:             *
138:             * @param domain name of the UserDomain.
139:             * @param name is the name of the parameter.
140:             * @param value is the value for the parameter.
141:             */
142:            public void addParameterToUserDomain(String domain, String name,
143:                    String value) {
144:                mSecInstCfg.addParameterToUserDomain(domain, name, value);
145:            }
146:
147:            /**
148:             * Remove a parameter to a User Domain.
149:             *
150:             * @param domain name of the UserDomain.
151:             * @param name is the name of the parameter.
152:             */
153:            public void removeParameterFromUserDomain(String domain, String name) {
154:                mSecInstCfg.removeParameterFromUserDomain(domain, name);
155:            }
156:
157:            /*-------------------------------------------------------------------------------*\
158:             *                           KeyStore Manager Operations                         *
159:            \*-------------------------------------------------------------------------------*/
160:
161:            /**
162:             * @param defKSMgr is the default KeyStore Manager.
163:             */
164:            public void setDefaultKeyStoreManagerName(String defKSMgr) {
165:                mSecInstCfg.setDefaultKeyStoreManagerName(defKSMgr);
166:            }
167:
168:            /**
169:             * @return the default KeyStore Manager.
170:             */
171:            public String getDefaultKeyStoreManagerName() {
172:                return mSecInstCfg.getDefaultKeyStoreManagerName();
173:            }
174:
175:            /**
176:             * Add a new KeyStore Manager. If a KeyStoreManager by the specified name exists,
177:             * it is overwritten with the new one.
178:             *
179:             * @param name of the manager.
180:             * @param manager is the implementation class that implements the KeyStoreManager
181:             * interface.
182:             */
183:            public void addKeyStoreManager(String name, String manager) {
184:                mSecInstCfg.addKeyStoreManager(name, manager);
185:            }
186:
187:            /**
188:             * Remove a KeyStore Manager.
189:             *
190:             * @param name of the manager.
191:             */
192:            public void removeKeyStoreManager(String name) {
193:                mSecInstCfg.removeKeyStoreManager(name);
194:            }
195:
196:            /**
197:             * Add a parameter to a KeyStoreManager, if it does not exist, the parameter is
198:             * not added.
199:             *
200:             * @param manager is the name of the KeyStoreManager.
201:             * @param name is the name of the parameter.
202:             * @param value is the value for the parameter.
203:             */
204:            public void addParameterToKeyStoreManager(String manager,
205:                    String name, String value) {
206:                mSecInstCfg.addParameterToKeyStoreManager(manager, name, value);
207:            }
208:
209:            /**
210:             * Remove a parameter from the KeyStoreManager.
211:             *
212:             * @param manager is the name of the KeyStoreManager.
213:             * @param name is the name of the parameter.
214:             */
215:            public void removeParameterFromKeyStoreManager(String manager,
216:                    String name) {
217:                mSecInstCfg.removeParameterFromKeyStoreManager(manager, name);
218:            }
219:
220:            /*-------------------------------------------------------------------------------*\
221:             *                           Security Context Operations                         *
222:            \*-------------------------------------------------------------------------------*/
223:
224:            /**
225:             * Set the Client Alias from the TransportSecurity Context.
226:             * @param alias is the SSL Client alias.
227:             */
228:            public void setSSLClientAlias(String alias) {
229:                mSecInstCfg.setSSLClientAlias(alias);
230:            }
231:
232:            /**
233:             * Get the Client Alias from the TransportSecurity Context.
234:             * @return the SSL Client alias.
235:             */
236:            public String getSSLClientAlias() {
237:                return mSecInstCfg.getSSLClientAlias();
238:            }
239:
240:            /**
241:             * Set Client Alias from the TransportSecurity Context.
242:             *
243:             * @param protocol is the SSL Client protocol, allowed values are SSLv3, TLS and TLSv1
244:             */
245:            public void setSSLClientProtocol(String protocol) {
246:                mSecInstCfg.setSSLClientProtocol(protocol);
247:            }
248:
249:            /**
250:             * Get the Client SSL Protocol  from the TransportSecurity Context.
251:             *
252:             * @return the SSL Client Protocol.
253:             */
254:            public String getSSLClientProtocol() {
255:                return mSecInstCfg.getSSLClientProtocol();
256:            }
257:
258:            /**
259:             * Set the SSL Client Use Default parameter.
260:             *
261:             * @param flag - true/false inducates whether to use the
262:             * default Application Server SSL context or not.
263:             */
264:            public void setSSLClientUseDefault(boolean flag) {
265:                mSecInstCfg.setSSLClientUseDefault(flag);
266:            }
267:
268:            /**
269:             * Get the SSL Client Use Default parameter.
270:             *
271:             * @return true/false inducates whether the
272:             * default Application Server SSL context is being used or not.
273:             */
274:            public boolean getSSLClientUseDefault() {
275:                return mSecInstCfg.getSSLClientUseDefault();
276:            }
277:
278:            /**
279:             * Set the SSL Server Req. Client Auth flag.
280:             *
281:             * @param flag - true/false inducates whether Client Auth 
282:             * is required by default.
283:             */
284:            public void setSSLServerRequireClientAuth(boolean flag) {
285:                mSecInstCfg.setSSLServerRequireClientAuth(flag);
286:            }
287:
288:            /**
289:             * Get the SSL Server Req. Client Auth flag.
290:             *
291:             * @return true/false inducates whether Client Auth 
292:             * is required by default.
293:             */
294:            public boolean getSSLServerRequireClientAuth() {
295:                return mSecInstCfg.getSSLServerRequireClientAuth();
296:            }
297:
298:            /**
299:             *                      GenericConfigurationMBean Methods
300:             */
301:
302:            /**
303:             * Restore the configuration from persistent storage.
304:             * @return 0 if successful.
305:             */
306:            public int restore() {
307:                try {
308:                    mConfigMBean.restore();
309:                    mSecInstCfg = SecurityInstallConfig
310:                            .createSecurityInstallConfig(mConfigMBean,
311:                                    mTranslator);
312:                } catch (Exception ex) {
313:                    // Log the Exception
314:                    return 1;
315:                }
316:                return 0;
317:            }
318:
319:            /**
320:             * Save the configuration to persistent storage.
321:             * @return 0 if successful.
322:             */
323:            public int save() {
324:                try {
325:                    mSecInstCfg.updateConfigMBean(mConfigMBean);
326:                    mConfigMBean.save();
327:                } catch (Exception ex) {
328:                    // Log the Exception
329:                    //ex.printStackTrace();
330:                    return 1;
331:                }
332:                return 0;
333:            }
334:
335:            /**
336:             * Apply the current configuration.
337:             * Components that need to restart when the configurartion is
338:             * applied will need to override this method.
339:             *
340:             * @return 0 if successful.
341:             */
342:            public int apply() {
343:                return 0;
344:            }
345:
346:            /**
347:             * Set a configuration property for this component.
348:             * @param aKey the property key
349:             * @param aValue the property value
350:             * @return 0 if successful.
351:             */
352:            public int setProperty(String aKey, String aValue) {
353:                return 0;
354:            }
355:
356:            /**
357:             * Get a configuration property for this component.
358:             * @param aKey the property key to retrieve.
359:             * @return the value of the key or null
360:             */
361:            public String getProperty(String aKey) {
362:                mSecInstCfg.updateConfigMBean(mConfigMBean);
363:                return mConfigMBean.getProperty(aKey);
364:            }
365:
366:            /**
367:             * Get all configuration properties for this component.
368:             * @return an array containing the property keys.
369:             */
370:            public String[] getPropertyKeys() {
371:                mSecInstCfg.updateConfigMBean(mConfigMBean);
372:                return mConfigMBean.getPropertyKeys();
373:            }
374:
375:            /**
376:             * Delete a configuration property for this component.
377:             * @param aKey the property key to delete
378:             * @return zero if successful, otherwise non-zero.
379:             */
380:            public int clearProperty(String aKey) {
381:                return 0;
382:            }
383:
384:            /**
385:             * Delete all configuration properties for this component.
386:             * @return zero if successful, otherwise non-zero.
387:             */
388:            public int clearPropertyKeys() {
389:                return 0;
390:            }
391:
392:            /*-------------------------------------------------------------------------------*\
393:             *         Operations to display Configuration information                       *
394:            \*-------------------------------------------------------------------------------*/
395:
396:            /**
397:             * Get an XML String which has the meta-data for a particular user domain
398:             * User Domain.
399:             *
400:             * @param name is the logical name of the UserDomain. If there is no such UserDomain
401:             * or the name is null then a empty string "" is returned.
402:             * @return an XML String with information for a particular UserDomain.
403:             */
404:            public String getUserDomain(String name) {
405:                return mSecInstCfg.getUserDomainCtx(name);
406:            }
407:
408:            /**
409:             * Get an XML String listing all the UserDomains and their meta-data.
410:             *
411:             * @return an XML String with information for all the UserDomains.
412:             */
413:            public String getUserDomains() {
414:                return mSecInstCfg.getUserDomainCtxs();
415:            }
416:
417:            /**
418:             * Get an XML String which has the meta-data for a particular key store manager.
419:             *
420:             * @param name is the logical name of the KeyStoreManager. If there is no such 
421:             * KeyStoreManager or the name is null then a empty string "" is returned.
422:             * @return an XML String with information for a particular KeyStoreManager.
423:             */
424:            public String getKeyStoreManager(String name) {
425:                return mSecInstCfg.getKeyStoreCtx(name);
426:            }
427:
428:            /**
429:             * Get an XML String listing all the KeyStoreManagers and their meta-data.
430:             *
431:             * @return an XML String with information for all the KeyStoreManagers.
432:             */
433:            public String getKeyStoreManagers() {
434:                return mSecInstCfg.getKeyStoreCtxs();
435:            }
436:
437:            /**
438:             * Get an XML String which has the meta-data for the Transport Security Context.
439:             *
440:             * @return an XML String with information for the Transport Security Context.
441:             */
442:            public String getTransportSecurityConfig() {
443:                return mSecInstCfg.getTransportSecurityConfig();
444:            }
445:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.