1 23 24 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 ; 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 43 public class Security extends ConfigBean implements Serializable 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 SSL = "Ssl"; 50 static public final String 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 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 void initialize(int options) { 99 100 } 101 102 public void setSsl(Ssl value) { 104 this.setValue(SSL, value); 105 } 106 107 public Ssl getSsl() { 109 return (Ssl)this.getValue(SSL); 110 } 111 112 public void setCertDb(CertDb value) { 114 this.setValue(CERT_DB, value); 115 } 116 117 public CertDb getCertDb() { 119 return (CertDb)this.getValue(CERT_DB); 120 } 121 122 126 public Ssl newSsl() { 127 return new Ssl(); 128 } 129 130 134 public CertDb newCertDb() { 135 return new CertDb(); 136 } 137 138 143 protected String getRelativeXPath() { 144 String ret = null; 145 ret = "security"; 146 return (null != ret ? ret.trim() : null); 147 } 148 149 152 public static String getDefaultAttributeValue(String attr) { 153 if(attr == null) return null; 154 attr = attr.trim(); 155 return null; 156 } 157 public static void addComparator(org.netbeans.modules.schema2beans.BeanComparator c) { 159 comparators.add(c); 160 } 161 162 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 public void dump(StringBuffer str, String indent){ 171 String s; 172 Object o; 173 org.netbeans.modules.schema2beans.BaseBean n; 174 str.append(indent); 175 str.append("Ssl"); n = (org.netbeans.modules.schema2beans.BaseBean) this.getSsl(); 177 if (n != null) 178 n.dump(str, indent + "\t"); else 180 str.append(indent+"\tnull"); this.dumpAttributes(SSL, 0, str, indent); 182 183 str.append(indent); 184 str.append("CertDb"); n = (org.netbeans.modules.schema2beans.BaseBean) this.getCertDb(); 186 if (n != null) 187 n.dump(str, indent + "\t"); else 189 str.append(indent+"\tnull"); this.dumpAttributes(CERT_DB, 0, str, indent); 191 192 } 193 public String dumpBeanNode(){ 194 StringBuffer str = new StringBuffer (); 195 str.append("Security\n"); this.dump(str, "\n "); return str.toString(); 198 }} 199 200 202 | Popular Tags |