directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1227539 - in /directory/apacheds/branches/apacheds-txns/core-shared/src: main/java/org/apache/directory/server/core/shared/partition/ main/java/org/apache/directory/server/core/shared/txn/logedit/ test/java/org/apache/directory/server/core...
Date Thu, 05 Jan 2012 10:17:31 GMT
Author: elecharny
Date: Thu Jan  5 10:17:30 2012
New Revision: 1227539

URL: http://svn.apache.org/viewvc?rev=1227539&view=rev
Log:
o The IndexChange constructor does not need to receive the index's OID : the index parameter
already contains it.
o Made the DefaultPartitionNexus.operationExecutionManager field private
o Added a missing class header

Modified:
    directory/apacheds/branches/apacheds-txns/core-shared/src/main/java/org/apache/directory/server/core/shared/partition/DefaultOperationExecutionManager.java
    directory/apacheds/branches/apacheds-txns/core-shared/src/main/java/org/apache/directory/server/core/shared/partition/DefaultPartitionNexus.java
    directory/apacheds/branches/apacheds-txns/core-shared/src/main/java/org/apache/directory/server/core/shared/partition/OperationExecutionManagerFactory.java
    directory/apacheds/branches/apacheds-txns/core-shared/src/main/java/org/apache/directory/server/core/shared/txn/logedit/IndexChange.java
    directory/apacheds/branches/apacheds-txns/core-shared/src/test/java/org/apache/directory/server/core/shared/txn/IndexCursorWrapperTest.java

Modified: directory/apacheds/branches/apacheds-txns/core-shared/src/main/java/org/apache/directory/server/core/shared/partition/DefaultOperationExecutionManager.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/core-shared/src/main/java/org/apache/directory/server/core/shared/partition/DefaultOperationExecutionManager.java?rev=1227539&r1=1227538&r2=1227539&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/core-shared/src/main/java/org/apache/directory/server/core/shared/partition/DefaultOperationExecutionManager.java
(original)
+++ directory/apacheds/branches/apacheds-txns/core-shared/src/main/java/org/apache/directory/server/core/shared/partition/DefaultOperationExecutionManager.java
Thu Jan  5 10:17:30 2012
@@ -152,12 +152,10 @@ public class DefaultOperationExecutionMa
             UUID id = master.getNextId( entry );
             DataChangeContainer changeContainer = new DataChangeContainer( partition );
             changeContainer.setEntryID( id );
-            IndexChange indexChange;
 
             // Update the RDN index
             Index<?> rdnIdx = partition.getSystemIndex( ApacheSchemaConstants.APACHE_RDN_AT_OID
);
-            indexChange = new IndexChange( rdnIdx, ApacheSchemaConstants.APACHE_RDN_AT_OID,
key, id,
-                IndexChange.Type.ADD, true );
+            IndexChange indexChange = new IndexChange( rdnIdx, key, id, IndexChange.Type.ADD,
true );
             changeContainer.addChange( indexChange );
 
             // Update the ObjectClass index
@@ -176,7 +174,7 @@ public class DefaultOperationExecutionMa
 
             for ( Value<?> value : objectClass )
             {
-                indexChange = new IndexChange( objectClassIdx, SchemaConstants.OBJECT_CLASS_AT_OID,
value.getString(),
+                indexChange = new IndexChange( objectClassIdx, value.getString(),
                     id, IndexChange.Type.ADD, true );
                 changeContainer.addChange( indexChange );
             }
@@ -189,8 +187,7 @@ public class DefaultOperationExecutionMa
 
             // Update the OneLevel index
             Index<?> oneLevelIdx = partition.getSystemIndex( ApacheSchemaConstants.APACHE_ONE_LEVEL_AT_OID
);
-            indexChange = new IndexChange( oneLevelIdx, ApacheSchemaConstants.APACHE_ONE_LEVEL_AT_OID,
parentId, id,
-                IndexChange.Type.ADD, true );
+            indexChange = new IndexChange( oneLevelIdx, parentId, id, IndexChange.Type.ADD,
true );
             changeContainer.addChange( indexChange );
 
             // Update the SubLevel index
@@ -200,15 +197,13 @@ public class DefaultOperationExecutionMa
 
             while ( ( tempId != null ) && ( !tempId.equals( Partition.rootID ) )
&& ( !tempId.equals( suffixId ) ) )
             {
-                indexChange = new IndexChange( subLevelIdx, ApacheSchemaConstants.APACHE_SUB_LEVEL_AT_OID,
tempId, id,
-                    IndexChange.Type.ADD, true );
+                indexChange = new IndexChange( subLevelIdx, tempId, id, IndexChange.Type.ADD,
true );
                 changeContainer.addChange( indexChange );
                 tempId = getParentId( partition, tempId );
             }
 
             // making entry an ancestor/descendent of itself in sublevel index
-            indexChange = new IndexChange( subLevelIdx, ApacheSchemaConstants.APACHE_SUB_LEVEL_AT_OID,
id, id,
-                IndexChange.Type.ADD, true );
+            indexChange = new IndexChange( subLevelIdx, id, id, IndexChange.Type.ADD, true
);
             changeContainer.addChange( indexChange );
 
             // Update the EntryCsn index
@@ -221,8 +216,7 @@ public class DefaultOperationExecutionMa
             }
 
             Index<?> entryCsnIdx = partition.getSystemIndex( SchemaConstants.ENTRY_CSN_AT_OID
);
-            indexChange = new IndexChange( entryCsnIdx, SchemaConstants.ENTRY_CSN_AT_OID,
entryCsn.getString(), id,
-                IndexChange.Type.ADD, true );
+            indexChange = new IndexChange( entryCsnIdx, entryCsn.getString(), id, IndexChange.Type.ADD,
true );
             changeContainer.addChange( indexChange );
 
             // Update the EntryUuid index
@@ -235,8 +229,7 @@ public class DefaultOperationExecutionMa
             }
 
             Index<?> entryUuidIdx = partition.getSystemIndex( SchemaConstants.ENTRY_UUID_AT_OID
);
-            indexChange = new IndexChange( entryUuidIdx, SchemaConstants.ENTRY_UUID_AT_OID,
entryUuid.getString(), id,
-                IndexChange.Type.ADD, true );
+            indexChange = new IndexChange( entryUuidIdx, entryUuid.getString(), id, IndexChange.Type.ADD,
true );
             changeContainer.addChange( indexChange );
 
             // Now work on the user defined userIndices
@@ -257,14 +250,13 @@ public class DefaultOperationExecutionMa
 
                     for ( Value<?> value : attribute )
                     {
-                        indexChange = new IndexChange( index, attributeOid, value.getValue(),
id,
+                        indexChange = new IndexChange( index, value.getValue(), id,
                             IndexChange.Type.ADD, false );
                         changeContainer.addChange( indexChange );
                     }
 
                     // Adds only those attributes that are indexed
-                    indexChange = new IndexChange( presenceIdx, ApacheSchemaConstants.APACHE_PRESENCE_AT_OID,
-                        attributeOid, id, IndexChange.Type.ADD, true );
+                    indexChange = new IndexChange( presenceIdx, attributeOid, id, IndexChange.Type.ADD,
true );
                     changeContainer.addChange( indexChange );
                 }
             }
@@ -387,7 +379,7 @@ public class DefaultOperationExecutionMa
 
             for ( Value<?> value : objectClass )
             {
-                indexChange = new IndexChange( objectClassIdx, SchemaConstants.OBJECT_CLASS_AT_OID,
value.getString(),
+                indexChange = new IndexChange( objectClassIdx, value.getString(),
                     id, IndexChange.Type.DELETE, true );
                 changeContainer.addChange( indexChange );
             }
@@ -407,14 +399,13 @@ public class DefaultOperationExecutionMa
             }
 
             Index<?> rdnIdx = partition.getSystemIndex( ApacheSchemaConstants.APACHE_RDN_AT_OID
);
-            indexChange = new IndexChange( rdnIdx, ApacheSchemaConstants.APACHE_RDN_AT_OID,
key, id,
+            indexChange = new IndexChange( rdnIdx, key, id,
                 IndexChange.Type.DELETE, true );
             changeContainer.addChange( indexChange );
 
             // Handle one level idx
             Index<?> oneLevelIdx = partition.getSystemIndex( ApacheSchemaConstants.APACHE_ONE_LEVEL_AT_OID
);
-            indexChange = new IndexChange( oneLevelIdx, ApacheSchemaConstants.APACHE_ONE_LEVEL_AT_OID,
parentId, id,
-                IndexChange.Type.DELETE, true );
+            indexChange = new IndexChange( oneLevelIdx, parentId, id, IndexChange.Type.DELETE,
true );
             changeContainer.addChange( indexChange );
 
             // Handle Sublevel idx
@@ -430,8 +421,8 @@ public class DefaultOperationExecutionMa
                 while ( indexCursor.next() )
                 {
                     indexEntry = indexCursor.get();
-                    indexChange = new IndexChange( subLevelIdx, ApacheSchemaConstants.APACHE_SUB_LEVEL_AT_OID,
-                        indexEntry.getValue(), id, IndexChange.Type.DELETE, true );
+                    indexChange = new IndexChange( subLevelIdx, indexEntry.getValue(), id,
IndexChange.Type.DELETE,
+                        true );
                     changeContainer.addChange( indexChange );
                 }
             }
@@ -442,14 +433,12 @@ public class DefaultOperationExecutionMa
             // Handle the csn index
             String entryCsn = entry.get( SchemaConstants.ENTRY_CSN_AT ).getString();
             Index<?> entryCsnIdx = partition.getSystemIndex( SchemaConstants.ENTRY_CSN_AT_OID
);
-            indexChange = new IndexChange( entryCsnIdx, SchemaConstants.ENTRY_CSN_AT_OID,
entryCsn, id,
-                IndexChange.Type.DELETE, true );
+            indexChange = new IndexChange( entryCsnIdx, entryCsn, id, IndexChange.Type.DELETE,
true );
             changeContainer.addChange( indexChange );
 
             // Handle the uuid idx
             Index<?> entryUuidIdx = partition.getSystemIndex( SchemaConstants.ENTRY_UUID_AT_OID
);
-            indexChange = new IndexChange( entryUuidIdx, SchemaConstants.ENTRY_UUID_AT_OID,
id.toString(), id,
-                IndexChange.Type.DELETE, true );
+            indexChange = new IndexChange( entryUuidIdx, id.toString(), id, IndexChange.Type.DELETE,
true );
             changeContainer.addChange( indexChange );
 
             // Update the user indexes
@@ -469,14 +458,12 @@ public class DefaultOperationExecutionMa
                     // the entry via the enumeration - it's in there as is for sure
                     for ( Value<?> value : attribute )
                     {
-                        indexChange = new IndexChange( index, attributeOid, value.getValue(),
id,
-                            IndexChange.Type.DELETE, false );
+                        indexChange = new IndexChange( index, value.getValue(), id, IndexChange.Type.DELETE,
false );
                         changeContainer.addChange( indexChange );
                     }
 
                     // Adds only those attributes that are indexed
-                    indexChange = new IndexChange( presenceIdx, ApacheSchemaConstants.APACHE_PRESENCE_AT_OID,
-                        attributeOid, id, IndexChange.Type.DELETE, true );
+                    indexChange = new IndexChange( presenceIdx, attributeOid, id, IndexChange.Type.DELETE,
true );
                     changeContainer.addChange( indexChange );
                 }
             }
@@ -608,9 +595,10 @@ public class DefaultOperationExecutionMa
         if ( modsOid.equals( SchemaConstants.OBJECT_CLASS_AT_OID ) )
         {
             index = partition.getSystemIndex( attributeType );
+
             for ( Value<?> value : mods )
             {
-                indexChange = new IndexChange( index, modsOid, value.getString(), id, IndexChange.Type.ADD,
true );
+                indexChange = new IndexChange( index, value.getString(), id, IndexChange.Type.ADD,
true );
                 changeContainer.addChange( indexChange );
             }
         }
@@ -621,7 +609,7 @@ public class DefaultOperationExecutionMa
             for ( Value<?> value : mods )
             {
                 ( ( Index<Object> ) index ).add( value.getValue(), id );
-                indexChange = new IndexChange( index, modsOid, value, id, IndexChange.Type.ADD,
false );
+                indexChange = new IndexChange( index, value, id, IndexChange.Type.ADD, false
);
             }
 
             // If the attr didn't exist for this id then created a log edit for an add for
the presence index
@@ -629,8 +617,7 @@ public class DefaultOperationExecutionMa
             {
                 Index<?> presenceIdx;
                 presenceIdx = partition.getSystemIndex( ApacheSchemaConstants.APACHE_PRESENCE_AT_OID
);
-                indexChange = new IndexChange( presenceIdx, ApacheSchemaConstants.APACHE_PRESENCE_AT_OID,
modsOid, id,
-                    IndexChange.Type.ADD, true );
+                indexChange = new IndexChange( presenceIdx, modsOid, id, IndexChange.Type.ADD,
true );
                 changeContainer.addChange( indexChange );
             }
         }
@@ -708,7 +695,7 @@ public class DefaultOperationExecutionMa
                 while ( indexCursor.next() )
                 {
                     indexEntry = indexCursor.get();
-                    indexChange = new IndexChange( objectClassIdx, modsOid, indexEntry.getValue(),
id,
+                    indexChange = new IndexChange( objectClassIdx, indexEntry.getValue(),
id,
                         IndexChange.Type.DELETE, true );
                     changeContainer.addChange( indexChange );
                 }
@@ -720,7 +707,7 @@ public class DefaultOperationExecutionMa
 
             for ( Value<?> value : mods )
             {
-                indexChange = new IndexChange( objectClassIdx, modsOid, value.getString(),
id, IndexChange.Type.ADD,
+                indexChange = new IndexChange( objectClassIdx, value.getString(), id, IndexChange.Type.ADD,
                     true );
                 changeContainer.addChange( indexChange );
             }
@@ -740,7 +727,7 @@ public class DefaultOperationExecutionMa
                 while ( indexCursor.next() )
                 {
                     indexEntry = indexCursor.get();
-                    indexChange = new IndexChange( index, modsOid, indexEntry.getValue(),
id, IndexChange.Type.DELETE,
+                    indexChange = new IndexChange( index, indexEntry.getValue(), id, IndexChange.Type.DELETE,
                         false );
                     changeContainer.addChange( indexChange );
                 }
@@ -752,7 +739,7 @@ public class DefaultOperationExecutionMa
 
             for ( Value<?> value : mods )
             {
-                indexChange = new IndexChange( index, modsOid, value.getValue(), id, IndexChange.Type.ADD,
false );
+                indexChange = new IndexChange( index, value.getValue(), id, IndexChange.Type.ADD,
false );
                 changeContainer.addChange( indexChange );
             }
             /*
@@ -763,16 +750,14 @@ public class DefaultOperationExecutionMa
             {
                 Index<?> presenceIdx;
                 presenceIdx = partition.getSystemIndex( ApacheSchemaConstants.APACHE_PRESENCE_AT_OID
);
-                indexChange = new IndexChange( presenceIdx, ApacheSchemaConstants.APACHE_PRESENCE_AT_OID,
modsOid, id,
-                    IndexChange.Type.DELETE, true );
+                indexChange = new IndexChange( presenceIdx, modsOid, id, IndexChange.Type.DELETE,
true );
                 changeContainer.addChange( indexChange );
             }
             else if ( ( mods.size() > 0 ) && prevValueExists == false )
             {
                 Index<?> presenceIdx;
                 presenceIdx = partition.getSystemIndex( ApacheSchemaConstants.APACHE_PRESENCE_AT_OID
);
-                indexChange = new IndexChange( presenceIdx, ApacheSchemaConstants.APACHE_PRESENCE_AT_OID,
modsOid, id,
-                    IndexChange.Type.ADD, true );
+                indexChange = new IndexChange( presenceIdx, modsOid, id, IndexChange.Type.ADD,
true );
                 changeContainer.addChange( indexChange );
             }
         }
@@ -780,11 +765,11 @@ public class DefaultOperationExecutionMa
         {
             Index<?> entryCsnIdx;
             entryCsnIdx = partition.getSystemIndex( SchemaConstants.ENTRY_CSN_AT_OID );
-            indexChange = new IndexChange( entryCsnIdx, modsOid, entry.get( SchemaConstants.ENTRY_CSN_AT
).getString(),
+            indexChange = new IndexChange( entryCsnIdx, entry.get( SchemaConstants.ENTRY_CSN_AT
).getString(),
                 id, IndexChange.Type.DELETE, true );
             changeContainer.addChange( indexChange );
 
-            indexChange = new IndexChange( entryCsnIdx, modsOid, mods.getString(), id, IndexChange.Type.ADD,
true );
+            indexChange = new IndexChange( entryCsnIdx, mods.getString(), id, IndexChange.Type.ADD,
true );
             changeContainer.addChange( indexChange );
         }
 
@@ -880,7 +865,7 @@ public class DefaultOperationExecutionMa
                     while ( indexCursor.next() )
                     {
                         indexEntry = indexCursor.get();
-                        indexChange = new IndexChange( objectClassIdx, modsOid, indexEntry.getValue(),
id,
+                        indexChange = new IndexChange( objectClassIdx, indexEntry.getValue(),
id,
                             IndexChange.Type.DELETE, true );
                         changeContainer.addChange( indexChange );
                     }
@@ -894,7 +879,7 @@ public class DefaultOperationExecutionMa
             {
                 for ( Value<?> value : mods )
                 {
-                    indexChange = new IndexChange( objectClassIdx, modsOid, value.getString(),
id,
+                    indexChange = new IndexChange( objectClassIdx, value.getString(), id,
                         IndexChange.Type.DELETE, true );
                     changeContainer.addChange( indexChange );
                 }
@@ -922,7 +907,7 @@ public class DefaultOperationExecutionMa
                     while ( indexCursor.next() )
                     {
                         indexEntry = indexCursor.get();
-                        indexChange = new IndexChange( index, modsOid, indexEntry.getValue(),
id,
+                        indexChange = new IndexChange( index, indexEntry.getValue(), id,
                             IndexChange.Type.DELETE, false );
                         changeContainer.addChange( indexChange );
                     }
@@ -936,9 +921,7 @@ public class DefaultOperationExecutionMa
                 {
                     Index<?> presenceIdx;
                     presenceIdx = partition.getSystemIndex( ApacheSchemaConstants.APACHE_PRESENCE_AT_OID
);
-                    indexChange = new IndexChange( presenceIdx, ApacheSchemaConstants.APACHE_PRESENCE_AT_OID,
modsOid,
-                        id,
-                        IndexChange.Type.DELETE, true );
+                    indexChange = new IndexChange( presenceIdx, modsOid, id, IndexChange.Type.DELETE,
true );
                     changeContainer.addChange( indexChange );
                 }
             }
@@ -946,7 +929,7 @@ public class DefaultOperationExecutionMa
             {
                 for ( Value<?> value : mods )
                 {
-                    indexChange = new IndexChange( index, modsOid, value.getValue(), id,
IndexChange.Type.DELETE, false );
+                    indexChange = new IndexChange( index, value.getValue(), id, IndexChange.Type.DELETE,
false );
                     changeContainer.addChange( indexChange );
                 }
 
@@ -958,9 +941,7 @@ public class DefaultOperationExecutionMa
                 {
                     Index<?> presenceIdx;
                     presenceIdx = partition.getSystemIndex( ApacheSchemaConstants.APACHE_PRESENCE_AT_OID
);
-                    indexChange = new IndexChange( presenceIdx, ApacheSchemaConstants.APACHE_PRESENCE_AT_OID,
modsOid,
-                        id,
-                        IndexChange.Type.DELETE, true );
+                    indexChange = new IndexChange( presenceIdx, modsOid, id, IndexChange.Type.DELETE,
true );
                     changeContainer.addChange( indexChange );
                 }
             }
@@ -1163,8 +1144,8 @@ public class DefaultOperationExecutionMa
         }
 
         // Add the alias to the simple alias index
-        indexChange = new IndexChange( aliasIdx, ApacheSchemaConstants.APACHE_ALIAS_AT_OID,
-            normalizedAliasTargetDn.getNormName(), aliasId, IndexChange.Type.ADD, true );
+        indexChange = new IndexChange( aliasIdx, normalizedAliasTargetDn.getNormName(), aliasId,
IndexChange.Type.ADD,
+            true );
         changeContainer.addChange( indexChange );
 
         /*
@@ -1183,8 +1164,7 @@ public class DefaultOperationExecutionMa
         if ( !aliasDn.isDescendantOf( normalizedAliasTargetParentDn ) )
         {
             Index<?> oneAliasIdx = partition.getSystemIndex( ApacheSchemaConstants.APACHE_ONE_ALIAS_AT_OID
);
-            indexChange = new IndexChange( oneAliasIdx, ApacheSchemaConstants.APACHE_ONE_ALIAS_AT_OID,
ancestorId,
-                targetId, IndexChange.Type.ADD, true );
+            indexChange = new IndexChange( oneAliasIdx, ancestorId, targetId, IndexChange.Type.ADD,
true );
             changeContainer.addChange( indexChange );
         }
 
@@ -1205,8 +1185,7 @@ public class DefaultOperationExecutionMa
         {
             if ( !normalizedAliasTargetDn.isDescendantOf( ancestorDn ) )
             {
-                indexChange = new IndexChange( subAliasIdx, ApacheSchemaConstants.APACHE_SUB_ALIAS_AT_OID,
ancestorId,
-                    targetId, IndexChange.Type.ADD, true );
+                indexChange = new IndexChange( subAliasIdx, ancestorId, targetId, IndexChange.Type.ADD,
true );
                 changeContainer.addChange( indexChange );
             }
 
@@ -1274,8 +1253,7 @@ public class DefaultOperationExecutionMa
 
         if ( ( ( Index<Object> ) oneAliasIdx ).forward( ancestorId, targetId ) )
         {
-            indexChange = new IndexChange( oneAliasIdx, ApacheSchemaConstants.APACHE_ONE_ALIAS_AT_OID,
ancestorId,
-                targetId, IndexChange.Type.DELETE, true );
+            indexChange = new IndexChange( oneAliasIdx, ancestorId, targetId, IndexChange.Type.DELETE,
true );
             changeContainer.addChange( indexChange );
         }
 
@@ -1285,8 +1263,7 @@ public class DefaultOperationExecutionMa
 
         if ( ( ( Index<Object> ) subAliasIdx ).forward( ancestorId, targetId ) )
         {
-            indexChange = new IndexChange( subAliasIdx, ApacheSchemaConstants.APACHE_SUB_ALIAS_AT_OID,
ancestorId,
-                targetId, IndexChange.Type.DELETE, true );
+            indexChange = new IndexChange( subAliasIdx, ancestorId, targetId, IndexChange.Type.DELETE,
true );
             changeContainer.addChange( indexChange );
         }
 
@@ -1299,15 +1276,13 @@ public class DefaultOperationExecutionMa
 
             if ( ( ( Index<Object> ) subAliasIdx ).forward( ancestorId, targetId )
)
             {
-                indexChange = new IndexChange( subAliasIdx, ApacheSchemaConstants.APACHE_SUB_ALIAS_AT_OID,
ancestorId,
-                    targetId, IndexChange.Type.DELETE, true );
+                indexChange = new IndexChange( subAliasIdx, ancestorId, targetId, IndexChange.Type.DELETE,
true );
                 changeContainer.addChange( indexChange );
             }
         }
 
         // Drops the alias index entry
-        indexChange = new IndexChange( aliasIdx, ApacheSchemaConstants.APACHE_ALIAS_AT_OID,
targetDn, aliasId,
-            IndexChange.Type.DELETE, true );
+        indexChange = new IndexChange( aliasIdx, targetDn, aliasId, IndexChange.Type.DELETE,
true );
         changeContainer.addChange( indexChange );
     }
 
@@ -1993,8 +1968,7 @@ public class DefaultOperationExecutionMa
         {
             for ( UUID cid : childIds )
             {
-                indexChange = new IndexChange( subLevelIdx, ApacheSchemaConstants.APACHE_SUB_LEVEL_AT_OID,
pid, cid,
-                    IndexChange.Type.DELETE, true );
+                indexChange = new IndexChange( subLevelIdx, pid, cid, IndexChange.Type.DELETE,
true );
                 changeContainer.addChange( indexChange );
             }
         }
@@ -2014,8 +1988,7 @@ public class DefaultOperationExecutionMa
         {
             for ( UUID cid : childIds )
             {
-                indexChange = new IndexChange( subLevelIdx, ApacheSchemaConstants.APACHE_SUB_LEVEL_AT_OID,
id, cid,
-                    IndexChange.Type.ADD, true );
+                indexChange = new IndexChange( subLevelIdx, id, cid, IndexChange.Type.ADD,
true );
                 changeContainer.addChange( indexChange );
             }
         }
@@ -2045,14 +2018,10 @@ public class DefaultOperationExecutionMa
          */
         Index<?> oneLevelIdx = partition.getSystemIndex( ApacheSchemaConstants.APACHE_ONE_LEVEL_AT_OID
);
 
-        indexChange = new IndexChange( oneLevelIdx, ApacheSchemaConstants.APACHE_ONE_LEVEL_AT_OID,
oldParentId,
-            entryId,
-            IndexChange.Type.DELETE, true );
+        indexChange = new IndexChange( oneLevelIdx, oldParentId, entryId, IndexChange.Type.DELETE,
true );
         changeContainer.addChange( indexChange );
 
-        indexChange = new IndexChange( oneLevelIdx, ApacheSchemaConstants.APACHE_ONE_LEVEL_AT_OID,
newParentId,
-            entryId,
-            IndexChange.Type.ADD, true );
+        indexChange = new IndexChange( oneLevelIdx, newParentId, entryId, IndexChange.Type.ADD,
true );
         changeContainer.addChange( indexChange );
 
         updateSubLevelIndex( partition, entryId, oldParentId, newParentId, changeContainer
);
@@ -2061,13 +2030,11 @@ public class DefaultOperationExecutionMa
         Index<?> rdnIdx = partition.getSystemIndex( ApacheSchemaConstants.APACHE_RDN_AT_OID
);
 
         ParentIdAndRdn oldKey = new ParentIdAndRdn( oldParentId, newDn.getRdn() );
-        indexChange = new IndexChange( rdnIdx, ApacheSchemaConstants.APACHE_RDN_AT_OID, oldKey,
entryId,
-            IndexChange.Type.DELETE, true );
+        indexChange = new IndexChange( rdnIdx, oldKey, entryId, IndexChange.Type.DELETE,
true );
         changeContainer.addChange( indexChange );
 
         ParentIdAndRdn newKey = new ParentIdAndRdn( newParentId, newDn.getRdn() );
-        indexChange = new IndexChange( rdnIdx, ApacheSchemaConstants.APACHE_RDN_AT_OID, newKey,
entryId,
-            IndexChange.Type.ADD, true );
+        indexChange = new IndexChange( rdnIdx, newKey, entryId, IndexChange.Type.ADD, true
);
         changeContainer.addChange( indexChange );
 
         /*
@@ -2162,8 +2129,7 @@ public class DefaultOperationExecutionMa
 
                 if ( !( ( Index<Object> ) index ).forward( newNormValue, id ) )
                 {
-                    indexChange = new IndexChange( index, newNormType, newNormValue, id,
-                        IndexChange.Type.ADD, true );
+                    indexChange = new IndexChange( index, newNormValue, id, IndexChange.Type.ADD,
true );
                     changeContainer.addChange( indexChange );
                 }
 
@@ -2174,9 +2140,7 @@ public class DefaultOperationExecutionMa
                 {
                     Index<?> presenceIdx;
                     presenceIdx = partition.getSystemIndex( ApacheSchemaConstants.APACHE_PRESENCE_AT_OID
);
-                    indexChange = new IndexChange( presenceIdx, ApacheSchemaConstants.APACHE_PRESENCE_AT_OID,
-                        newNormType, id,
-                        IndexChange.Type.ADD, false );
+                    indexChange = new IndexChange( presenceIdx, newNormType, id, IndexChange.Type.ADD,
false );
                     changeContainer.addChange( indexChange );
                 }
             }
@@ -2232,8 +2196,7 @@ public class DefaultOperationExecutionMa
                     if ( partition.hasUserIndexOn( oldRdnAttrType ) )
                     {
                         Index<?> index = partition.getUserIndex( oldRdnAttrType );
-                        indexChange = new IndexChange( index, oldNormType, oldNormValue,
id,
-                            IndexChange.Type.DELETE, false );
+                        indexChange = new IndexChange( index, oldNormValue, id, IndexChange.Type.DELETE,
false );
                         changeContainer.addChange( indexChange );
 
                         /*
@@ -2246,9 +2209,7 @@ public class DefaultOperationExecutionMa
                         {
                             Index<?> presenceIdx;
                             presenceIdx = partition.getSystemIndex( ApacheSchemaConstants.APACHE_PRESENCE_AT_OID
);
-                            indexChange = new IndexChange( presenceIdx, ApacheSchemaConstants.APACHE_PRESENCE_AT_OID,
-                                oldNormType, id,
-                                IndexChange.Type.DELETE, true );
+                            indexChange = new IndexChange( presenceIdx, oldNormType, id,
IndexChange.Type.DELETE, true );
                             changeContainer.addChange( indexChange );
                         }
                     }
@@ -2267,13 +2228,11 @@ public class DefaultOperationExecutionMa
         UUID parentId = UUID.fromString( entry.get( SchemaConstants.ENTRY_PARENT_ID_AT ).getString()
);
 
         ParentIdAndRdn oldKey = new ParentIdAndRdn( parentId, updn.getRdn() );
-        indexChange = new IndexChange( rdnIdx, ApacheSchemaConstants.APACHE_RDN_AT_OID, oldKey,
id,
-            IndexChange.Type.DELETE, true );
+        indexChange = new IndexChange( rdnIdx, oldKey, id, IndexChange.Type.DELETE, true
);
         changeContainer.addChange( indexChange );
 
         ParentIdAndRdn key = new ParentIdAndRdn( parentId, newRdn );
-        indexChange = new IndexChange( rdnIdx, ApacheSchemaConstants.APACHE_RDN_AT_OID, key,
id,
-            IndexChange.Type.ADD, true );
+        indexChange = new IndexChange( rdnIdx, key, id, IndexChange.Type.ADD, true );
         changeContainer.addChange( indexChange );
 
         /*

Modified: directory/apacheds/branches/apacheds-txns/core-shared/src/main/java/org/apache/directory/server/core/shared/partition/DefaultPartitionNexus.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/core-shared/src/main/java/org/apache/directory/server/core/shared/partition/DefaultPartitionNexus.java?rev=1227539&r1=1227538&r2=1227539&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/core-shared/src/main/java/org/apache/directory/server/core/shared/partition/DefaultPartitionNexus.java
(original)
+++ directory/apacheds/branches/apacheds-txns/core-shared/src/main/java/org/apache/directory/server/core/shared/partition/DefaultPartitionNexus.java
Thu Jan  5 10:17:30 2012
@@ -143,7 +143,7 @@ public class DefaultPartitionNexus exten
     private Dn subschemSubentryDn;
 
     /** Operation Execution Manager */
-    OperationExecutionManager operationExecutionManager;
+    private OperationExecutionManager operationExecutionManager;
 
 
     /**

Modified: directory/apacheds/branches/apacheds-txns/core-shared/src/main/java/org/apache/directory/server/core/shared/partition/OperationExecutionManagerFactory.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/core-shared/src/main/java/org/apache/directory/server/core/shared/partition/OperationExecutionManagerFactory.java?rev=1227539&r1=1227538&r2=1227539&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/core-shared/src/main/java/org/apache/directory/server/core/shared/partition/OperationExecutionManagerFactory.java
(original)
+++ directory/apacheds/branches/apacheds-txns/core-shared/src/main/java/org/apache/directory/server/core/shared/partition/OperationExecutionManagerFactory.java
Thu Jan  5 10:17:30 2012
@@ -19,27 +19,34 @@
  */
 package org.apache.directory.server.core.shared.partition;
 
+
 import org.apache.directory.server.core.api.partition.OperationExecutionManager;
 import org.apache.directory.server.core.shared.txn.TxnManagerFactory;
 
+
+/**
+ * @TODO add doc
+ * 
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
 public class OperationExecutionManagerFactory
 {
     /** Operation Manager instance */
     private OperationExecutionManager executionManager;
-    
-    
-    public  OperationExecutionManagerFactory( TxnManagerFactory txnManagerFactory )
-    {    
+
+
+    public OperationExecutionManagerFactory( TxnManagerFactory txnManagerFactory )
+    {
         executionManager = new DefaultOperationExecutionManager( txnManagerFactory );
     }
-    
-    
+
+
     public void uninit()
     {
         //do nothing;
     }
-    
-    
+
+
     public OperationExecutionManager instance()
     {
         return executionManager;

Modified: directory/apacheds/branches/apacheds-txns/core-shared/src/main/java/org/apache/directory/server/core/shared/txn/logedit/IndexChange.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/core-shared/src/main/java/org/apache/directory/server/core/shared/txn/logedit/IndexChange.java?rev=1227539&r1=1227538&r2=1227539&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/core-shared/src/main/java/org/apache/directory/server/core/shared/txn/logedit/IndexChange.java
(original)
+++ directory/apacheds/branches/apacheds-txns/core-shared/src/main/java/org/apache/directory/server/core/shared/txn/logedit/IndexChange.java
Thu Jan  5 10:17:30 2012
@@ -62,10 +62,10 @@ public class IndexChange implements Inde
     }
 
 
-    public IndexChange( Index<?> index, String oid, Object key, UUID id, Type type,
boolean isSystemIndex )
+    public IndexChange( Index<?> index, Object key, UUID id, Type type, boolean isSystemIndex
)
     {
         this.index = index;
-        this.oid = oid;
+        this.oid = index.getAttributeId();
         this.key = key;
         this.id = id;
         this.type = type;

Modified: directory/apacheds/branches/apacheds-txns/core-shared/src/test/java/org/apache/directory/server/core/shared/txn/IndexCursorWrapperTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/core-shared/src/test/java/org/apache/directory/server/core/shared/txn/IndexCursorWrapperTest.java?rev=1227539&r1=1227538&r2=1227539&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/core-shared/src/test/java/org/apache/directory/server/core/shared/txn/IndexCursorWrapperTest.java
(original)
+++ directory/apacheds/branches/apacheds-txns/core-shared/src/test/java/org/apache/directory/server/core/shared/txn/IndexCursorWrapperTest.java
Thu Jan  5 10:17:30 2012
@@ -20,34 +20,30 @@
 package org.apache.directory.server.core.shared.txn;
 
 
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
 import java.io.File;
 import java.io.IOException;
 import java.util.TreeSet;
 import java.util.UUID;
 
+import org.apache.directory.server.core.api.log.InvalidLogException;
 import org.apache.directory.server.core.api.partition.index.ForwardIndexComparator;
 import org.apache.directory.server.core.api.partition.index.ForwardIndexEntry;
-import org.apache.directory.server.core.api.partition.index.IndexEntry;
 import org.apache.directory.server.core.api.partition.index.GenericIndex;
-import org.apache.directory.server.core.api.partition.index.ReverseIndexComparator;
 import org.apache.directory.server.core.api.partition.index.IndexCursor;
+import org.apache.directory.server.core.api.partition.index.IndexEntry;
+import org.apache.directory.server.core.api.partition.index.ReverseIndexComparator;
 import org.apache.directory.server.core.api.txn.TxnLogManager;
-
-import org.apache.directory.server.core.api.log.InvalidLogException;
-
+import org.apache.directory.server.core.shared.txn.logedit.DataChangeContainer;
+import org.apache.directory.server.core.shared.txn.logedit.IndexChange;
 import org.apache.directory.shared.ldap.model.name.Dn;
-
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Rule;
-import org.junit.rules.TemporaryFolder;
 import org.junit.Test;
-
-import org.apache.directory.server.core.shared.txn.logedit.IndexChange;
-import org.apache.directory.server.core.shared.txn.logedit.DataChangeContainer;
-
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
+import org.junit.rules.TemporaryFolder;
 
 
 public class IndexCursorWrapperTest
@@ -91,10 +87,9 @@ public class IndexCursorWrapperTest
 
     /** UUID string */
     UUID baseUUID = UUID.fromString( "00000000-0000-0000-0000-000000000001" );
-    
+
     @Rule
     public TemporaryFolder folder = new TemporaryFolder();
-   
 
 
     /**
@@ -146,7 +141,7 @@ public class IndexCursorWrapperTest
                 }
             }
 
-            cursor = new TxnIndexCursor( changedSet, true, null, null, ( ForwardIndexComparator<Object>
)comparator );
+            cursor = new TxnIndexCursor( changedSet, true, null, null, ( ForwardIndexComparator<Object>
) comparator );
 
             IndexChange idxChange;
 
@@ -155,17 +150,17 @@ public class IndexCursorWrapperTest
             txnManager.beginTransaction( false );
 
             // Add (5,5) missing in the original index 
-            idxChange = new IndexChange( mockIndex, attributeOid, new Long( 5 ), getUUIDString(
5 ),
+            idxChange = new IndexChange( mockIndex, new Long( 5 ), getUUIDString( 5 ),
                 IndexChange.Type.ADD, true );
             changeContainer.getChanges().add( idxChange );
 
             // Add (10,11) missing in the original index 
-            idxChange = new IndexChange( mockIndex, attributeOid, new Long( 10 ), getUUIDString(
11 ),
+            idxChange = new IndexChange( mockIndex, new Long( 10 ), getUUIDString( 11 ),
                 IndexChange.Type.ADD, true );
             changeContainer.getChanges().add( idxChange );
 
             // Delete (6,6) existing in the original index 
-            idxChange = new IndexChange( mockIndex, attributeOid, new Long( 6 ), getUUIDString(
6 ),
+            idxChange = new IndexChange( mockIndex, new Long( 6 ), getUUIDString( 6 ),
                 IndexChange.Type.DELETE, true );
             changeContainer.getChanges().add( idxChange );
 
@@ -179,17 +174,17 @@ public class IndexCursorWrapperTest
             txnManager.beginTransaction( false );
 
             // Add (4,5) already existing in the original index 
-            idxChange = new IndexChange( mockIndex, attributeOid, new Long( 4 ), getUUIDString(
5 ),
+            idxChange = new IndexChange( mockIndex, new Long( 4 ), getUUIDString( 5 ),
                 IndexChange.Type.ADD, true );
             changeContainer.getChanges().add( idxChange );
 
             // Re add (0,1) missing in the original index 
-            idxChange = new IndexChange( mockIndex, attributeOid, new Long( 0 ), getUUIDString(
1 ),
+            idxChange = new IndexChange( mockIndex, new Long( 0 ), getUUIDString( 1 ),
                 IndexChange.Type.ADD, true );
             changeContainer.getChanges().add( idxChange );
 
             // Delete (10,11) added by the previous txn 
-            idxChange = new IndexChange( mockIndex, attributeOid, new Long( 10 ), getUUIDString(
11 ),
+            idxChange = new IndexChange( mockIndex, new Long( 10 ), getUUIDString( 11 ),
                 IndexChange.Type.DELETE, true );
             changeContainer.getChanges().add( idxChange );
 
@@ -200,7 +195,8 @@ public class IndexCursorWrapperTest
             // Begin a read only txn and prepare the cursor wrapper 
             txnManager.beginTransaction( true );
 
-            cursorWrapper = ( IndexCursor<Object> ) txnLogManager.wrap( dn, cursor,
( ForwardIndexComparator<Object> ) comparator,
+            cursorWrapper = ( IndexCursor<Object> ) txnLogManager.wrap( dn, cursor,
+                ( ForwardIndexComparator<Object> ) comparator,
                 attributeOid, true, null, null );
 
         }
@@ -217,7 +213,7 @@ public class IndexCursorWrapperTest
     public void teardown() throws IOException
     {
         Utils.deleteDirectory( new File( getLogFolder() ) );
-        
+
         try
         {
             txnManager.commitTransaction();
@@ -256,7 +252,7 @@ public class IndexCursorWrapperTest
 
             next = cursorWrapper.get();
             assertTrue( next.getValue().equals( new Long( 5 ) ) );
-            assertTrue( next.getId().equals( getUUIDString(  5 ) ) );
+            assertTrue( next.getId().equals( getUUIDString( 5 ) ) );
         }
         catch ( Exception e )
         {
@@ -383,13 +379,14 @@ public class IndexCursorWrapperTest
             fail();
         }
     }
-    
+
+
     private UUID getUUIDString( int idx )
     {
         long low = baseUUID.getLeastSignificantBits();
         long high = baseUUID.getMostSignificantBits();
         low = low + idx;
-        
+
         return new UUID( high, low );
     }
 
@@ -407,7 +404,7 @@ public class IndexCursorWrapperTest
         }
 
 
-        public ReverseIndexComparator<Long > getReverseIndexEntryComparator()
+        public ReverseIndexComparator<Long> getReverseIndexEntryComparator()
         {
             return new ReverseIndexComparator<Long>( LongComparator.INSTANCE );
         }



Mime
View raw message