Return-Path: X-Original-To: apmail-directory-commits-archive@www.apache.org Delivered-To: apmail-directory-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2FCB295A5 for ; Mon, 14 Nov 2011 19:21:01 +0000 (UTC) Received: (qmail 7858 invoked by uid 500); 14 Nov 2011 19:21:01 -0000 Delivered-To: apmail-directory-commits-archive@directory.apache.org Received: (qmail 7827 invoked by uid 500); 14 Nov 2011 19:21:01 -0000 Mailing-List: contact commits-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@directory.apache.org Delivered-To: mailing list commits@directory.apache.org Received: (qmail 7820 invoked by uid 99); 14 Nov 2011 19:21:01 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 14 Nov 2011 19:21:01 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 14 Nov 2011 19:20:59 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 8D62F238899C for ; Mon, 14 Nov 2011 19:20:39 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: commits@directory.apache.org From: saya@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20111114192039.8D62F238899C@eris.apache.org> 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 @@ apacheds-core-api + + ${project.groupId} + apacheds-core-shared + + ${project.groupId} apacheds-i18n 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 //---------------------------------------------------------------------------------------------