Source Code Cross Referenced for SSLConfiguration.java in  » Database-JDBC-Connection-Pool » sequoia-2.10.9 » org » continuent » sequoia » common » net » 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 » Database JDBC Connection Pool » sequoia 2.10.9 » org.continuent.sequoia.common.net 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /**
002:         * Sequoia: Database clustering technology.
003:         * Copyright (C) 2002-2004 French National Institute For Research In Computer
004:         * Science And Control (INRIA).
005:         * Copyright (C) 2005 AmicoSoft, Inc. dba Emic Networks
006:         * Contact: sequoia@continuent.org
007:         * 
008:         * Licensed under the Apache License, Version 2.0 (the "License");
009:         * you may not use this file except in compliance with the License.
010:         * You may obtain a copy of the License at
011:         * 
012:         * http://www.apache.org/licenses/LICENSE-2.0
013:         * 
014:         * Unless required by applicable law or agreed to in writing, software
015:         * distributed under the License is distributed on an "AS IS" BASIS,
016:         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
017:         * See the License for the specific language governing permissions and
018:         * limitations under the License. 
019:         *
020:         * Initial developer(s): Marc Wick.
021:         * Contributor(s): ______________________.
022:         */package org.continuent.sequoia.common.net;
023:
024:        import java.io.File;
025:        import java.io.Serializable;
026:
027:        /**
028:         * This class defines a SSLConfiguration
029:         * 
030:         * @author <a href="mailto:marc.wick@monte-bre.ch">Marc Wick </a>
031:         * @version 1.0
032:         */
033:        public class SSLConfiguration implements  Serializable {
034:            private static final long serialVersionUID = -7030030045041996566L;
035:
036:            /** kestore file */
037:            private File keyStore;
038:            /** keystore password */
039:            private String keyStorePassword;
040:            /** key password */
041:            private String keyStoreKeyPassword;
042:
043:            // TODO : provide support for naming aliases
044:
045:            /** need client authentication */
046:            private boolean isClientAuthenticationRequired = false;
047:
048:            /** truststore file */
049:            private File trustStore;
050:            /** truststore password */
051:            private String trustStorePassword;
052:
053:            /**
054:             * Returns the isClientAuthenticationRequired value.
055:             * 
056:             * @return Returns the isClientAuthenticationRequired.
057:             */
058:            public boolean isClientAuthenticationRequired() {
059:                return isClientAuthenticationRequired;
060:            }
061:
062:            /**
063:             * Sets the isClientAuthenticationRequired value.
064:             * 
065:             * @param isClientAuthenticationRequired The isClientAuthenticationRequired to
066:             *          set.
067:             */
068:            public void setClientAuthenticationRequired(
069:                    boolean isClientAuthenticationRequired) {
070:                this .isClientAuthenticationRequired = isClientAuthenticationRequired;
071:            }
072:
073:            /**
074:             * Returns the keyStore value.
075:             * 
076:             * @return Returns the keyStore.
077:             */
078:            public File getKeyStore() {
079:                return keyStore;
080:            }
081:
082:            /**
083:             * Sets the keyStore value.
084:             * 
085:             * @param keyStore The keyStore to set.
086:             */
087:            public void setKeyStore(File keyStore) {
088:                this .keyStore = keyStore;
089:            }
090:
091:            /**
092:             * Returns the keyStoreKeyPassword value.
093:             * 
094:             * @return Returns the keyStoreKeyPassword.
095:             */
096:            public String getKeyStoreKeyPassword() {
097:                if (keyStoreKeyPassword != null)
098:                    return keyStoreKeyPassword;
099:                return getKeyStorePassword();
100:            }
101:
102:            /**
103:             * Sets the keyStoreKeyPassword value.
104:             * 
105:             * @param keyStoreKeyPassword The keyStoreKeyPassword to set.
106:             */
107:            public void setKeyStoreKeyPassword(String keyStoreKeyPassword) {
108:                this .keyStoreKeyPassword = keyStoreKeyPassword;
109:            }
110:
111:            /**
112:             * Returns the keyStorePassword value.
113:             * 
114:             * @return Returns the keyStorePassword.
115:             */
116:            public String getKeyStorePassword() {
117:                return keyStorePassword;
118:            }
119:
120:            /**
121:             * Sets the keyStorePassword value.
122:             * 
123:             * @param keyStorePassword The keyStorePassword to set.
124:             */
125:            public void setKeyStorePassword(String keyStorePassword) {
126:                this .keyStorePassword = keyStorePassword;
127:            }
128:
129:            /**
130:             * Returns the trustStore value.
131:             * 
132:             * @return Returns the trustStore.
133:             */
134:            public File getTrustStore() {
135:                if (trustStore != null)
136:                    return trustStore;
137:
138:                return getKeyStore();
139:            }
140:
141:            /**
142:             * Sets the trustStore value.
143:             * 
144:             * @param trustStore The trustStore to set.
145:             */
146:            public void setTrustStore(File trustStore) {
147:                this .trustStore = trustStore;
148:            }
149:
150:            /**
151:             * Returns the trustStorePassword value.
152:             * 
153:             * @return Returns the trustStorePassword.
154:             */
155:            public String getTrustStorePassword() {
156:                if (trustStorePassword != null)
157:                    return trustStorePassword;
158:
159:                return getKeyStorePassword();
160:            }
161:
162:            /**
163:             * Sets the trustStorePassword value.
164:             * 
165:             * @param trustStorePassword The trustStorePassword to set.
166:             */
167:            public void setTrustStorePassword(String trustStorePassword) {
168:                this .trustStorePassword = trustStorePassword;
169:            }
170:
171:            /**
172:             * create a SSLConfiguration with the java default behaviour (using System
173:             * properties)
174:             * 
175:             * @return config
176:             */
177:            public static SSLConfiguration getDefaultConfig() {
178:                SSLConfiguration config = new SSLConfiguration();
179:                String keyStoreProperty = System
180:                        .getProperty("javax.net.ssl.keyStore");
181:                if (keyStoreProperty == null)
182:                    throw new RuntimeException(
183:                            "javax.net.ssl.keyStore has not been properly defined");
184:                config.keyStore = new File(keyStoreProperty);
185:
186:                config.keyStorePassword = System
187:                        .getProperty("javax.net.ssl.keyStorePassword");
188:                if (config.keyStorePassword == null)
189:                    throw new RuntimeException(
190:                            "javax.net.ssl.keyStorePassword has not been properly defined");
191:
192:                config.keyStoreKeyPassword = System
193:                        .getProperty("javax.net.ssl.keyStoreKeyPassword");
194:                if (config.keyStoreKeyPassword == null)
195:                    config.keyStoreKeyPassword = config.keyStorePassword;
196:
197:                String trustStoreProperty = System
198:                        .getProperty("javax.net.ssl.trustStore");
199:                if (trustStoreProperty == null)
200:                    trustStoreProperty = keyStoreProperty;
201:                config.trustStore = new File(trustStoreProperty);
202:
203:                config.trustStorePassword = System
204:                        .getProperty("javax.net.ssl.trustStorePassword");
205:                if (config.trustStorePassword == null)
206:                    config.trustStorePassword = config.keyStorePassword;
207:                return config;
208:            }
209:
210:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.