Source Code Cross Referenced for Secure.java in  » Net » QuickServer » org » quickserver » util » xmlreader » 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 » Net » QuickServer » org.quickserver.util.xmlreader 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * This file is part of the QuickServer library 
003:         * Copyright (C) 2003-2005 QuickServer.org
004:         *
005:         * Use, modification, copying and distribution of this software is subject to
006:         * the terms and conditions of the GNU Lesser General Public License. 
007:         * You should have received a copy of the GNU LGP License along with this 
008:         * library; if not, you can download a copy from <http://www.quickserver.org/>.
009:         *
010:         * For questions, suggestions, bug-reports, enhancement-requests etc.
011:         * visit http://www.quickserver.org
012:         *
013:         */
014:
015:        package org.quickserver.util.xmlreader;
016:
017:        import java.util.*;
018:
019:        /**
020:         * This class encapsulate the setting that help in configuring a secure socket
021:         * based QuickServer.
022:         * The example xml is <pre>
023:         ....
024:         &lt;secure&gt;
025:         &lt;enable&gt;true&lt;/enable&gt;
026:         &lt;load&gt;true&lt;/load&gt;
027:         &lt;port&gt;&lt;/port&gt;
028:         &lt;protocol&gt;TLS&lt;/protocol&gt;
029:         &lt;client-auth-enable&gt;false&lt;/client-auth-enable&gt; 
030:         &lt;secure-store&gt;
031:         ....
032:         &lt;/secure-store&gt;
033:         &lt;/secure&gt;
034:         ....
035:         </pre>
036:         * @see TrustStoreInfo
037:         * @see KeyStoreInfo
038:         * @see SecureStore
039:         * @author Akshathkumar Shetty
040:         * @since 1.4
041:         */
042:        public class Secure implements  java.io.Serializable {
043:            private boolean enable = false;
044:            private boolean load = false;
045:            private int port = -1; //will use servers port
046:            private String protocol = "TLS";
047:            private boolean clientAuthEnable = false;
048:            private SecureStore secureStore = new SecureStore();
049:
050:            /**
051:             * Sets the Secure enable flag.
052:             * If not set, it will use <code>false</code><br/>
053:             * XML Tag: &lt;secure&gt;&lt;enable&gt;true&lt;/enable&gt;&lt;/secure&gt;
054:             * Allowed values = <code>true</code> | <code>false</code>
055:             * If enable is set to <code>true</code> load is also set to <code>true</code>.
056:             * @see #getEnable
057:             */
058:            public void setEnable(boolean enable) {
059:                this .enable = enable;
060:                if (enable == true) {
061:                    setLoad(true);
062:                }
063:            }
064:
065:            /**
066:             * Returns the Secure enable flag.
067:             * @see #setEnable
068:             */
069:            public boolean getEnable() {
070:                return enable;
071:            }
072:
073:            /**
074:             * Returns the Secure enable flag.
075:             */
076:            public boolean isEnable() {
077:                return enable;
078:            }
079:
080:            /**
081:             * Sets the load flag for SSLContext.
082:             * If not set, it will use <code>false</code><br/>
083:             * XML Tag: &lt;Secure&gt;&lt;load&gt;true&lt;/load&gt;&lt;/Secure&gt;
084:             * Allowed values = <code>true</code> | <code>false</code>
085:             * @see #getLoad
086:             */
087:            public void setLoad(boolean load) {
088:                this .load = load;
089:            }
090:
091:            /**
092:             * Returns the load flag for SSLContext.
093:             * @see #setLoad
094:             */
095:            public boolean getLoad() {
096:                return load;
097:            }
098:
099:            /**
100:             * Returns the load flag for SSLContext.
101:             */
102:            public boolean isLoad() {
103:                return load;
104:            }
105:
106:            /**
107:             * Sets the port for the QuickServer to listen on in secure mode.
108:             * If not set, it will run on servers non secure port<br/>
109:             * XML Tag: &lt;port&gt;&lt;/port&gt;
110:             * @param port to listen on.
111:             * @see #getPort
112:             */
113:            public void setPort(int port) {
114:                if (port >= 0)
115:                    this .port = port;
116:            }
117:
118:            /**
119:             * Returns the port for the QuickServer to listen on in secure mode.
120:             * @see #setPort
121:             */
122:            public int getPort() {
123:                return port;
124:            }
125:
126:            /**
127:             * Sets the protocol for the QuickServer to listen on in secure mode.
128:             * If not set, it will use <code>TLS</code><br/>
129:             * XML Tag: &lt;protocol&gt;TLS&lt;/protocol&gt;
130:             * @param protocol to listen on in secure mode.
131:             * @see #getProtocol
132:             */
133:            public void setProtocol(String protocol) {
134:                if (protocol != null && protocol.trim().length() != 0)
135:                    this .protocol = protocol;
136:            }
137:
138:            /**
139:             * Returns the protocol for the QuickServer to listen on in secure mode.
140:             * @see #setProtocol
141:             */
142:            public String getProtocol() {
143:                return protocol;
144:            }
145:
146:            /**
147:             * Sets whether the connections which are accepted must include 
148:             * successful client authentication.
149:             * If not set, it will use <code>false</code><br/>
150:             * XML Tag: &lt;client-auth-enable&gt;false&lt;/client-auth-enable&gt;
151:             * @param enable client authentication enable flag
152:             * @see #getClientAuthEnable
153:             */
154:            public void setClientAuthEnable(boolean enable) {
155:                this .clientAuthEnable = enable;
156:            }
157:
158:            /**
159:             * Returns whether the connections which are accepted must include 
160:             * successful client authentication.
161:             * @see #setClientAuthEnable
162:             */
163:            public boolean getClientAuthEnable() {
164:                return clientAuthEnable;
165:            }
166:
167:            /**
168:             * Returns whether the connections which are accepted must include 
169:             * successful client authentication.
170:             */
171:            public boolean isClientAuthEnable() {
172:                return clientAuthEnable;
173:            }
174:
175:            /**
176:             * Sets SecureStore information
177:             * XML Tag: &lt;secure-store&gt;&lt;/secure-store&gt;
178:             * @param secureStore SecureStore information
179:             * @see #getSecureStore
180:             */
181:            public void setSecureStore(SecureStore secureStore) {
182:                if (secureStore != null)
183:                    this .secureStore = secureStore;
184:            }
185:
186:            /**
187:             * Returns SecureStore information.
188:             * @see #setSecureStore
189:             */
190:            public SecureStore getSecureStore() {
191:                return secureStore;
192:            }
193:
194:            /**
195:             * Returns XML config of this class.
196:             */
197:            public String toXML(String pad) {
198:                if (pad == null)
199:                    pad = "";
200:                StringBuffer sb = new StringBuffer();
201:                sb.append(pad + "<secure>\n");
202:                sb.append(pad + "\t<enable>" + getEnable() + "</enable>\n");
203:                sb.append(pad + "\t<load>" + getLoad() + "</load>\n");
204:                if (getPort() != -1)
205:                    sb.append(pad + "\t<port>" + getPort() + "</port>\n");
206:                sb.append(pad + "\t<protocol>" + getProtocol()
207:                        + "</protocol>\n");
208:                sb.append(pad + "\t<client-auth-enable>"
209:                        + getClientAuthEnable() + "</client-auth-enable>\n");
210:                if (getSecureStore() != null) {
211:                    sb.append(getSecureStore().toXML(pad + "\t"));
212:                }
213:                sb.append(pad + "</secure>\n");
214:                return sb.toString();
215:            }
216:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.