directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: rev 10594 - in incubator/directory/rms/trunk/je/src: java/org/apache/rms/je/profile test/org/apache/rms/je/profile
Date Tue, 11 May 2004 15:02:18 GMT
Author: akarasulu
Date: Tue May 11 08:02:17 2004
New Revision: 10594

Modified:
   incubator/directory/rms/trunk/je/src/java/org/apache/rms/je/profile/JeLinkAppNameKeyCreator.java
   incubator/directory/rms/trunk/je/src/java/org/apache/rms/je/profile/JeLinkUserNameKeyCreator.java
   incubator/directory/rms/trunk/je/src/java/org/apache/rms/je/profile/JeProfileAppNameKeyCreator.java
   incubator/directory/rms/trunk/je/src/java/org/apache/rms/je/profile/JeProfileUserNameKeyCreator.java
   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/ProfileDAOMonitorAdapter.java
   incubator/directory/rms/trunk/je/src/test/org/apache/rms/je/profile/JeProfileRoleLinkDAOTest.java
Log:
fixed build

Modified: incubator/directory/rms/trunk/je/src/java/org/apache/rms/je/profile/JeLinkAppNameKeyCreator.java
==============================================================================
--- incubator/directory/rms/trunk/je/src/java/org/apache/rms/je/profile/JeLinkAppNameKeyCreator.java
(original)
+++ incubator/directory/rms/trunk/je/src/java/org/apache/rms/je/profile/JeLinkAppNameKeyCreator.java
Tue May 11 08:02:17 2004
@@ -34,8 +34,8 @@
 public class JeLinkAppNameKeyCreator implements SecondaryKeyCreator
 {
     /** the binding used to manipulate a serialized profile */
-    private final JeProfileRoleLinkBinding BINDING =
-            new JeProfileRoleLinkBinding() ;
+    private final JeProfileRoleLinkBinding binding = 
+        new JeProfileRoleLinkBinding() ;
 
 
     /**
@@ -58,7 +58,7 @@
 
         try
         {
-            name = BINDING.getApplicationName( dataEntry ) ;
+            name = binding.getApplicationName( dataEntry ) ;
             resultEntry.setData( name.getBytes( "UTF-8" ) ) ;
         }
         catch ( IOException e )

Modified: incubator/directory/rms/trunk/je/src/java/org/apache/rms/je/profile/JeLinkUserNameKeyCreator.java
==============================================================================
--- incubator/directory/rms/trunk/je/src/java/org/apache/rms/je/profile/JeLinkUserNameKeyCreator.java
(original)
+++ incubator/directory/rms/trunk/je/src/java/org/apache/rms/je/profile/JeLinkUserNameKeyCreator.java
Tue May 11 08:02:17 2004
@@ -34,8 +34,8 @@
 public class JeLinkUserNameKeyCreator implements SecondaryKeyCreator
 {
     /** the binding used to manipulate a serialized profile */
-    private final JeProfileRoleLinkBinding BINDING =
-            new JeProfileRoleLinkBinding() ;
+    private final JeProfileRoleLinkBinding binding =
+        new JeProfileRoleLinkBinding() ;
 
 
     /**
@@ -58,7 +58,7 @@
 
         try
         {
-            name = BINDING.getUserName( dataEntry ) ;
+            name = binding.getUserName( dataEntry ) ;
             resultEntry.setData( name.getBytes( "UTF-8" ) ) ;
         }
         catch ( IOException e )

Modified: incubator/directory/rms/trunk/je/src/java/org/apache/rms/je/profile/JeProfileAppNameKeyCreator.java
==============================================================================
--- incubator/directory/rms/trunk/je/src/java/org/apache/rms/je/profile/JeProfileAppNameKeyCreator.java
(original)
+++ incubator/directory/rms/trunk/je/src/java/org/apache/rms/je/profile/JeProfileAppNameKeyCreator.java
Tue May 11 08:02:17 2004
@@ -34,7 +34,23 @@
 public class JeProfileAppNameKeyCreator implements SecondaryKeyCreator
 {
     /** the binding used to manipulate a serialized profile */
-    private final JeProfileBinding BINDING = new JeProfileBinding() ;
+    private final JeProfileBinding binding ;
+
+
+    // ------------------------------------------------------------------------
+    // C O N S T R U C T O R S
+    // ------------------------------------------------------------------------
+
+
+    /**
+     * Creates a key creator that requires a profile role link binding.
+     *
+     * @param binding the profile role link binding
+     */
+    JeProfileAppNameKeyCreator( JeProfileBinding binding )
+    {
+        this.binding = binding ;
+    }
 
 
     /**
@@ -57,7 +73,7 @@
 
         try
         {
-            name = BINDING.getApplicationName( dataEntry ) ;
+            name = binding.getApplicationName( dataEntry ) ;
             resultEntry.setData( name.getBytes( "UTF-8" ) ) ;
         }
         catch ( IOException e )

Modified: incubator/directory/rms/trunk/je/src/java/org/apache/rms/je/profile/JeProfileUserNameKeyCreator.java
==============================================================================
--- incubator/directory/rms/trunk/je/src/java/org/apache/rms/je/profile/JeProfileUserNameKeyCreator.java
(original)
+++ incubator/directory/rms/trunk/je/src/java/org/apache/rms/je/profile/JeProfileUserNameKeyCreator.java
Tue May 11 08:02:17 2004
@@ -34,7 +34,23 @@
 public class JeProfileUserNameKeyCreator implements SecondaryKeyCreator
 {
     /** the binding used to manipulate a serialized profile */
-    private final JeProfileBinding BINDING = new JeProfileBinding() ;
+    private final JeProfileBinding binding ;
+
+
+    // ------------------------------------------------------------------------
+    // C O N S T R U C T O R S
+    // ------------------------------------------------------------------------
+
+
+    /**
+     * Creates a key creator that requires a profile role link binding.
+     *
+     * @param binding the profile role link binding
+     */
+    JeProfileUserNameKeyCreator( JeProfileBinding binding )
+    {
+        this.binding = binding ;
+    }
 
 
     /**
@@ -57,7 +73,7 @@
 
         try
         {
-            name = BINDING.getUserName( dataEntry ) ;
+            name = binding.getUserName( dataEntry ) ;
             resultEntry.setData( name.getBytes( "UTF-8" ) ) ;
         }
         catch ( IOException e )

Modified: 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/je/src/java/org/apache/rms/je/profile/LoggingProfileDAOMonitor.java
Tue May 11 08:02:17 2004
@@ -19,7 +19,9 @@
 
 import org.apache.commons.logging.Log ;
 import org.apache.commons.logging.LogFactory ;
+import org.apache.commons.lang.NotImplementedException;
 import org.apache.rms.je.application.ApplicationDAO ;
+import com.sleepycat.je.OperationStatus;
 
 
 /**
@@ -28,7 +30,7 @@
  * @author <a href="mailto:directory-dev@incubator.apache.org">Apache Directory Project</a>
  * @version $Rev$
  */
-public class LoggingProfileDAOMonitor implements ProfileDAOMonitor
+public abstract class LoggingProfileDAOMonitor implements ProfileDAOMonitor
 {
     /** the log used by this logging monitor */
     private Log log = LogFactory.getLog( ApplicationDAO.class ) ;

Modified: 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/je/src/java/org/apache/rms/je/profile/ProfileDAOMonitorAdapter.java
Tue May 11 08:02:17 2004
@@ -18,6 +18,7 @@
 
 
 import org.apache.commons.lang.NotImplementedException;
+import com.sleepycat.je.OperationStatus;
 
 
 /**
@@ -50,6 +51,66 @@
 
 
     public void cleanedUp( ProfileDAO dao, String op, Object resource )
+    {
+    }
+
+
+    public void failedOnHas( ProfileDAO dao, String appName, String userName,
+                             Throwable fault )
+    {
+        if ( fault != null )
+        {
+            fault.printStackTrace() ;
+        }
+    }
+
+
+    public void profileExists( ProfileDAO dao, String appName,
+                               String userName )
+    {
+        throw new NotImplementedException( "STUB" );
+    }
+
+
+    public void failedOnCreate( ProfileDAO dao, String appName,
+                                String userName, Throwable fault )
+    {
+        if ( fault != null )
+        {
+            fault.printStackTrace() ;
+        }
+    }
+
+
+    public void failedOnDelete( ProfileDAO dao, OperationStatus status,
+                                String appName, String userName,
+                                Throwable fault )
+    {
+        if ( fault != null )
+        {
+            fault.printStackTrace() ;
+        }
+    }
+
+
+    public void failedOnDelete( ProfileDAO dao, String appName,
+                                String userName, Throwable fault )
+    {
+        if ( fault != null )
+        {
+            fault.printStackTrace() ;
+        }
+    }
+
+
+    public void profileDeleted( ProfileDAO dao, String appName,
+                                String userName )
+    {
+    }
+
+
+    public void constraintViolationOnDelete( ProfileDAO dao, String appName,
+                                             String userName )
     {
     }
 }

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
Tue May 11 08:02:17 2004
@@ -92,11 +92,11 @@
     {
         assertFalse( dao.has( "app1", "user1", "roleA" ) ) ;
         assertFalse( dao.has( "app1", "user2", "roleA" ) ) ;
-        assertFalse( dao.has( "app1", "roleA" ) ) ;
+        assertFalse( dao.isRoleInUse( "app1", "roleA" ) ) ;
 
         assertFalse( dao.has( "app2", "user1", "roleB" ) ) ;
         assertFalse( dao.has( "app2", "user2", "roleB" ) ) ;
-        assertFalse( dao.has( "app2", "roleA" ) ) ;
+        assertFalse( dao.isRoleInUse( "app2", "roleA" ) ) ;
 
         dao.create( "app1", "user1", "roleA" ) ;
         dao.create( "app1", "user2", "roleA" ) ;
@@ -105,13 +105,13 @@
 
         assertTrue( dao.has( "app1", "user1", "roleA" ) ) ;
         assertTrue( dao.has( "app1", "user2", "roleA" ) ) ;
-        assertTrue( dao.has( "app1", "roleA" ) ) ;
-        assertFalse( dao.has( "app1", "roleB" ) ) ;
+        assertTrue( dao.isRoleInUse( "app1", "roleA" ) ) ;
+        assertFalse( dao.isRoleInUse( "app1", "roleB" ) ) ;
 
         assertTrue( dao.has( "app2", "user1", "roleB" ) ) ;
         assertTrue( dao.has( "app2", "user2", "roleB" ) ) ;
-        assertTrue( dao.has( "app2", "roleB" ) ) ;
-        assertFalse( dao.has( "app2", "roleA" ) ) ;
+        assertTrue( dao.isRoleInUse( "app2", "roleB" ) ) ;
+        assertFalse( dao.isRoleInUse( "app2", "roleA" ) ) ;
     }
 
 
@@ -119,11 +119,11 @@
     {
         assertFalse( dao.has( "app1", "user1", "roleA" ) ) ;
         assertFalse( dao.has( "app1", "user2", "roleA" ) ) ;
-        assertFalse( dao.has( "app1", "roleA" ) ) ;
+        assertFalse( dao.isRoleInUse( "app1", "roleA" ) ) ;
 
         assertFalse( dao.has( "app2", "user1", "roleB" ) ) ;
         assertFalse( dao.has( "app2", "user2", "roleB" ) ) ;
-        assertFalse( dao.has( "app2", "roleA" ) ) ;
+        assertFalse( dao.isRoleInUse( "app2", "roleA" ) ) ;
 
         dao.create( "app1", "user1", "roleA" ) ;
         dao.create( "app1", "user2", "roleA" ) ;
@@ -132,13 +132,13 @@
 
         assertTrue( dao.has( "app1", "user1", "roleA" ) ) ;
         assertTrue( dao.has( "app1", "user2", "roleA" ) ) ;
-        assertTrue( dao.has( "app1", "roleA" ) ) ;
-        assertFalse( dao.has( "app1", "roleB" ) ) ;
+        assertTrue( dao.isRoleInUse( "app1", "roleA" ) ) ;
+        assertFalse( dao.isRoleInUse( "app1", "roleB" ) ) ;
 
         assertTrue( dao.has( "app2", "user1", "roleB" ) ) ;
         assertTrue( dao.has( "app2", "user2", "roleB" ) ) ;
-        assertTrue( dao.has( "app2", "roleB" ) ) ;
-        assertFalse( dao.has( "app2", "roleA" ) ) ;
+        assertTrue( dao.isRoleInUse( "app2", "roleB" ) ) ;
+        assertFalse( dao.isRoleInUse( "app2", "roleA" ) ) ;
 
         dao.delete( "app1", "user1", "roleA" ) ;
         dao.delete( "app1", "user2", "roleA" ) ;
@@ -147,11 +147,11 @@
 
         assertFalse( dao.has( "app1", "user1", "roleA" ) ) ;
         assertFalse( dao.has( "app1", "user2", "roleA" ) ) ;
-        assertFalse( dao.has( "app1", "roleA" ) ) ;
+        assertFalse( dao.isRoleInUse( "app1", "roleA" ) ) ;
 
         assertFalse( dao.has( "app2", "user1", "roleB" ) ) ;
         assertFalse( dao.has( "app2", "user2", "roleB" ) ) ;
-        assertFalse( dao.has( "app2", "roleA" ) ) ;
+        assertFalse( dao.isRoleInUse( "app2", "roleA" ) ) ;
     }
 
 
@@ -159,11 +159,11 @@
     {
         assertFalse( dao.has( "app1", "user1", "roleA" ) ) ;
         assertFalse( dao.has( "app1", "user2", "roleA" ) ) ;
-        assertFalse( dao.has( "app1", "roleA" ) ) ;
+        assertFalse( dao.isRoleInUse( "app1", "roleA" ) ) ;
 
         assertFalse( dao.has( "app2", "user1", "roleB" ) ) ;
         assertFalse( dao.has( "app2", "user2", "roleB" ) ) ;
-        assertFalse( dao.has( "app2", "roleA" ) ) ;
+        assertFalse( dao.isRoleInUse( "app2", "roleA" ) ) ;
 
         dao.create( "app1", "user1", "roleA" ) ;
         dao.create( "app1", "user2", "roleA" ) ;
@@ -172,13 +172,13 @@
 
         assertTrue( dao.has( "app1", "user1", "roleA" ) ) ;
         assertTrue( dao.has( "app1", "user2", "roleA" ) ) ;
-        assertTrue( dao.has( "app1", "roleA" ) ) ;
-        assertFalse( dao.has( "app1", "roleB" ) ) ;
+        assertTrue( dao.isRoleInUse( "app1", "roleA" ) ) ;
+        assertFalse( dao.isRoleInUse( "app1", "roleB" ) ) ;
 
         assertTrue( dao.has( "app2", "user1", "roleB" ) ) ;
         assertTrue( dao.has( "app2", "user2", "roleB" ) ) ;
-        assertTrue( dao.has( "app2", "roleB" ) ) ;
-        assertFalse( dao.has( "app2", "roleA" ) ) ;
+        assertTrue( dao.isRoleInUse( "app2", "roleB" ) ) ;
+        assertFalse( dao.isRoleInUse( "app2", "roleA" ) ) ;
 
         Iterator list = dao.listUserNames( "app1", "roleA" ) ;
         assertEquals( "user1", list.next() ) ;

Mime
View raw message