directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1418279 - in /directory/apacheds/trunk: core-api/src/main/java/org/apache/directory/server/core/api/partition/ core-integ/src/test/java/org/apache/directory/server/core/operations/search/ core-shared/src/main/java/org/apache/directory/serv...
Date Fri, 07 Dec 2012 11:19:55 GMT
Author: elecharny
Date: Fri Dec  7 11:19:53 2012
New Revision: 1418279

URL: http://svn.apache.org/viewvc?rev=1418279&view=rev
Log:
o The Store.delete( String ) and Partition.delete(DeleteOperationContext) methods now returns
the deleted Entry
o The AbstractBtreePartition.lookup( String id ) method now calls the lookup( String, Dn )
method, instead of duplacting its code
o Removed the EntryDN attribute from the atrrinbutes to be replicated
o Fixed a test issue

Modified:
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/partition/Partition.java
    directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/operations/search/SearchWithIndicesIT.java
    directory/apacheds/trunk/core-shared/src/main/java/org/apache/directory/server/core/shared/partition/DefaultPartitionNexus.java
    directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/consumer/ReplicationConsumerImpl.java
    directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/AbstractBTreePartition.java
    directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/Store.java

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/partition/Partition.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/partition/Partition.java?rev=1418279&r1=1418278&r2=1418279&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/partition/Partition.java
(original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/partition/Partition.java
Fri Dec  7 11:19:53 2012
@@ -157,9 +157,10 @@ public interface Partition
      *
      * @param deleteContext the context of the entry to
      * delete from this ContextPartition.
+     * @return The delete Entry, if found
      * @throws Exception if there are any problems
      */
-    void delete( DeleteOperationContext deleteContext ) throws LdapException;
+    Entry delete( DeleteOperationContext deleteContext ) throws LdapException;
 
 
     /**

Modified: directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/operations/search/SearchWithIndicesIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/operations/search/SearchWithIndicesIT.java?rev=1418279&r1=1418278&r2=1418279&view=diff
==============================================================================
--- directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/operations/search/SearchWithIndicesIT.java
(original)
+++ directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/operations/search/SearchWithIndicesIT.java
Fri Dec  7 11:19:53 2012
@@ -108,7 +108,7 @@ public class SearchWithIndicesIT extends
     {
         connection.add(
             new DefaultEntry(
-                "cn=" + name + ",ou=groups, ou=system",
+                "cn=" + name + ",ou=groups,ou=system",
                 "objectClass: top",
                 "objectClass: posixGroup",
                 "cn", name,

Modified: directory/apacheds/trunk/core-shared/src/main/java/org/apache/directory/server/core/shared/partition/DefaultPartitionNexus.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-shared/src/main/java/org/apache/directory/server/core/shared/partition/DefaultPartitionNexus.java?rev=1418279&r1=1418278&r2=1418279&view=diff
==============================================================================
--- directory/apacheds/trunk/core-shared/src/main/java/org/apache/directory/server/core/shared/partition/DefaultPartitionNexus.java
(original)
+++ directory/apacheds/trunk/core-shared/src/main/java/org/apache/directory/server/core/shared/partition/DefaultPartitionNexus.java
Fri Dec  7 11:19:53 2012
@@ -501,10 +501,10 @@ public class DefaultPartitionNexus exten
     /**
      * {@inheritDoc}
      */
-    public void delete( DeleteOperationContext deleteContext ) throws LdapException
+    public Entry delete( DeleteOperationContext deleteContext ) throws LdapException
     {
         Partition partition = getPartition( deleteContext.getDn() );
-        partition.delete( deleteContext );
+        Entry deletedEntry = partition.delete( deleteContext );
         
         Entry entry = deleteContext.getEntry();
         Attribute csn = entry.get( ENTRY_CSN_AT );
@@ -514,6 +514,8 @@ public class DefaultPartitionNexus exten
         {
             directoryService.setContextCsn( csn.getString() );
         }
+        
+        return deletedEntry;
     }
 
 

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=1418279&r1=1418278&r2=1418279&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
Fri Dec  7 11:19:53 2012
@@ -135,6 +135,7 @@ public class ReplicationConsumerImpl imp
     private static final String[] MOD_IGNORE_AT = new String[]
         {
             SchemaConstants.ENTRY_UUID_AT, 
+            SchemaConstants.ENTRY_DN_AT, 
             SchemaConstants.CREATE_TIMESTAMP_AT, 
             SchemaConstants.CREATORS_NAME_AT, 
             SchemaConstants.ENTRY_PARENT_ID_AT,

Modified: directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/AbstractBTreePartition.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/AbstractBTreePartition.java?rev=1418279&r1=1418278&r2=1418279&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/AbstractBTreePartition.java
(original)
+++ directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/AbstractBTreePartition.java
Fri Dec  7 11:19:53 2012
@@ -769,7 +769,7 @@ public abstract class AbstractBTreeParti
     /**
      * {@inheritDoc}
      */
-    public void delete( DeleteOperationContext deleteContext ) throws LdapException
+    public Entry delete( DeleteOperationContext deleteContext ) throws LdapException
     {
         try
         {
@@ -802,9 +802,11 @@ public abstract class AbstractBTreeParti
             }
 
             // We now defer the deletion to the implementing class
-            delete( id );
+            Entry deletedEntry = delete( id );
             
             updateCache( deleteContext );
+            
+            return deletedEntry;
         }
         catch ( LdapException le )
         {
@@ -867,9 +869,10 @@ public abstract class AbstractBTreeParti
     /**
      * Delete the entry associated with a given Id
      * @param id The id of the entry to delete
+     * @return the deleted entry if found
      * @throws Exception If the deletion failed
      */
-    public void delete( String id ) throws LdapException
+    public Entry delete( String id ) throws LdapException
     {
         try
         {
@@ -951,6 +954,8 @@ public abstract class AbstractBTreeParti
             {
                 sync();
             }
+            
+            return entry;
         }
         catch ( Exception e )
         {
@@ -1183,34 +1188,9 @@ public abstract class AbstractBTreeParti
         try
         {
             lockRead();
-            Entry entry = lookupCache( id );
-            
-            if( entry != null )
-            {
-                return new ClonedServerEntry( entry );
-            }
-            
-            entry = master.get( id );
-
-            if ( entry != null )
-            {
-                // We have to store the DN in this entry
-                Dn dn = buildEntryDn( id );
-
-                if ( dn == null )
-                {
-                    // No dn : we probably have removed the RDNs for this entry
-                    return null;
-                }
-
-                entry.setDn( dn );
-
-                addToCache( id, entry );
-                
-                return new ClonedServerEntry( entry );
-            }
-
-            return null;
+            Dn dn = buildEntryDn( id );
+    
+            return lookup( id, dn );
         }
         catch ( Exception e )
         {
@@ -1267,6 +1247,7 @@ public abstract class AbstractBTreeParti
                 }
 
                 addToCache( id, entry );
+                
                 return new ClonedServerEntry( entry );
             }
 

Modified: directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/Store.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/Store.java?rev=1418279&r1=1418278&r2=1418279&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/Store.java
(original)
+++ directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/Store.java
Fri Dec  7 11:19:53 2012
@@ -318,9 +318,10 @@ public interface Store
      * Delete an entry from the store
      *
      * @param id The Entry UUID we want to delete
+     * @return the deleted entry if found
      * @throws Exception If the deletion failed for any reason
      */
-    void delete( String id ) throws Exception;
+    Entry delete( String id ) throws Exception;
 
 
     /**



Mime
View raw message