1 23 package com.sun.enterprise.deployment; 24 25 import java.util.Properties ; 26 import java.io.InputStream ; 27 import java.io.IOException ; 28 import java.util.logging.*; 29 import com.sun.logging.*; 30 31 import com.sun.enterprise.deployment.util.LogDomains; 32 33 37 38 public class EjbIORConfigurationDescriptor { 39 public static final String NONE = "NONE"; 42 public static final String SUPPORTED = "SUPPORTED"; 43 public static final String REQUIRED = "REQUIRED"; 44 45 public static final String USERNAME_PASSWORD = "username_password"; 46 public static final String DEFAULT_REALM = "default"; 47 48 private String integrity = SUPPORTED; 49 private String confidentiality = SUPPORTED; 50 private String establishTrustInTarget = SUPPORTED; 51 private String establishTrustInClient = SUPPORTED; 52 private String authenticationMethod = USERNAME_PASSWORD; 53 private String realmName = DEFAULT_REALM; 54 private String callerPropagation = SUPPORTED; 55 private boolean required = false; 56 57 static Logger _logger = LogDomains.getLogger(LogDomains.DPL_LOGGER); 58 59 62 public EjbIORConfigurationDescriptor() { 63 try { 64 if (Boolean.getBoolean("interop.ssl.required")) { 65 integrity = REQUIRED; 66 confidentiality = REQUIRED; 67 establishTrustInClient = REQUIRED; 68 establishTrustInTarget = SUPPORTED; 69 } 70 71 if (Boolean.getBoolean("interop.authRequired.enabled")) { 72 required = true; 73 authenticationMethod = USERNAME_PASSWORD; 74 } 75 } catch(Throwable ioe) { 76 _logger.log(Level.WARNING,"enterprise.deployment_ioexcp",ioe); 78 79 } 81 } 82 83 public EjbIORConfigurationDescriptor(boolean enableUsernamePassword) { 84 if(enableUsernamePassword) { 85 required = true; 86 authenticationMethod = USERNAME_PASSWORD; 87 } 88 } 89 90 94 public String getIntegrity() { 95 return integrity; 96 } 97 98 102 public void setIntegrity(String val) { 103 if(!val.equalsIgnoreCase(NONE) && !val.equalsIgnoreCase(SUPPORTED) && 104 !val.equalsIgnoreCase(REQUIRED)) { 105 throw new RuntimeException ("Incorrect value for integrity:" + val); 106 } 107 108 integrity = val; 109 } 110 111 116 public String getConfidentiality() { 117 return confidentiality; 118 } 119 120 124 public void setConfidentiality(String val) { 125 if(!val.equalsIgnoreCase(NONE) && !val.equalsIgnoreCase(SUPPORTED) && 126 !val.equalsIgnoreCase(REQUIRED)) { 127 throw new RuntimeException ("Incorrect value for confidentiality:" + 128 val); 129 } 130 confidentiality = val; 131 } 132 133 138 public String getEstablishTrustInTarget() { 139 return establishTrustInTarget; 140 } 141 142 146 public void setEstablishTrustInTarget(String val) { 147 if(!val.equalsIgnoreCase(NONE) && !val.equalsIgnoreCase(SUPPORTED)) { 148 throw new RuntimeException ("Incorrect value for " + 149 "establishTrustInTarget:" + val); 150 } 151 152 establishTrustInTarget = val; 153 } 154 155 160 public String getEstablishTrustInClient() { 161 return establishTrustInClient; 162 } 163 164 168 public void setEstablishTrustInClient(String val) { 169 if(!val.equalsIgnoreCase(NONE) && !val.equalsIgnoreCase(SUPPORTED) && 170 !val.equalsIgnoreCase(REQUIRED)) { 171 throw new RuntimeException ("Incorrect value for " + 172 "establishTrustInClient:" + val); 173 } 174 175 establishTrustInClient = val; 176 } 177 178 183 public String getAuthenticationMethod() { 184 return authenticationMethod; 185 } 186 187 191 public void setAuthenticationMethod(String val) { 192 if(!val.equalsIgnoreCase(USERNAME_PASSWORD) && !val.equalsIgnoreCase(NONE)) { 193 throw new RuntimeException ("Incorrect value for " + 194 "authentication method:" + val); 195 } 196 authenticationMethod = val; 197 } 198 199 204 public String getRealmName() { 205 return realmName; 206 } 207 208 212 public void setRealmName(String val) { 213 realmName = val; 214 } 215 216 220 public String getCallerPropagation() { 221 return callerPropagation; 222 } 223 224 228 public void setCallerPropagation(String val) { 229 if(!val.equalsIgnoreCase(NONE) && !val.equalsIgnoreCase(SUPPORTED) && 230 !val.equalsIgnoreCase(REQUIRED)) { 231 throw new RuntimeException ("Incorrect value for callerPropagation:" + val); 232 } 233 callerPropagation = val; 234 } 235 236 241 public boolean isAuthMethodRequired() { 242 return required; 243 } 244 245 250 public void setAuthMethodRequired(boolean val) { 251 required = val; 252 } 253 254 255 260 public void setAuthMethodRequired(String val) { 261 required = new Boolean (val).booleanValue(); 262 } 263 264 267 public void print(StringBuffer toStringBuffer) { 268 toStringBuffer.append("\n integrity ").append(integrity); 269 toStringBuffer.append( "\n confidentiality " ).append( confidentiality); 270 toStringBuffer.append( "\n establishTrustInTarget ").append(establishTrustInTarget); 271 toStringBuffer.append( "\n establishTrustInClient ").append(establishTrustInClient); 272 toStringBuffer.append( "\n callerPropagation ").append(callerPropagation); 273 toStringBuffer.append( "\n realm ").append(realmName); 274 toStringBuffer.append( "\n authenticationMethod ").append(authenticationMethod).append("\n"); 275 } 276 } 277 278 | Popular Tags |