directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1201834 [2/2] - in /directory/apacheds/branches/apacheds-txns: core-api/src/main/java/org/apache/directory/server/core/api/partition/ core-api/src/main/java/org/apache/directory/server/core/api/schema/ core-api/src/main/java/org/apache/dir...
Date Mon, 14 Nov 2011 19:20:38 GMT
Modified: directory/apacheds/branches/apacheds-txns/xdbm-partition/pom.xml
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/xdbm-partition/pom.xml?rev=1201834&r1=1201833&r2=1201834&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/xdbm-partition/pom.xml (original)
+++ directory/apacheds/branches/apacheds-txns/xdbm-partition/pom.xml Mon Nov 14 19:20:37 2011
@@ -47,6 +47,11 @@
       <artifactId>apacheds-core-api</artifactId>
     </dependency>
     
+       <dependency>
+      <groupId>${project.groupId}</groupId>
+      <artifactId>apacheds-core-shared</artifactId>
+    </dependency>
+    
     <dependency>
       <groupId>${project.groupId}</groupId>
       <artifactId>apacheds-i18n</artifactId>

Modified: directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/AbstractBTreePartition.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/AbstractBTreePartition.java?rev=1201834&r1=1201833&r2=1201834&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/AbstractBTreePartition.java
(original)
+++ directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/AbstractBTreePartition.java
Mon Nov 14 19:20:37 2011
@@ -62,6 +62,7 @@ import org.apache.directory.server.core.
 import org.apache.directory.server.core.api.partition.index.MasterTable;
 import org.apache.directory.server.core.api.partition.index.ParentIdAndRdn;
 import org.apache.directory.server.core.api.partition.index.UUIDComparator;
+import org.apache.directory.server.core.shared.txn.logedit.DataChangeContainer;
 import org.apache.directory.server.xdbm.Store;
 import org.apache.directory.server.xdbm.search.Optimizer;
 import org.apache.directory.server.xdbm.search.SearchEngine;
@@ -2124,8 +2125,17 @@ public abstract class AbstractBTreeParti
     {
         return systemIndices.keySet().iterator();
     }
+    
+    
+    /**
+     * {@inheritDoc}
+     */
+    public MasterTable getMasterTable() throws Exception
+    {
+        return master;
+    }
 
-
+ 
     /**
      * {@inheritDoc}
      */
@@ -2133,17 +2143,7 @@ public abstract class AbstractBTreeParti
     {
         String id = attributeType.getOid();
 
-        if ( userIndices.containsKey( id ) )
-        {
-            return userIndices.get( id );
-        }
-
-        if ( systemIndices.containsKey( id ) )
-        {
-            return systemIndices.get( id );
-        }
-
-        throw new IndexNotFoundException( I18n.err( I18n.ERR_3, id, id ) );
+        return getIndex( id );
     }
 
 
@@ -2159,15 +2159,10 @@ public abstract class AbstractBTreeParti
 
         String oid = attributeType.getOid();
         
-        if ( userIndices.containsKey( oid ) )
-        {
-            return userIndices.get( oid );
-        }
-
-        throw new IndexNotFoundException( I18n.err( I18n.ERR_3, attributeType, attributeType
) );
+        return getUserIndex( oid );
     }
-
-
+    
+    
     /**
      * {@inheritDoc}
      */
@@ -2180,12 +2175,55 @@ public abstract class AbstractBTreeParti
 
         String oid = attributeType.getOid();
         
+       return getSystemIndex( oid );
+    }
+    
+    
+    /**
+     * {@inheritDoc}
+     */
+    public Index<?> getIndex( String oid ) throws IndexNotFoundException
+    {
+        if ( userIndices.containsKey( oid ) )
+        {
+            return userIndices.get( oid );
+        }
+
         if ( systemIndices.containsKey( oid ) )
         {
             return systemIndices.get( oid );
         }
 
-        throw new IndexNotFoundException( I18n.err( I18n.ERR_2, attributeType, attributeType
) );
+        throw new IndexNotFoundException( I18n.err( I18n.ERR_3, oid, oid ) );
+    }
+    
+    
+    /**
+     * {@inheritDoc}
+     */
+    public Index<?> getUserIndex( String oid ) throws IndexNotFoundException
+    {
+        if ( userIndices.containsKey( oid ) )
+        {
+            return userIndices.get( oid );
+        }
+
+        throw new IndexNotFoundException( I18n.err( I18n.ERR_3, oid, oid ) );
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public Index<?> getSystemIndex( String oid ) throws IndexNotFoundException
+    {
+        if ( systemIndices.containsKey( oid ) )
+        {
+            return systemIndices.get( oid );
+        }
+
+        throw new IndexNotFoundException( I18n.err( I18n.ERR_2, oid, oid ) );
+
     }
 
 
@@ -2294,7 +2332,7 @@ public abstract class AbstractBTreeParti
      */
     public boolean hasUserIndexOn( AttributeType attributeType ) throws LdapException
     {
-        return userIndices.containsKey( attributeType.getOid() );
+        return hasUserIndexOn( attributeType.getOid() );
     }
 
 
@@ -2303,7 +2341,7 @@ public abstract class AbstractBTreeParti
      */
     public boolean hasSystemIndexOn( AttributeType attributeType ) throws LdapException
     {
-        return systemIndices.containsKey( attributeType.getOid() );
+        return hasSystemIndexOn( attributeType.getOid() );
     }
 
 
@@ -2316,6 +2354,33 @@ public abstract class AbstractBTreeParti
     }
     
     
+    /**
+     * {@inheritDoc}
+     */
+    public boolean hasUserIndexOn( String oid ) throws LdapException
+    {
+        return userIndices.containsKey( oid );
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public boolean hasSystemIndexOn( String oid ) throws LdapException
+    {
+        return systemIndices.containsKey( oid );
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public boolean hasIndexOn( String oid ) throws LdapException
+    {
+        return hasUserIndexOn( oid ) || hasSystemIndexOn( oid );
+    }
+    
+    
     //---------------------------------------------------------------------------------------------
     // Alias index manipulation
     //---------------------------------------------------------------------------------------------



Mime
View raw message