directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: rev 20741 - incubator/directory/rms/trunk/je/src/java/org/apache/rms/je/profile
Date Tue, 01 Jun 2004 18:33:57 GMT
Author: akarasulu
Date: Tue Jun  1 11:33:56 2004
New Revision: 20741

Modified:
   incubator/directory/rms/trunk/je/src/java/org/apache/rms/je/profile/JeProfileDAO.java
Log:
temp save - will fix later

Modified: incubator/directory/rms/trunk/je/src/java/org/apache/rms/je/profile/JeProfileDAO.java
==============================================================================
--- incubator/directory/rms/trunk/je/src/java/org/apache/rms/je/profile/JeProfileDAO.java
(original)
+++ incubator/directory/rms/trunk/je/src/java/org/apache/rms/je/profile/JeProfileDAO.java
Tue Jun  1 11:33:56 2004
@@ -26,10 +26,12 @@
 import org.apache.rms.spi.ProfileRoleLinkDAO;
 import org.apache.rms.je.JeRmsException ;
 import org.apache.rms.je.JeUtils;
+import org.apache.rms.je.JeIterator;
 import org.apache.rms.je.sequence.Sequence ;
 
 import org.apache.commons.lang.Validate ;
 import org.apache.commons.lang.NotImplementedException ;
+import org.apache.commons.collections.iterators.EmptyIterator;
 
 import java.util.List ;
 import java.util.Iterator ;
@@ -339,7 +341,42 @@
      */
     public Iterator listUserNames( String appName ) throws RmsException
     {
-        throw new NotImplementedException( "STUB" ) ;
+        OperationStatus status = null ;
+        DatabaseEntry key = new DatabaseEntry() ;
+        DatabaseEntry value = new DatabaseEntry() ;
+        DatabaseEntry appNameKey = new DatabaseEntry() ;
+
+        try
+        {
+            appNameKey.setData( appName.getBytes( "UTF-8" ) ) ;
+        }
+        catch ( UnsupportedEncodingException e )
+        {
+            monitor.failedOnListUserNames( this, appName, e ) ;
+            throw new RmsException( e ) ;
+        }
+
+        SecondaryCursor appNameCursor = null ;
+        try
+        {
+            // -o- setup the application name cursor -o-
+            appNameCursor = byAppName.openSecondaryCursor( null, null ) ;
+            status = appNameCursor
+                .getSearchKey( appNameKey, value, LockMode.DEFAULT ) ;
+
+            if ( status != OperationStatus.SUCCESS )
+            {
+                closeNoError( appNameCursor ) ;
+                return EmptyIterator.INSTANCE ;
+            }
+        }
+        catch ( DatabaseException e )
+        {
+            monitor.failedOnListUserNames( this, appName, e ) ;
+            throw new RmsException( e ) ;
+        }
+
+        return new JeIterator() ;
     }
 
 

Mime
View raw message