directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kayyag...@apache.org
Subject svn commit: r1414171 - /directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/SyncReplConfiguration.java
Date Tue, 27 Nov 2012 13:16:44 GMT
Author: kayyagari
Date: Tue Nov 27 13:16:43 2012
New Revision: 1414171

URL: http://svn.apache.org/viewvc?rev=1414171&view=rev
Log:
do not remove operational attributes from the requested attribute types

Modified:
    directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/SyncReplConfiguration.java

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/SyncReplConfiguration.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/SyncReplConfiguration.java?rev=1414171&r1=1414170&r2=1414171&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/SyncReplConfiguration.java
(original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/SyncReplConfiguration.java
Tue Nov 27 13:16:43 2012
@@ -304,11 +304,26 @@ public class SyncReplConfiguration imple
      */
     public void setAttributes( String[] attrs )
     {
-        attributes.clear();
-        
-        for ( String attr : attrs )
+        if ( attrs == null )
         {
-            attributes.add( attr );
+            throw new IllegalArgumentException( "attributes to be replicated cannot be null
or empty" );
+        }
+
+        // if user specified some attributes then remove the * from attributes
+        // NOTE: if the user specifies * in the given array that eventually gets added later
+        if ( attrs.length > 0 )
+        {
+            attributes.remove( SchemaConstants.ALL_USER_ATTRIBUTES );
+        }
+
+        for ( String at : attrs )
+        {
+            at = at.trim();
+
+            if ( !attributes.contains( Strings.toLowerCase( at ) ) )
+            {
+                attributes.add( at );
+            }
         }
     }
 



Mime
View raw message