1 23 24 28 29 package com.sun.enterprise.config.serverbeans; 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 Ssl 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 50 public Ssl() { 51 this(Common.USE_DEFAULT_VALUES); 52 } 53 54 public Ssl(int options) 55 { 56 super(comparators, runtimeVersion); 57 initPropertyTables(0); 59 this.initialize(options); 60 } 61 62 void initialize(int options) { 64 65 } 66 67 71 public String getCertNickname() { 72 return getAttributeValue(ServerTags.CERT_NICKNAME); 73 } 74 79 public void setCertNickname(String v, boolean overwrite) throws StaleWriteConfigException { 80 setAttributeValue(ServerTags.CERT_NICKNAME, v, overwrite); 81 } 82 86 public void setCertNickname(String v) { 87 setAttributeValue(ServerTags.CERT_NICKNAME, v); 88 } 89 93 public boolean isSsl2Enabled() { 94 return toBoolean(getAttributeValue(ServerTags.SSL2_ENABLED)); 95 } 96 101 public void setSsl2Enabled(boolean v, boolean overwrite) throws StaleWriteConfigException { 102 setAttributeValue(ServerTags.SSL2_ENABLED, ""+(v==true), overwrite); 103 } 104 108 public void setSsl2Enabled(boolean v) { 109 setAttributeValue(ServerTags.SSL2_ENABLED, ""+(v==true)); 110 } 111 114 public static String getDefaultSsl2Enabled() { 115 return "false".trim(); 116 } 117 121 public String getSsl2Ciphers() { 122 return getAttributeValue(ServerTags.SSL2_CIPHERS); 123 } 124 129 public void setSsl2Ciphers(String v, boolean overwrite) throws StaleWriteConfigException { 130 setAttributeValue(ServerTags.SSL2_CIPHERS, v, overwrite); 131 } 132 136 public void setSsl2Ciphers(String v) { 137 setAttributeValue(ServerTags.SSL2_CIPHERS, v); 138 } 139 143 public boolean isSsl3Enabled() { 144 return toBoolean(getAttributeValue(ServerTags.SSL3_ENABLED)); 145 } 146 151 public void setSsl3Enabled(boolean v, boolean overwrite) throws StaleWriteConfigException { 152 setAttributeValue(ServerTags.SSL3_ENABLED, ""+(v==true), overwrite); 153 } 154 158 public void setSsl3Enabled(boolean v) { 159 setAttributeValue(ServerTags.SSL3_ENABLED, ""+(v==true)); 160 } 161 164 public static String getDefaultSsl3Enabled() { 165 return "true".trim(); 166 } 167 171 public String getSsl3TlsCiphers() { 172 return getAttributeValue(ServerTags.SSL3_TLS_CIPHERS); 173 } 174 179 public void setSsl3TlsCiphers(String v, boolean overwrite) throws StaleWriteConfigException { 180 setAttributeValue(ServerTags.SSL3_TLS_CIPHERS, v, overwrite); 181 } 182 186 public void setSsl3TlsCiphers(String v) { 187 setAttributeValue(ServerTags.SSL3_TLS_CIPHERS, v); 188 } 189 193 public boolean isTlsEnabled() { 194 return toBoolean(getAttributeValue(ServerTags.TLS_ENABLED)); 195 } 196 201 public void setTlsEnabled(boolean v, boolean overwrite) throws StaleWriteConfigException { 202 setAttributeValue(ServerTags.TLS_ENABLED, ""+(v==true), overwrite); 203 } 204 208 public void setTlsEnabled(boolean v) { 209 setAttributeValue(ServerTags.TLS_ENABLED, ""+(v==true)); 210 } 211 214 public static String getDefaultTlsEnabled() { 215 return "true".trim(); 216 } 217 221 public boolean isTlsRollbackEnabled() { 222 return toBoolean(getAttributeValue(ServerTags.TLS_ROLLBACK_ENABLED)); 223 } 224 229 public void setTlsRollbackEnabled(boolean v, boolean overwrite) throws StaleWriteConfigException { 230 setAttributeValue(ServerTags.TLS_ROLLBACK_ENABLED, ""+(v==true), overwrite); 231 } 232 236 public void setTlsRollbackEnabled(boolean v) { 237 setAttributeValue(ServerTags.TLS_ROLLBACK_ENABLED, ""+(v==true)); 238 } 239 242 public static String getDefaultTlsRollbackEnabled() { 243 return "true".trim(); 244 } 245 249 public boolean isClientAuthEnabled() { 250 return toBoolean(getAttributeValue(ServerTags.CLIENT_AUTH_ENABLED)); 251 } 252 257 public void setClientAuthEnabled(boolean v, boolean overwrite) throws StaleWriteConfigException { 258 setAttributeValue(ServerTags.CLIENT_AUTH_ENABLED, ""+(v==true), overwrite); 259 } 260 264 public void setClientAuthEnabled(boolean v) { 265 setAttributeValue(ServerTags.CLIENT_AUTH_ENABLED, ""+(v==true)); 266 } 267 270 public static String getDefaultClientAuthEnabled() { 271 return "false".trim(); 272 } 273 278 protected String getRelativeXPath() { 279 String ret = null; 280 ret = "ssl"; 281 return (null != ret ? ret.trim() : null); 282 } 283 284 287 public static String getDefaultAttributeValue(String attr) { 288 if(attr == null) return null; 289 attr = attr.trim(); 290 if(attr.equals(ServerTags.SSL2_ENABLED)) return "false".trim(); 291 if(attr.equals(ServerTags.SSL3_ENABLED)) return "true".trim(); 292 if(attr.equals(ServerTags.TLS_ENABLED)) return "true".trim(); 293 if(attr.equals(ServerTags.TLS_ROLLBACK_ENABLED)) return "true".trim(); 294 if(attr.equals(ServerTags.CLIENT_AUTH_ENABLED)) return "false".trim(); 295 return null; 296 } 297 public static void addComparator(org.netbeans.modules.schema2beans.BeanComparator c) { 299 comparators.add(c); 300 } 301 302 public static void removeComparator(org.netbeans.modules.schema2beans.BeanComparator c) { 304 comparators.remove(c); 305 } 306 public void validate() throws org.netbeans.modules.schema2beans.ValidateException { 307 } 308 309 public void dump(StringBuffer str, String indent){ 311 String s; 312 Object o; 313 org.netbeans.modules.schema2beans.BaseBean n; 314 } 315 public String dumpBeanNode(){ 316 StringBuffer str = new StringBuffer (); 317 str.append("Ssl\n"); this.dump(str, "\n "); return str.toString(); 320 }} 321 322 324 | Popular Tags |