geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vamsic...@apache.org
Subject svn commit: r472317 - /geronimo/server/trunk/modules/geronimo-security-builder/src/main/java/org/apache/geronimo/security/deployment/GeronimoSecurityBuilderImpl.java
Date Tue, 07 Nov 2006 22:59:11 GMT
Author: vamsic007
Date: Tue Nov  7 14:59:11 2006
New Revision: 472317

URL: http://svn.apache.org/viewvc?view=rev&rev=472317
Log:
GERONIMO-2275 login-domain-principal or realm-principal in default-principal cause deployment
errors

Modified:
    geronimo/server/trunk/modules/geronimo-security-builder/src/main/java/org/apache/geronimo/security/deployment/GeronimoSecurityBuilderImpl.java

Modified: geronimo/server/trunk/modules/geronimo-security-builder/src/main/java/org/apache/geronimo/security/deployment/GeronimoSecurityBuilderImpl.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-security-builder/src/main/java/org/apache/geronimo/security/deployment/GeronimoSecurityBuilderImpl.java?view=diff&rev=472317&r1=472316&r2=472317
==============================================================================
--- geronimo/server/trunk/modules/geronimo-security-builder/src/main/java/org/apache/geronimo/security/deployment/GeronimoSecurityBuilderImpl.java
(original)
+++ geronimo/server/trunk/modules/geronimo-security-builder/src/main/java/org/apache/geronimo/security/deployment/GeronimoSecurityBuilderImpl.java
Tue Nov  7 14:59:11 2006
@@ -265,7 +265,15 @@
         GerDefaultPrincipalType defaultPrincipalType = (GerDefaultPrincipalType) xmlObject;
         DefaultPrincipal defaultPrincipal = new DefaultPrincipal();
 
-        defaultPrincipal.setPrincipal(buildPrincipal(defaultPrincipalType.getPrincipal()));
+        if(defaultPrincipalType.isSetPrincipal()) {
+            defaultPrincipal.setPrincipal(buildPrincipal(defaultPrincipalType.getPrincipal()));
+        } else if(defaultPrincipalType.isSetLoginDomainPrincipal()) {
+            defaultPrincipal.setPrincipal(buildDomainPrincipal(defaultPrincipalType.getLoginDomainPrincipal()));
+        } else if(defaultPrincipalType.isSetRealmPrincipal()) {
+            defaultPrincipal.setPrincipal(buildRealmPrincipal(defaultPrincipalType.getRealmPrincipal()));
+        } else {
+            throw new IllegalStateException("default-principal does not contain a principal,
login-domain-principal, or realm-principal");
+        }
         GerNamedUsernamePasswordCredentialType[] namedCredentials = defaultPrincipalType.getNamedUsernamePasswordCredentialArray();
         if (namedCredentials.length > 0) {
             Set defaultCredentialSet = new HashSet();



Mime
View raw message