directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: rev 20553 - in incubator/directory/rms/trunk: je/src/java/org/apache/rms/je/role je/src/test/org/apache/rms/je/profile je/src/test/org/apache/rms/je/role spi/src/java/org/apache/rms/spi
Date Fri, 28 May 2004 22:15:51 GMT
Author: akarasulu
Date: Fri May 28 15:15:49 2004
New Revision: 20553

Added:
   incubator/directory/rms/trunk/spi/src/java/org/apache/rms/spi/LoggingProfileDAOMonitor.java
      - copied, changed from rev 20546, incubator/directory/rms/trunk/je/src/java/org/apache/rms/je/profile/LoggingProfileDAOMonitor.java
   incubator/directory/rms/trunk/spi/src/java/org/apache/rms/spi/LoggingProfileRoleLinkDAOMonitor.java
      - copied, changed from rev 20546, incubator/directory/rms/trunk/je/src/java/org/apache/rms/je/profile/LoggingProfileRoleLinkDAOMonitor.java
   incubator/directory/rms/trunk/spi/src/java/org/apache/rms/spi/LoggingRoleDAOMonitor.java
      - copied, changed from rev 20546, incubator/directory/rms/trunk/je/src/java/org/apache/rms/je/role/LoggingRoleDAOMonitor.java
   incubator/directory/rms/trunk/spi/src/java/org/apache/rms/spi/ProfileDAO.java
      - copied, changed from rev 20546, incubator/directory/rms/trunk/je/src/java/org/apache/rms/je/profile/ProfileDAO.java
   incubator/directory/rms/trunk/spi/src/java/org/apache/rms/spi/ProfileDAOMonitor.java
      - copied, changed from rev 20546, incubator/directory/rms/trunk/je/src/java/org/apache/rms/je/profile/ProfileDAOMonitor.java
   incubator/directory/rms/trunk/spi/src/java/org/apache/rms/spi/ProfileDAOMonitorAdapter.java
      - copied, changed from rev 20546, incubator/directory/rms/trunk/je/src/java/org/apache/rms/je/profile/ProfileDAOMonitorAdapter.java
   incubator/directory/rms/trunk/spi/src/java/org/apache/rms/spi/ProfileRoleLinkDAO.java
      - copied, changed from rev 20546, incubator/directory/rms/trunk/je/src/java/org/apache/rms/je/profile/ProfileRoleLinkDAO.java
   incubator/directory/rms/trunk/spi/src/java/org/apache/rms/spi/ProfileRoleLinkDAOMonitor.java
      - copied, changed from rev 20546, incubator/directory/rms/trunk/je/src/java/org/apache/rms/je/profile/ProfileRoleLinkDAOMonitor.java
   incubator/directory/rms/trunk/spi/src/java/org/apache/rms/spi/ProfileRoleLinkDAOMonitorAdapter.java
      - copied, changed from rev 20546, incubator/directory/rms/trunk/je/src/java/org/apache/rms/je/profile/ProfileRoleLinkDAOMonitorAdapter.java
   incubator/directory/rms/trunk/spi/src/java/org/apache/rms/spi/RoleDAO.java
      - copied, changed from rev 20546, incubator/directory/rms/trunk/je/src/java/org/apache/rms/je/role/RoleDAO.java
   incubator/directory/rms/trunk/spi/src/java/org/apache/rms/spi/RoleDAOMonitor.java
      - copied, changed from rev 20546, incubator/directory/rms/trunk/je/src/java/org/apache/rms/je/role/RoleDAOMonitor.java
   incubator/directory/rms/trunk/spi/src/java/org/apache/rms/spi/RoleDAOMonitorAdapter.java
      - copied, changed from rev 20546, incubator/directory/rms/trunk/je/src/java/org/apache/rms/je/role/RoleDAOMonitorAdapter.java
Removed:
   incubator/directory/rms/trunk/je/src/java/org/apache/rms/je/role/LoggingRoleDAOMonitor.java
   incubator/directory/rms/trunk/je/src/java/org/apache/rms/je/role/RoleDAO.java
   incubator/directory/rms/trunk/je/src/java/org/apache/rms/je/role/RoleDAOMonitor.java
   incubator/directory/rms/trunk/je/src/java/org/apache/rms/je/role/RoleDAOMonitorAdapter.java
Modified:
   incubator/directory/rms/trunk/je/src/java/org/apache/rms/je/role/JeRoleDAO.java
   incubator/directory/rms/trunk/je/src/test/org/apache/rms/je/profile/JeProfileRoleLinkDAOTest.java
   incubator/directory/rms/trunk/je/src/test/org/apache/rms/je/role/JeRoleFactoryTest.java
   incubator/directory/rms/trunk/spi/src/java/org/apache/rms/spi/LoggingBitPermissionDAOMonitor.java
Log:
Commit changes ...

 o moved role DAO entities to SPI project
 o moved profile DAO entities to SPI project
 o made changes to test ProfileRoleLinkDAO 



Modified: incubator/directory/rms/trunk/je/src/java/org/apache/rms/je/role/JeRoleDAO.java
==============================================================================
--- incubator/directory/rms/trunk/je/src/java/org/apache/rms/je/role/JeRoleDAO.java	(original)
+++ incubator/directory/rms/trunk/je/src/java/org/apache/rms/je/role/JeRoleDAO.java	Fri May
28 15:15:49 2004
@@ -20,6 +20,9 @@
 import org.apache.rms.Role ;
 import org.apache.rms.Application ;
 import org.apache.rms.RmsException ;
+import org.apache.rms.spi.RoleDAO;
+import org.apache.rms.spi.RoleDAOMonitor;
+import org.apache.rms.spi.RoleDAOMonitorAdapter;
 
 import org.apache.rms.je.JeUtils ;
 import org.apache.rms.je.JeRmsException ;

Modified: incubator/directory/rms/trunk/je/src/test/org/apache/rms/je/profile/JeProfileRoleLinkDAOTest.java
==============================================================================
--- incubator/directory/rms/trunk/je/src/test/org/apache/rms/je/profile/JeProfileRoleLinkDAOTest.java
(original)
+++ incubator/directory/rms/trunk/je/src/test/org/apache/rms/je/profile/JeProfileRoleLinkDAOTest.java
Fri May 28 15:15:49 2004
@@ -161,6 +161,11 @@
         assertFalse( dao.has( "app1", "user2", "roleA" ) ) ;
         assertFalse( dao.isRoleInUse( "app1", "roleA" ) ) ;
 
+        assertFalse( dao.inAnyAppRole( "app1", "user1" ) ) ;
+        assertFalse( dao.inAnyAppRole( "app2", "user1" ) ) ;
+        assertFalse( dao.inAnyAppRole( "app1", "user2" ) ) ;
+        assertFalse( dao.inAnyAppRole( "app2", "user2" ) ) ;
+
         assertFalse( dao.has( "app2", "user1", "roleB" ) ) ;
         assertFalse( dao.has( "app2", "user2", "roleB" ) ) ;
         assertFalse( dao.isRoleInUse( "app2", "roleA" ) ) ;
@@ -174,6 +179,11 @@
         assertTrue( dao.has( "app1", "user2", "roleA" ) ) ;
         assertTrue( dao.isRoleInUse( "app1", "roleA" ) ) ;
         assertFalse( dao.isRoleInUse( "app1", "roleB" ) ) ;
+
+        assertTrue( dao.inAnyAppRole( "app1", "user1" ) ) ;
+        assertTrue( dao.inAnyAppRole( "app2", "user1" ) ) ;
+        assertTrue( dao.inAnyAppRole( "app1", "user2" ) ) ;
+        assertTrue( dao.inAnyAppRole( "app2", "user2" ) ) ;
 
         assertTrue( dao.has( "app2", "user1", "roleB" ) ) ;
         assertTrue( dao.has( "app2", "user2", "roleB" ) ) ;

Modified: incubator/directory/rms/trunk/je/src/test/org/apache/rms/je/role/JeRoleFactoryTest.java
==============================================================================
--- incubator/directory/rms/trunk/je/src/test/org/apache/rms/je/role/JeRoleFactoryTest.java
(original)
+++ incubator/directory/rms/trunk/je/src/test/org/apache/rms/je/role/JeRoleFactoryTest.java
Fri May 28 15:15:49 2004
@@ -23,6 +23,7 @@
 import org.apache.rms.RmsException ;
 import org.apache.rms.spi.ApplicationFactory ;
 import org.apache.rms.spi.MutableApplication ;
+import org.apache.rms.spi.LoggingRoleDAOMonitor;
 
 import org.apache.rms.je.AbstractJeTest ;
 import org.apache.rms.je.sequence.Sequence ;

Modified: incubator/directory/rms/trunk/spi/src/java/org/apache/rms/spi/LoggingBitPermissionDAOMonitor.java
==============================================================================
--- incubator/directory/rms/trunk/spi/src/java/org/apache/rms/spi/LoggingBitPermissionDAOMonitor.java
(original)
+++ incubator/directory/rms/trunk/spi/src/java/org/apache/rms/spi/LoggingBitPermissionDAOMonitor.java
Fri May 28 15:15:49 2004
@@ -648,15 +648,6 @@
 
             if ( log.isDebugEnabled() )
             {
-                if ( prefetched == null )
-                {
-                    name = "null" ;
-                }
-                else
-                {
-                    name = prefetched.toString() ;
-                }
-
                 log.debug( "Iterator " + listing + " created by " + dao
                         + " successfully prefetch a BitPermission name of " + name
                         + " for application " + appName

Copied: incubator/directory/rms/trunk/spi/src/java/org/apache/rms/spi/LoggingProfileDAOMonitor.java
(from rev 20546, incubator/directory/rms/trunk/je/src/java/org/apache/rms/je/profile/LoggingProfileDAOMonitor.java)
==============================================================================
--- incubator/directory/rms/trunk/je/src/java/org/apache/rms/je/profile/LoggingProfileDAOMonitor.java
(original)
+++ incubator/directory/rms/trunk/spi/src/java/org/apache/rms/spi/LoggingProfileDAOMonitor.java
Fri May 28 15:15:49 2004
@@ -14,14 +14,11 @@
  *   limitations under the License.
  *
  */
-package org.apache.rms.je.profile ;
+package org.apache.rms.spi ;
 
 
 import org.apache.commons.logging.Log ;
 import org.apache.commons.logging.LogFactory ;
-import org.apache.commons.lang.NotImplementedException;
-import org.apache.rms.spi.ApplicationDAO ;
-import com.sleepycat.je.OperationStatus;
 
 
 /**

Copied: incubator/directory/rms/trunk/spi/src/java/org/apache/rms/spi/LoggingProfileRoleLinkDAOMonitor.java
(from rev 20546, incubator/directory/rms/trunk/je/src/java/org/apache/rms/je/profile/LoggingProfileRoleLinkDAOMonitor.java)
==============================================================================
--- incubator/directory/rms/trunk/je/src/java/org/apache/rms/je/profile/LoggingProfileRoleLinkDAOMonitor.java
(original)
+++ incubator/directory/rms/trunk/spi/src/java/org/apache/rms/spi/LoggingProfileRoleLinkDAOMonitor.java
Fri May 28 15:15:49 2004
@@ -14,7 +14,7 @@
  *   limitations under the License.
  *
  */
-package org.apache.rms.je.profile ;
+package org.apache.rms.spi ;
 
 
 import org.apache.commons.logging.Log ;

Copied: incubator/directory/rms/trunk/spi/src/java/org/apache/rms/spi/LoggingRoleDAOMonitor.java
(from rev 20546, incubator/directory/rms/trunk/je/src/java/org/apache/rms/je/role/LoggingRoleDAOMonitor.java)
==============================================================================
--- incubator/directory/rms/trunk/je/src/java/org/apache/rms/je/role/LoggingRoleDAOMonitor.java
(original)
+++ incubator/directory/rms/trunk/spi/src/java/org/apache/rms/spi/LoggingRoleDAOMonitor.java
Fri May 28 15:15:49 2004
@@ -14,19 +14,15 @@
  *   limitations under the License.
  *
  */
-package org.apache.rms.je.role ;
+package org.apache.rms.spi ;
 
 
 import java.util.Iterator ;
-import java.io.IOException ;
 
 import org.apache.rms.Role ;
 import org.apache.commons.logging.Log ;
 import org.apache.commons.logging.LogFactory ;
 
-import com.sleepycat.je.DatabaseEntry ;
-import com.sleepycat.bind.EntryBinding ;
-
 
 /**
  * A logging monitor for Role data access objects.
@@ -36,8 +32,6 @@
  */
 public class LoggingRoleDAOMonitor implements RoleDAOMonitor
 {
-    /** the entry <-> object BINDING used for prefetched entry transformation */
-    private static final EntryBinding BINDING = new JeRoleBinding() ;
     /** the log used by this logging monitor */
     private Log log = LogFactory.getLog( RoleDAO.class ) ;
 
@@ -512,21 +506,6 @@
 
             if ( log.isDebugEnabled() )
             {
-                if ( prefetched instanceof DatabaseEntry )
-                {
-                    DatabaseEntry entry = ( DatabaseEntry ) prefetched ;
-                    name = new String( entry.getData() ) ;
-                }
-                else if ( prefetched instanceof String )
-                {
-                    name = ( String ) prefetched ;
-                }
-                else
-                {
-                    throw new IllegalArgumentException( "unknow type "
-                            + prefetched.getClass() ) ;
-                }
-
                 log.debug( "Iterator " + listing + " created by " + dao
                         + " successfully prefetch a Role name of " + name
                         + " for application " + appName
@@ -560,23 +539,6 @@
         {
             if ( log.isDebugEnabled() )
             {
-                if ( prefetched instanceof Role )
-                {
-                    role = ( Role ) prefetched ;
-                }
-                else if ( prefetched instanceof DatabaseEntry )
-                {
-                    try
-                    {
-                        role = ( Role )
-                                BINDING.entryToObject( ( DatabaseEntry ) prefetched ) ;
-                    }
-                    catch ( IOException e )
-                    {
-                        log.error( "Failed to bind database entry to Role" ) ;
-                    }
-                }
-
                 log.debug( "Iterator " + listing + " created by " + dao
                         + " successfully prefetch a Role of " + role
                         + " for application " + appName

Copied: incubator/directory/rms/trunk/spi/src/java/org/apache/rms/spi/ProfileDAO.java (from
rev 20546, incubator/directory/rms/trunk/je/src/java/org/apache/rms/je/profile/ProfileDAO.java)
==============================================================================
--- incubator/directory/rms/trunk/je/src/java/org/apache/rms/je/profile/ProfileDAO.java	(original)
+++ incubator/directory/rms/trunk/spi/src/java/org/apache/rms/spi/ProfileDAO.java	Fri May
28 15:15:49 2004
@@ -14,7 +14,7 @@
  *   limitations under the License.
  *
  */
-package org.apache.rms.je.profile ;
+package org.apache.rms.spi ;
 
 
 import org.apache.rms.Profile ;

Copied: incubator/directory/rms/trunk/spi/src/java/org/apache/rms/spi/ProfileDAOMonitor.java
(from rev 20546, incubator/directory/rms/trunk/je/src/java/org/apache/rms/je/profile/ProfileDAOMonitor.java)
==============================================================================
--- incubator/directory/rms/trunk/je/src/java/org/apache/rms/je/profile/ProfileDAOMonitor.java
(original)
+++ incubator/directory/rms/trunk/spi/src/java/org/apache/rms/spi/ProfileDAOMonitor.java	Fri
May 28 15:15:49 2004
@@ -14,10 +14,7 @@
  *   limitations under the License.
  *
  */
-package org.apache.rms.je.profile ;
-
-
-import com.sleepycat.je.OperationStatus ;
+package org.apache.rms.spi ;
 
 
 /**
@@ -50,7 +47,7 @@
                          Throwable fault ) ;
 
 
-    void failedOnDelete( ProfileDAO dao, OperationStatus status,
+    void failedOnDelete( ProfileDAO dao, Object info,
                          String appName, String userName, Throwable fault ) ;
 
 

Copied: incubator/directory/rms/trunk/spi/src/java/org/apache/rms/spi/ProfileDAOMonitorAdapter.java
(from rev 20546, incubator/directory/rms/trunk/je/src/java/org/apache/rms/je/profile/ProfileDAOMonitorAdapter.java)
==============================================================================
--- incubator/directory/rms/trunk/je/src/java/org/apache/rms/je/profile/ProfileDAOMonitorAdapter.java
(original)
+++ incubator/directory/rms/trunk/spi/src/java/org/apache/rms/spi/ProfileDAOMonitorAdapter.java
Fri May 28 15:15:49 2004
@@ -14,11 +14,10 @@
  *   limitations under the License.
  *
  */
-package org.apache.rms.je.profile ;
+package org.apache.rms.spi ;
 
 
-import org.apache.commons.lang.NotImplementedException;
-import com.sleepycat.je.OperationStatus;
+import org.apache.commons.lang.NotImplementedException ;
 
 
 /**
@@ -82,7 +81,7 @@
     }
 
 
-    public void failedOnDelete( ProfileDAO dao, OperationStatus status,
+    public void failedOnDelete( ProfileDAO dao, Object info,
                                 String appName, String userName,
                                 Throwable fault )
     {

Copied: incubator/directory/rms/trunk/spi/src/java/org/apache/rms/spi/ProfileRoleLinkDAO.java
(from rev 20546, incubator/directory/rms/trunk/je/src/java/org/apache/rms/je/profile/ProfileRoleLinkDAO.java)
==============================================================================
--- incubator/directory/rms/trunk/je/src/java/org/apache/rms/je/profile/ProfileRoleLinkDAO.java
(original)
+++ incubator/directory/rms/trunk/spi/src/java/org/apache/rms/spi/ProfileRoleLinkDAO.java
Fri May 28 15:15:49 2004
@@ -14,7 +14,7 @@
  *   limitations under the License.
  *
  */
-package org.apache.rms.je.profile ;
+package org.apache.rms.spi ;
 
 
 import org.apache.rms.RmsException ;

Copied: incubator/directory/rms/trunk/spi/src/java/org/apache/rms/spi/ProfileRoleLinkDAOMonitor.java
(from rev 20546, incubator/directory/rms/trunk/je/src/java/org/apache/rms/je/profile/ProfileRoleLinkDAOMonitor.java)
==============================================================================
--- incubator/directory/rms/trunk/je/src/java/org/apache/rms/je/profile/ProfileRoleLinkDAOMonitor.java
(original)
+++ incubator/directory/rms/trunk/spi/src/java/org/apache/rms/spi/ProfileRoleLinkDAOMonitor.java
Fri May 28 15:15:49 2004
@@ -14,8 +14,10 @@
  *   limitations under the License.
  *
  */
-package org.apache.rms.je.profile ;
+package org.apache.rms.spi ;
 
+
+import org.apache.rms.spi.ProfileRoleLinkDAO;
 
 import java.util.Iterator ;
 

Copied: incubator/directory/rms/trunk/spi/src/java/org/apache/rms/spi/ProfileRoleLinkDAOMonitorAdapter.java
(from rev 20546, incubator/directory/rms/trunk/je/src/java/org/apache/rms/je/profile/ProfileRoleLinkDAOMonitorAdapter.java)
==============================================================================
--- incubator/directory/rms/trunk/je/src/java/org/apache/rms/je/profile/ProfileRoleLinkDAOMonitorAdapter.java
(original)
+++ incubator/directory/rms/trunk/spi/src/java/org/apache/rms/spi/ProfileRoleLinkDAOMonitorAdapter.java
Fri May 28 15:15:49 2004
@@ -14,8 +14,11 @@
  *   limitations under the License.
  *
  */
-package org.apache.rms.je.profile ;
+package org.apache.rms.spi ;
 
+
+import org.apache.rms.spi.ProfileRoleLinkDAO;
+import org.apache.rms.spi.ProfileRoleLinkDAOMonitor;
 
 import java.util.Iterator ;
 

Copied: incubator/directory/rms/trunk/spi/src/java/org/apache/rms/spi/RoleDAO.java (from rev
20546, incubator/directory/rms/trunk/je/src/java/org/apache/rms/je/role/RoleDAO.java)
==============================================================================
--- incubator/directory/rms/trunk/je/src/java/org/apache/rms/je/role/RoleDAO.java	(original)
+++ incubator/directory/rms/trunk/spi/src/java/org/apache/rms/spi/RoleDAO.java	Fri May 28
15:15:49 2004
@@ -14,7 +14,7 @@
  *   limitations under the License.
  *
  */
-package org.apache.rms.je.role ;
+package org.apache.rms.spi ;
 
 
 import org.apache.rms.Role ;

Copied: incubator/directory/rms/trunk/spi/src/java/org/apache/rms/spi/RoleDAOMonitor.java
(from rev 20546, incubator/directory/rms/trunk/je/src/java/org/apache/rms/je/role/RoleDAOMonitor.java)
==============================================================================
--- incubator/directory/rms/trunk/je/src/java/org/apache/rms/je/role/RoleDAOMonitor.java	(original)
+++ incubator/directory/rms/trunk/spi/src/java/org/apache/rms/spi/RoleDAOMonitor.java	Fri
May 28 15:15:49 2004
@@ -14,12 +14,13 @@
  *   limitations under the License.
  *
  */
-package org.apache.rms.je.role ;
+package org.apache.rms.spi ;
 
 
 import java.util.Iterator ;
 
 import org.apache.rms.Role ;
+import org.apache.rms.spi.RoleDAO;
 
 
 /**

Copied: incubator/directory/rms/trunk/spi/src/java/org/apache/rms/spi/RoleDAOMonitorAdapter.java
(from rev 20546, incubator/directory/rms/trunk/je/src/java/org/apache/rms/je/role/RoleDAOMonitorAdapter.java)
==============================================================================
--- incubator/directory/rms/trunk/je/src/java/org/apache/rms/je/role/RoleDAOMonitorAdapter.java
(original)
+++ incubator/directory/rms/trunk/spi/src/java/org/apache/rms/spi/RoleDAOMonitorAdapter.java
Fri May 28 15:15:49 2004
@@ -14,10 +14,12 @@
  *   limitations under the License.
  *
  */
-package org.apache.rms.je.role ;
+package org.apache.rms.spi ;
 
 
 import org.apache.rms.Role ;
+import org.apache.rms.spi.RoleDAO;
+import org.apache.rms.spi.RoleDAOMonitor;
 
 import java.util.Iterator;
 

Mime
View raw message