KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > config > clientbeans > Security


1 /*
2  * The contents of this file are subject to the terms
3  * of the Common Development and Distribution License
4  * (the License). You may not use this file except in
5  * compliance with the License.
6  *
7  * You can obtain a copy of the license at
8  * https://glassfish.dev.java.net/public/CDDLv1.0.html or
9  * glassfish/bootstrap/legal/CDDLv1.0.txt.
10  * See the License for the specific language governing
11  * permissions and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL
14  * Header Notice in each file and include the License file
15  * at glassfish/bootstrap/legal/CDDLv1.0.txt.
16  * If applicable, add the following below the CDDL Header,
17  * with the fields enclosed by brackets [] replaced by
18  * you own identifying information:
19  * "Portions Copyrighted [year] [name of copyright owner]"
20  *
21  * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
22  */

23  
24 /**
25  * This generated bean class Security matches the DTD element security
26  *
27  */

28
29 package com.sun.enterprise.config.clientbeans;
30
31 import org.w3c.dom.*;
32 import org.netbeans.modules.schema2beans.*;
33 import java.beans.*;
34 import java.util.*;
35 import java.io.Serializable JavaDoc;
36 import com.sun.enterprise.config.ConfigBean;
37 import com.sun.enterprise.config.ConfigException;
38 import com.sun.enterprise.config.StaleWriteConfigException;
39 import com.sun.enterprise.util.i18n.StringManager;
40
41 // BEGIN_NOI18N
42

43 public class Security extends ConfigBean implements Serializable JavaDoc
44 {
45
46     static Vector comparators = new Vector();
47     private static final org.netbeans.modules.schema2beans.Version runtimeVersion = new org.netbeans.modules.schema2beans.Version(4, 2, 0);
48
49     static public final String JavaDoc SSL = "Ssl";
50     static public final String JavaDoc CERT_DB = "CertDb";
51
52     public Security() {
53         this(Common.USE_DEFAULT_VALUES);
54     }
55
56     public Security(int options)
57     {
58         super(comparators, runtimeVersion);
59         // Properties (see root bean comments for the bean graph)
60
initPropertyTables(2);
61         this.createProperty("ssl", SSL,
62             Common.TYPE_1 | Common.TYPE_BEAN | Common.TYPE_KEY,
63             Ssl.class);
64         this.createAttribute(SSL, "cert-nickname", "CertNickname",
65                         AttrProp.CDATA | AttrProp.IMPLIED,
66                         null, null);
67         this.createAttribute(SSL, "ssl2-enabled", "Ssl2Enabled",
68                         AttrProp.CDATA,
69                         null, "false");
70         this.createAttribute(SSL, "ssl2-ciphers", "Ssl2Ciphers",
71                         AttrProp.CDATA | AttrProp.IMPLIED,
72                         null, null);
73         this.createAttribute(SSL, "ssl3-enabled", "Ssl3Enabled",
74                         AttrProp.CDATA,
75                         null, "true");
76         this.createAttribute(SSL, "ssl3-tls-ciphers", "Ssl3TlsCiphers",
77                         AttrProp.CDATA | AttrProp.IMPLIED,
78                         null, null);
79         this.createAttribute(SSL, "tls-enabled", "TlsEnabled",
80                         AttrProp.CDATA,
81                         null, "true");
82         this.createAttribute(SSL, "tls-rollback-enabled", "TlsRollbackEnabled",
83                         AttrProp.CDATA,
84                         null, "true");
85         this.createProperty("cert-db", CERT_DB,
86             Common.TYPE_1 | Common.TYPE_BEAN | Common.TYPE_KEY,
87             CertDb.class);
88         this.createAttribute(CERT_DB, "path", "Path",
89                         AttrProp.CDATA | AttrProp.REQUIRED,
90                         null, null);
91         this.createAttribute(CERT_DB, "password", "Password",
92                         AttrProp.CDATA | AttrProp.REQUIRED,
93                         null, null);
94         this.initialize(options);
95     }
96
97     // Setting the default values of the properties
98
void initialize(int options) {
99
100     }
101
102     // This attribute is mandatory
103
public void setSsl(Ssl value) {
104         this.setValue(SSL, value);
105     }
106
107     // Get Method
108
public Ssl getSsl() {
109         return (Ssl)this.getValue(SSL);
110     }
111
112     // This attribute is mandatory
113
public void setCertDb(CertDb value) {
114         this.setValue(CERT_DB, value);
115     }
116
117     // Get Method
118
public CertDb getCertDb() {
119         return (CertDb)this.getValue(CERT_DB);
120     }
121
122     /**
123      * Create a new bean using it's default constructor.
124      * This does not add it to any bean graph.
125      */

126     public Ssl newSsl() {
127         return new Ssl();
128     }
129
130     /**
131      * Create a new bean using it's default constructor.
132      * This does not add it to any bean graph.
133      */

134     public CertDb newCertDb() {
135         return new CertDb();
136     }
137
138     /**
139     * get the xpath representation for this element
140     * returns something like abc[@name='value'] or abc
141     * depending on the type of the bean
142     */

143     protected String JavaDoc getRelativeXPath() {
144         String JavaDoc ret = null;
145         ret = "security";
146         return (null != ret ? ret.trim() : null);
147     }
148
149     /*
150     * generic method to get default value from dtd
151     */

152     public static String JavaDoc getDefaultAttributeValue(String JavaDoc attr) {
153         if(attr == null) return null;
154         attr = attr.trim();
155     return null;
156     }
157     //
158
public static void addComparator(org.netbeans.modules.schema2beans.BeanComparator c) {
159         comparators.add(c);
160     }
161
162     //
163
public static void removeComparator(org.netbeans.modules.schema2beans.BeanComparator c) {
164         comparators.remove(c);
165     }
166     public void validate() throws org.netbeans.modules.schema2beans.ValidateException {
167     }
168
169     // Dump the content of this bean returning it as a String
170
public void dump(StringBuffer JavaDoc str, String JavaDoc indent){
171         String JavaDoc s;
172         Object JavaDoc o;
173         org.netbeans.modules.schema2beans.BaseBean n;
174         str.append(indent);
175         str.append("Ssl"); // NOI18N
176
n = (org.netbeans.modules.schema2beans.BaseBean) this.getSsl();
177         if (n != null)
178             n.dump(str, indent + "\t"); // NOI18N
179
else
180             str.append(indent+"\tnull"); // NOI18N
181
this.dumpAttributes(SSL, 0, str, indent);
182
183         str.append(indent);
184         str.append("CertDb"); // NOI18N
185
n = (org.netbeans.modules.schema2beans.BaseBean) this.getCertDb();
186         if (n != null)
187             n.dump(str, indent + "\t"); // NOI18N
188
else
189             str.append(indent+"\tnull"); // NOI18N
190
this.dumpAttributes(CERT_DB, 0, str, indent);
191
192     }
193     public String JavaDoc dumpBeanNode(){
194         StringBuffer JavaDoc str = new StringBuffer JavaDoc();
195         str.append("Security\n"); // NOI18N
196
this.dump(str, "\n "); // NOI18N
197
return str.toString();
198     }}
199
200 // END_NOI18N
201

202
Popular Tags