Return-Path: Delivered-To: apmail-incubator-directory-cvs-archive@www.apache.org Received: (qmail 92214 invoked from network); 22 Apr 2004 02:04:07 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 22 Apr 2004 02:04:07 -0000 Received: (qmail 49230 invoked by uid 500); 22 Apr 2004 02:03:49 -0000 Delivered-To: apmail-incubator-directory-cvs-archive@incubator.apache.org Received: (qmail 49186 invoked by uid 500); 22 Apr 2004 02:03:49 -0000 Mailing-List: contact directory-cvs-help@incubator.apache.org; run by ezmlm Precedence: bulk Reply-To: directory-dev@incubator.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list directory-cvs@incubator.apache.org Received: (qmail 49172 invoked from network); 22 Apr 2004 02:03:49 -0000 Received: from unknown (HELO minotaur.apache.org) (209.237.227.194) by daedalus.apache.org with SMTP; 22 Apr 2004 02:03:49 -0000 Received: (qmail 92163 invoked by uid 65534); 22 Apr 2004 02:04:06 -0000 Date: 22 Apr 2004 02:04:06 -0000 Message-ID: <20040422020406.92160.qmail@minotaur.apache.org> From: akarasulu@apache.org To: directory-cvs@incubator.apache.org Subject: svn commit: rev 10161 - incubator/directory/rms/trunk/je/src/java/org/apache/rms/je/permissions X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Author: akarasulu Date: Wed Apr 21 19:04:05 2004 New Revision: 10161 Modified: incubator/directory/rms/trunk/je/src/java/org/apache/rms/je/permissions/BitPermissionIndexManager.java incubator/directory/rms/trunk/je/src/java/org/apache/rms/je/permissions/JeBitPermissionIndexManager.java Log: o added method to automatically find and claim an index in one call Modified: incubator/directory/rms/trunk/je/src/java/org/apache/rms/je/permissions/BitPermissionIndexManager.java ============================================================================== --- incubator/directory/rms/trunk/je/src/java/org/apache/rms/je/permissions/BitPermissionIndexManager.java (original) +++ incubator/directory/rms/trunk/je/src/java/org/apache/rms/je/permissions/BitPermissionIndexManager.java Wed Apr 21 19:04:05 2004 @@ -63,4 +63,13 @@ * @throws RmsException if there are failures accessing the backing store */ void claimIndex( String appName, int index ) throws RmsException ; + + /** + * Automatically claims the lowest available index for an application. + * + * @param appName the name of the application to claim the index for + * @return the next lowest index claimed + * @throws RmsException if there are failures accessing the backing store + */ + int claimIndex( String appName ) throws RmsException ; } Modified: incubator/directory/rms/trunk/je/src/java/org/apache/rms/je/permissions/JeBitPermissionIndexManager.java ============================================================================== --- incubator/directory/rms/trunk/je/src/java/org/apache/rms/je/permissions/JeBitPermissionIndexManager.java (original) +++ incubator/directory/rms/trunk/je/src/java/org/apache/rms/je/permissions/JeBitPermissionIndexManager.java Wed Apr 21 19:04:05 2004 @@ -125,4 +125,20 @@ { dao.put( appName, index ) ; } + + + /** + * Automatically claims the lowest available index for an application. + * + * @param appName the name of the application to claim the index for + * @return the next lowest index claimed + * @throws org.apache.rms.RmsException if there are failures accessing the + * backing store + */ + public int claimIndex( String appName ) throws RmsException + { + int index = getMinFreeIndex( appName ) ; + claimIndex( appName, index ) ; + return index ; + } }