directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kayyag...@apache.org
Subject svn commit: r1414192 - in /directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication: SyncReplConfiguration.java consumer/ReplicationConsumerImpl.java provider/SyncReplRequestHandler.java
Date Tue, 27 Nov 2012 14:02:04 GMT
Author: kayyagari
Date: Tue Nov 27 14:02:03 2012
New Revision: 1414192

URL: http://svn.apache.org/viewvc?rev=1414192&view=rev
Log:
o removed the modification of attributes in replication configuration
o added operational attributes to the search/lookup request in replication consumer and handler

Modified:
    directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/SyncReplConfiguration.java
    directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/consumer/ReplicationConsumerImpl.java
    directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/provider/SyncReplRequestHandler.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=1414192&r1=1414191&r2=1414192&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 14:02:03 2012
@@ -136,8 +136,8 @@ public class SyncReplConfiguration imple
     public SyncReplConfiguration()
     {
         attributes = new HashSet<String>();
+        // the default list of attributes
         attributes.add( SchemaConstants.ALL_USER_ATTRIBUTES );
-        attributes.add( SchemaConstants.ALL_OPERATIONAL_ATTRIBUTES );
     }
 
 
@@ -304,26 +304,11 @@ public class SyncReplConfiguration imple
      */
     public void setAttributes( String[] attrs )
     {
-        if ( attrs == null )
+        attributes.clear();
+        
+        for ( String attr : attrs )
         {
-            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 );
-            }
+            attributes.add( attr );
         }
     }
 

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/consumer/ReplicationConsumerImpl.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/consumer/ReplicationConsumerImpl.java?rev=1414192&r1=1414191&r2=1414192&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/consumer/ReplicationConsumerImpl.java
(original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/consumer/ReplicationConsumerImpl.java
Tue Nov 27 14:02:03 2012
@@ -958,6 +958,10 @@ public class ReplicationConsumerImpl imp
     {
         LookupOperationContext lookupCtx = new LookupOperationContext( session, remoteEntry.getDn()
);
         lookupCtx.setAttrsId( config.getAttributes() );
+        
+        // this is needed to compare some of the operational attributes received from the
server
+        lookupCtx.addAttrsId( SchemaConstants.ALL_OPERATIONAL_ATTRIBUTES );
+        
         lookupCtx.setSyncreplLookup( true );
         
         Entry localEntry = session.getDirectoryService().getOperationManager().lookup( lookupCtx
);

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/provider/SyncReplRequestHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/provider/SyncReplRequestHandler.java?rev=1414192&r1=1414191&r2=1414192&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/provider/SyncReplRequestHandler.java
(original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/provider/SyncReplRequestHandler.java
Tue Nov 27 14:02:03 2012
@@ -261,6 +261,12 @@ public class SyncReplRequestHandler impl
     {
         try
         {
+            if( !request.getAttributes().contains( SchemaConstants.ALL_OPERATIONAL_ATTRIBUTES
) )
+            {
+                // this is needed for accessing entryUUID and entryCSN attributes for internal
purpose
+                request.addAttributes( SchemaConstants.ALL_OPERATIONAL_ATTRIBUTES );
+            }
+            
             // First extract the Sync control from the request
             SyncRequestValue syncControl = ( SyncRequestValue ) request.getControls().get(
                 SyncRequestValue.OID );



Mime
View raw message