archiva-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1434059 - /archiva/redback/redback-core/trunk/redback-common/redback-common-ldap/src/main/java/org/apache/archiva/redback/common/ldap/role/DefaultLdapRoleMapper.java
Date Wed, 16 Jan 2013 17:29:40 GMT
Author: olamy
Date: Wed Jan 16 17:29:39 2013
New Revision: 1434059

URL: http://svn.apache.org/viewvc?rev=1434059&view=rev
Log:
take care of already existing group so do not fail

Modified:
    archiva/redback/redback-core/trunk/redback-common/redback-common-ldap/src/main/java/org/apache/archiva/redback/common/ldap/role/DefaultLdapRoleMapper.java

Modified: archiva/redback/redback-core/trunk/redback-common/redback-common-ldap/src/main/java/org/apache/archiva/redback/common/ldap/role/DefaultLdapRoleMapper.java
URL: http://svn.apache.org/viewvc/archiva/redback/redback-core/trunk/redback-common/redback-common-ldap/src/main/java/org/apache/archiva/redback/common/ldap/role/DefaultLdapRoleMapper.java?rev=1434059&r1=1434058&r2=1434059&view=diff
==============================================================================
--- archiva/redback/redback-core/trunk/redback-common/redback-common-ldap/src/main/java/org/apache/archiva/redback/common/ldap/role/DefaultLdapRoleMapper.java
(original)
+++ archiva/redback/redback-core/trunk/redback-common/redback-common-ldap/src/main/java/org/apache/archiva/redback/common/ldap/role/DefaultLdapRoleMapper.java
Wed Jan 16 17:29:39 2013
@@ -33,6 +33,7 @@ import org.springframework.stereotype.Se
 import javax.annotation.PostConstruct;
 import javax.inject.Inject;
 import javax.inject.Named;
+import javax.naming.NameAlreadyBoundException;
 import javax.naming.NameNotFoundException;
 import javax.naming.NamingEnumeration;
 import javax.naming.NamingException;
@@ -482,6 +483,11 @@ public class DefaultLdapRoleMapper
         throws MappingException
     {
 
+        if ( hasRole( context, roleName ) )
+        {
+            return true;
+        }
+
         String groupName = findGroupName( roleName );
 
         if ( groupName == null )
@@ -527,6 +533,11 @@ public class DefaultLdapRoleMapper
 
             return true;
         }
+        catch ( NameAlreadyBoundException e )
+        {
+            log.info( "skip group '{}' creation as already exists", groupName );
+            return true;
+        }
         catch ( LdapException e )
         {
             throw new MappingException( e.getMessage(), e );



Mime
View raw message