You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by ak...@apache.org on 2004/04/22 04:04:06 UTC
svn commit: rev 10161 - incubator/directory/rms/trunk/je/src/java/org/apache/rms/je/permissions
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 ;
+ }
}