Source Code Cross Referenced for SecurityConfigImpl.java in  » ESB » open-esb » com » sun » jbi » internal » security » https » jregress » 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.https.jregress 
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:         * @(#)SecurityConfigImpl.java
025:         * Copyright 2004-2007 Sun Microsystems, Inc. All Rights Reserved.
026:         *
027:         * END_HEADER - DO NOT EDIT
028:         */
029:        /**
030:         *  SecurityConfigImpl.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 October 26, 2004, 6:40 PM
037:         */package com.sun.jbi.internal.security.https.jregress;
038:
039:        import com.sun.jbi.internal.security.config.SecurityConfiguration;
040:        import com.sun.jbi.internal.security.ContextImpl;
041:        import com.sun.jbi.internal.security.Constants;
042:
043:        import java.util.HashMap;
044:        import java.util.Properties;
045:
046:        /**
047:         *
048:         * @author Sun Microsystems, Inc.
049:         */
050:        public class SecurityConfigImpl implements  SecurityConfiguration {
051:
052:            /** The Default Security Configuration */
053:            private String mDefaultConfigName;
054:
055:            /** The Security Context Map */
056:            private Properties mSecurityContext;
057:
058:            /** The Default User Domain */
059:            private String mDefaultUserDomain;
060:
061:            /** The User Domain Map */
062:            private HashMap mUserDomains;
063:
064:            /** The Default KeyStore Manager */
065:            private String mDefaultKeyStoreManager;
066:
067:            /** The Key Store Manager Map */
068:            private HashMap mKeyStoreMgrCtxs;
069:
070:            /** My Instance.*/
071:            private static SecurityConfigImpl mInstance = null;
072:
073:            /** Hide Constructor. */
074:            private SecurityConfigImpl() {
075:                // -- This constructor is never called.
076:            };
077:
078:            /**
079:             * Constructor.
080:             */
081:            private SecurityConfigImpl(String userFileName,
082:                    String userFileName2, String keystorebase,
083:                    com.sun.jbi.StringTranslator translator) {
084:                mKeyStoreMgrCtxs = new HashMap();
085:                mUserDomains = new HashMap();
086:
087:                mDefaultKeyStoreManager = "server";
088:                mDefaultConfigName = "default";
089:
090:                initUserDomains(userFileName, userFileName2);
091:                initSecurityContexts(keystorebase);
092:                initKeyStoreManagers(keystorebase);
093:            }
094:
095:            /**
096:             * A single shared user domain
097:             */
098:            private void initUserDomains(String userFile, String userFile2) {
099:                Properties[] udProps = new Properties[2];
100:
101:                udProps[0] = new Properties();
102:
103:                udProps[0].setProperty(Constants.DOMAIN, "JAAS");
104:                udProps[0].setProperty(Constants.PARAM_FILE_NAME, userFile);
105:                mUserDomains.put("file", udProps[0]);
106:
107:                udProps[1] = new Properties();
108:                udProps[1].setProperty(Constants.DOMAIN, "JAAS");
109:                udProps[1].setProperty(Constants.PARAM_FILE_NAME, userFile2);
110:                mUserDomains.put("file2", udProps[1]);
111:
112:            }
113:
114:            /**
115:             * A Single Security Context will be created.
116:             */
117:            private void initSecurityContexts(String keystorebase) {
118:
119:                mSecurityContext = new Properties();
120:
121:            }
122:
123:            /**
124:             * Two KeyStoreManagers are created "server" and "client" for testing purposes.
125:             */
126:            private void initKeyStoreManagers(String ksbase) {
127:
128:                SecurityContextInfo info = new SecurityContextInfo(ksbase);
129:
130:                Properties serverKSMgr = new Properties();
131:                serverKSMgr.setProperty(Constants.MANAGER, "JavaStandard");
132:
133:                serverKSMgr.setProperty(Constants.PARAM_KEYSTORE_LOCATION, info
134:                        .getServerKeyStoreURL());
135:                serverKSMgr.setProperty(Constants.PARAM_KEYSTORE_TYPE, info
136:                        .getServerKeyStoreType());
137:                serverKSMgr.setProperty(Constants.PARAM_KEYSTORE_PASS, info
138:                        .getClientKeyStorePassword());
139:
140:                serverKSMgr.setProperty(Constants.PARAM_TRUSTSTORE_LOCATION,
141:                        info.getServerTrustStoreURL());
142:                serverKSMgr.setProperty(Constants.PARAM_TRUSTSTORE_TYPE, info
143:                        .getServerTrustStoreType());
144:                serverKSMgr.setProperty(Constants.PARAM_TRUSTSTORE_PASS, info
145:                        .getServerTrustStorePassword());
146:                mKeyStoreMgrCtxs.put("server", serverKSMgr);
147:
148:                Properties clientKSMgr = new Properties();
149:                clientKSMgr.setProperty(Constants.MANAGER, "JavaStandard");
150:                clientKSMgr.setProperty(Constants.PARAM_KEYSTORE_LOCATION, info
151:                        .getClientKeyStoreURL());
152:                clientKSMgr.setProperty(Constants.PARAM_KEYSTORE_TYPE, info
153:                        .getClientKeyStoreType());
154:                clientKSMgr.setProperty(Constants.PARAM_KEYSTORE_PASS, info
155:                        .getClientKeyStorePassword());
156:
157:                clientKSMgr.setProperty(Constants.PARAM_TRUSTSTORE_LOCATION,
158:                        info.getClientTrustStoreURL());
159:                clientKSMgr.setProperty(Constants.PARAM_TRUSTSTORE_TYPE, info
160:                        .getClientTrustStoreType());
161:                clientKSMgr.setProperty(Constants.PARAM_TRUSTSTORE_PASS, info
162:                        .getClientTrustStorePassword());
163:                mKeyStoreMgrCtxs.put("client", clientKSMgr);
164:            }
165:
166:            /**
167:             *  Get a Map Security Contexts, keyed by their name
168:             *  [ Key = Name (String) : Value = SecurityContext (Context) ]
169:             *
170:             * @return the HashMap which has the mappings
171:             */
172:            public Properties getTransportSecurityContext() {
173:                return mSecurityContext;
174:            }
175:
176:            /**
177:             * Get the Name of the default Configuration name
178:             *
179:             * @param name is the Name of the default configuration
180:             */
181:            public void setDefaultConfigName(String name) {
182:                mDefaultConfigName = name;
183:            }
184:
185:            /**
186:             * Get the Name of the default User Domain
187:             *
188:             * @return the name of the Default User Domain
189:             */
190:            public String getDefaultUserDomainName() {
191:                return mDefaultUserDomain;
192:            }
193:
194:            /**
195:             * Get a Map of User Domain Contexts by their name
196:             * [ Key = Name (string) : Value = UserDomain Contexts (Properties) ]
197:             *
198:             * @return a map of the User Domain Contexts
199:             */
200:            public HashMap getUserDomainContexts() {
201:                return mUserDomains;
202:            }
203:
204:            /**
205:             * Get the Name of the default KeyStore Service
206:             *
207:             * @return the name of the default KeyStore.
208:             */
209:            public String getDefaultKeyStoreManagerName() {
210:                return mDefaultKeyStoreManager;
211:            }
212:
213:            /**
214:             * Get a Map of KeyStore Services keyed by their name
215:             * [ Key = Name (string) : Value = KeyStoreContexts (Properties) ]
216:             *
217:             * @return a map of the Key Store Contexts
218:             */
219:            public HashMap getKeyStoreContexts() {
220:                return mKeyStoreMgrCtxs;
221:            }
222:
223:            /**
224:             * Set the Name of the default User Domain
225:             *
226:             * @param name is the name of the Default User Domain
227:             */
228:            public void setDefaultUserDomainName(String name) {
229:                mDefaultUserDomain = name;
230:            }
231:
232:            /**
233:             * Set the Map of User Domain Contexts by their name.
234:             * [ Key = Name (string) : Value = UserDomain Contexts (Properties) ]
235:             *
236:             * @param map is the UserDomain map
237:             */
238:            public void setUserDomainContexts(HashMap map) {
239:                mUserDomains = map;
240:            }
241:
242:            /**
243:             * Set the Map of the default KeyStore Service.
244:             *
245:             * @param name is the name of the default KeyStore.
246:             */
247:            public void setDefaultKeyStoreManagerName(String name) {
248:                mDefaultKeyStoreManager = name;
249:            }
250:
251:            /**
252:             * Set the Map of KeyStore Services keyed by their name
253:             * [ Key = Name (string) : Value = KeyStoreContexts (Properties) ]
254:             *
255:             * @param map the KS Manager Context
256:             */
257:            public void setKeyStoreContexts(HashMap map) {
258:                mKeyStoreMgrCtxs = map;
259:            }
260:
261:            /**
262:             * Create a test installation security configuration
263:             */
264:            public static SecurityConfiguration getTestSecurityConfiguration(
265:                    String userFileName, String userFileName2,
266:                    String keystorebase, com.sun.jbi.StringTranslator translator) {
267:                if (mInstance == null) {
268:                    mInstance = new SecurityConfigImpl(userFileName,
269:                            userFileName2, keystorebase, translator);
270:                }
271:                return mInstance;
272:            }
273:
274:            /**
275:             *
276:             * Not used by the Tests.
277:             * @return null, method not used.
278:             */
279:            public org.w3c.dom.Document generateDocument() {
280:                return null;
281:            }
282:        }
w___w_w__._j_a___v___a__2___s_.___c__om_ | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.