You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by el...@apache.org on 2010/06/03 19:05:29 UTC

svn commit: r951068 [3/6] - in /directory: apacheds/trunk/avl-partition/src/main/java/org/apache/directory/server/core/partition/avl/ apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/ apacheds/trunk/core-api/src/main/java/org/apac...

Modified: directory/apacheds/trunk/core-mock/src/main/java/org/apache/directory/server/core/MockDirectoryService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-mock/src/main/java/org/apache/directory/server/core/MockDirectoryService.java?rev=951068&r1=951067&r2=951068&view=diff
==============================================================================
--- directory/apacheds/trunk/core-mock/src/main/java/org/apache/directory/server/core/MockDirectoryService.java (original)
+++ directory/apacheds/trunk/core-mock/src/main/java/org/apache/directory/server/core/MockDirectoryService.java Thu Jun  3 17:05:26 2010
@@ -381,7 +381,7 @@ public class MockDirectoryService implem
         return null;
     }
 
-    public CoreSession getAdminSession() throws Exception
+    public CoreSession getAdminSession()
     {
         return null;
     }

Modified: directory/apacheds/trunk/core-mock/src/main/java/org/apache/directory/server/core/MockInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-mock/src/main/java/org/apache/directory/server/core/MockInterceptor.java?rev=951068&r1=951067&r2=951068&view=diff
==============================================================================
--- directory/apacheds/trunk/core-mock/src/main/java/org/apache/directory/server/core/MockInterceptor.java (original)
+++ directory/apacheds/trunk/core-mock/src/main/java/org/apache/directory/server/core/MockInterceptor.java Thu Jun  3 17:05:26 2010
@@ -24,8 +24,6 @@ import java.util.ArrayList;
 import java.util.List;
 import java.util.Set;
 
-import javax.naming.NamingException;
-
 import org.apache.directory.server.core.entry.ClonedServerEntry;
 import org.apache.directory.server.core.filtering.EntryFilteringCursor;
 import org.apache.directory.server.core.interceptor.Interceptor;
@@ -82,7 +80,7 @@ public class MockInterceptor implements 
 
 
     public void init( DirectoryService directoryService )
-        throws NamingException
+        throws LdapException
     {
     }
 
@@ -92,28 +90,28 @@ public class MockInterceptor implements 
     }
 
 
-    public ClonedServerEntry getRootDSE( NextInterceptor next, GetRootDSEOperationContext opContext ) throws Exception
+    public ClonedServerEntry getRootDSE( NextInterceptor next, GetRootDSEOperationContext opContext ) throws LdapException
     {
         interceptors.add( this );
         return next.getRootDSE( opContext );
     }
 
 
-    public DN getMatchedName ( NextInterceptor next, GetMatchedNameOperationContext opContext ) throws Exception
+    public DN getMatchedName ( NextInterceptor next, GetMatchedNameOperationContext opContext ) throws LdapException
     {
         interceptors.add( this );
         return next.getMatchedName( opContext );
     }
 
 
-    public DN getSuffix ( NextInterceptor next, GetSuffixOperationContext opContext ) throws Exception
+    public DN getSuffix ( NextInterceptor next, GetSuffixOperationContext opContext ) throws LdapException
     {
         interceptors.add( this );
         return next.getSuffix( opContext );
     }
 
 
-    public Set<String> listSuffixes ( NextInterceptor next, ListSuffixOperationContext opContext ) throws Exception
+    public Set<String> listSuffixes ( NextInterceptor next, ListSuffixOperationContext opContext ) throws LdapException
     {
         interceptors.add( this );
         return next.listSuffixes( opContext );
@@ -121,28 +119,28 @@ public class MockInterceptor implements 
 
 
     public void addContextPartition( NextInterceptor next, AddContextPartitionOperationContext opContext )
-        throws Exception
+        throws LdapException
     {
         interceptors.add( this );
         next.addContextPartition( opContext );
     }
 
 
-    public void removeContextPartition( NextInterceptor next, RemoveContextPartitionOperationContext opContext ) throws Exception
+    public void removeContextPartition( NextInterceptor next, RemoveContextPartitionOperationContext opContext ) throws LdapException
     {
         interceptors.add( this );
         next.removeContextPartition( opContext );
     }
 
 
-    public boolean compare( NextInterceptor next, CompareOperationContext opContext ) throws Exception
+    public boolean compare( NextInterceptor next, CompareOperationContext opContext ) throws LdapException
     {
         interceptors.add( this );
         return next.compare( opContext );
     }
 
 
-    public void delete( NextInterceptor next, DeleteOperationContext opContext ) throws Exception
+    public void delete( NextInterceptor next, DeleteOperationContext opContext ) throws LdapException
     {
         interceptors.add( this );
         next.delete( opContext );
@@ -150,42 +148,42 @@ public class MockInterceptor implements 
 
 
     public void add( NextInterceptor next, AddOperationContext opContext )
-        throws Exception
+        throws LdapException
     {
         interceptors.add( this );
         next.add( opContext );
     }
 
 
-    public void modify( NextInterceptor next, ModifyOperationContext opContext ) throws Exception
+    public void modify( NextInterceptor next, ModifyOperationContext opContext ) throws LdapException
     {
         interceptors.add( this );
         next.modify( opContext );
     }
 
 
-    public EntryFilteringCursor list( NextInterceptor next, ListOperationContext opContext ) throws Exception
+    public EntryFilteringCursor list( NextInterceptor next, ListOperationContext opContext ) throws LdapException
     {
         interceptors.add( this );
         return next.list( opContext );
     }
 
 
-    public EntryFilteringCursor search( NextInterceptor next, SearchOperationContext opContext ) throws Exception
+    public EntryFilteringCursor search( NextInterceptor next, SearchOperationContext opContext ) throws LdapException
     {
         interceptors.add( this );
         return next.search( opContext );
     }
 
 
-    public Entry lookup( NextInterceptor next, LookupOperationContext opContext ) throws Exception
+    public Entry lookup( NextInterceptor next, LookupOperationContext opContext ) throws LdapException
     {
         interceptors.add( this );
         return next.lookup( opContext );
     }
 
 
-    public boolean hasEntry( NextInterceptor next, EntryOperationContext opContext ) throws Exception
+    public boolean hasEntry( NextInterceptor next, EntryOperationContext opContext ) throws LdapException
     {
         interceptors.add( this );
         return next.hasEntry( opContext );
@@ -193,14 +191,14 @@ public class MockInterceptor implements 
 
 
     public void rename( NextInterceptor next, RenameOperationContext opContext )
-        throws Exception
+        throws LdapException
     {
         interceptors.add( this );
         next.rename( opContext );
     }
 
 
-    public void move( NextInterceptor next, MoveOperationContext opContext ) throws Exception
+    public void move( NextInterceptor next, MoveOperationContext opContext ) throws LdapException
     {
         interceptors.add( this );
         next.move( opContext );
@@ -208,7 +206,7 @@ public class MockInterceptor implements 
 
 
     public void moveAndRename( NextInterceptor next, MoveAndRenameOperationContext opContext )
-        throws Exception
+        throws LdapException
     {
         interceptors.add( this );
         next.moveAndRename( opContext );

Modified: directory/apacheds/trunk/core-mock/src/main/java/org/apache/directory/server/core/MockOperation.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-mock/src/main/java/org/apache/directory/server/core/MockOperation.java?rev=951068&r1=951067&r2=951068&view=diff
==============================================================================
--- directory/apacheds/trunk/core-mock/src/main/java/org/apache/directory/server/core/MockOperation.java (original)
+++ directory/apacheds/trunk/core-mock/src/main/java/org/apache/directory/server/core/MockOperation.java Thu Jun  3 17:05:26 2010
@@ -31,8 +31,9 @@ import org.apache.directory.server.core.
 import org.apache.directory.server.core.interceptor.context.OperationContext;
 import org.apache.directory.server.core.interceptor.context.SearchOperationContext;
 import org.apache.directory.shared.ldap.constants.AuthenticationLevel;
-import org.apache.directory.shared.ldap.entry.Modification;
 import org.apache.directory.shared.ldap.entry.Entry;
+import org.apache.directory.shared.ldap.entry.Modification;
+import org.apache.directory.shared.ldap.exception.LdapException;
 import org.apache.directory.shared.ldap.message.control.Control;
 import org.apache.directory.shared.ldap.name.DN;
 
@@ -168,13 +169,13 @@ public class MockOperation implements Op
     }
 
 
-    public ClonedServerEntry lookup( DN dn, Collection<String> bypass ) throws Exception
+    public ClonedServerEntry lookup( DN dn, Collection<String> bypass ) throws LdapException
     {
         return null;
     }
 
 
-    public ClonedServerEntry lookup( LookupOperationContext lookupContext ) throws Exception
+    public ClonedServerEntry lookup( LookupOperationContext lookupContext ) throws LdapException
     {
         return null;
     }
@@ -237,22 +238,22 @@ public class MockOperation implements Op
     }
 
 
-    public void add( Entry entry, Collection<String> bypass ) throws Exception
+    public void add( Entry entry, Collection<String> bypass ) throws LdapException
     {
     }
 
 
-    public void delete( DN dn, Collection<String> bypass ) throws Exception
+    public void delete( DN dn, Collection<String> bypass ) throws LdapException
     {
     }
 
 
-    public void modify( DN dn, List<Modification> mods, Collection<String> bypass ) throws Exception
+    public void modify( DN dn, List<Modification> mods, Collection<String> bypass ) throws LdapException
     {
     }
 
 
-    public boolean hasEntry( DN dn, Collection<String> byPass ) throws Exception
+    public boolean hasEntry( DN dn, Collection<String> byPass ) throws LdapException
     {
         return false;
     }

Modified: directory/apacheds/trunk/core-mock/src/main/java/org/apache/directory/server/core/MockOperationManager.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-mock/src/main/java/org/apache/directory/server/core/MockOperationManager.java?rev=951068&r1=951067&r2=951068&view=diff
==============================================================================
--- directory/apacheds/trunk/core-mock/src/main/java/org/apache/directory/server/core/MockOperationManager.java (original)
+++ directory/apacheds/trunk/core-mock/src/main/java/org/apache/directory/server/core/MockOperationManager.java Thu Jun  3 17:05:26 2010
@@ -53,7 +53,7 @@ public class MockOperationManager implem
         this.count = count;
     }
     
-    public void add( AddOperationContext opContext ) throws Exception
+    public void add( AddOperationContext opContext ) throws LdapException
     {
     }
 
@@ -63,68 +63,68 @@ public class MockOperationManager implem
     }
 
     
-    public boolean compare( CompareOperationContext opContext ) throws Exception
+    public boolean compare( CompareOperationContext opContext ) throws LdapException
     {
         return false;
     }
 
 
-    public void delete( DeleteOperationContext opContext ) throws Exception
+    public void delete( DeleteOperationContext opContext ) throws LdapException
     {
     }
 
-    public DN getMatchedName( GetMatchedNameOperationContext opContext ) throws Exception
+    public DN getMatchedName( GetMatchedNameOperationContext opContext ) throws LdapException
     {
         return null;
     }
 
-    public ClonedServerEntry getRootDSE( GetRootDSEOperationContext opContext ) throws Exception
+    public ClonedServerEntry getRootDSE( GetRootDSEOperationContext opContext ) throws LdapException
     {
         return null;
     }
 
-    public DN getSuffix( GetSuffixOperationContext opContext ) throws Exception
+    public DN getSuffix( GetSuffixOperationContext opContext ) throws LdapException
     {
         return null;
     }
 
-    public boolean hasEntry( EntryOperationContext opContext ) throws Exception
+    public boolean hasEntry( EntryOperationContext opContext ) throws LdapException
     {
         return false;
     }
 
-    public EntryFilteringCursor list( ListOperationContext opContext ) throws Exception
+    public EntryFilteringCursor list( ListOperationContext opContext ) throws LdapException
     {
         return null;
     }
 
-    public Set<String> listSuffixes( ListSuffixOperationContext opContext ) throws Exception
+    public Set<String> listSuffixes( ListSuffixOperationContext opContext ) throws LdapException
     {
         return null;
     }
 
-    public ClonedServerEntry lookup( LookupOperationContext opContext ) throws Exception
+    public ClonedServerEntry lookup( LookupOperationContext opContext ) throws LdapException
     {
         return null;
     }
 
-    public void modify( ModifyOperationContext opContext ) throws Exception
+    public void modify( ModifyOperationContext opContext ) throws LdapException
     {
     }
 
-    public void move( MoveOperationContext opContext ) throws Exception
+    public void move( MoveOperationContext opContext ) throws LdapException
     {
     }
 
-    public void moveAndRename( MoveAndRenameOperationContext opContext ) throws Exception
+    public void moveAndRename( MoveAndRenameOperationContext opContext ) throws LdapException
     {
     }
 
-    public void rename( RenameOperationContext opContext ) throws Exception
+    public void rename( RenameOperationContext opContext ) throws LdapException
     {
     }
 
-    public EntryFilteringCursor search( SearchOperationContext opContext ) throws Exception
+    public EntryFilteringCursor search( SearchOperationContext opContext ) throws LdapException
     {
         MockCursor cursor = new MockCursor( count );
         cursor.setSchemaManager( opContext.getSession().getDirectoryService().getSchemaManager() );

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultOperationManager.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultOperationManager.java?rev=951068&r1=951067&r2=951068&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultOperationManager.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultOperationManager.java Thu Jun  3 17:05:26 2010
@@ -55,6 +55,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.exception.LdapAffectMultipleDsaException;
 import org.apache.directory.shared.ldap.exception.LdapException;
 import org.apache.directory.shared.ldap.exception.LdapInvalidDnException;
+import org.apache.directory.shared.ldap.exception.LdapOperationErrorException;
 import org.apache.directory.shared.ldap.exception.LdapPartialResultException;
 import org.apache.directory.shared.ldap.exception.LdapReferralException;
 import org.apache.directory.shared.ldap.exception.LdapServiceUnavailableException;
@@ -91,28 +92,39 @@ public class DefaultOperationManager imp
 
 
     private LdapReferralException buildReferralException( Entry parentEntry, DN childDn )
-        throws LdapInvalidDnException, LdapURLEncodingException
+        throws LdapException //, LdapURLEncodingException
     {
         // Get the Ref attributeType
         EntryAttribute refs = parentEntry.get( SchemaConstants.REF_AT );
 
         List<String> urls = new ArrayList<String>();
 
-        // manage each Referral, building the correct URL for each of them
-        for ( Value<?> url : refs )
+        try
         {
-            // we have to replace the parent by the referral
-            LdapURL ldapUrl = new LdapURL( url.getString() );
-
-            // We have a problem with the DN : we can't use the UpName,
-            // as we may have some spaces around the ',' and '+'.
-            // So we have to take the RDN one by one, and create a 
-            // new DN with the type and value UP form
-
-            DN urlDn = ( DN ) ldapUrl.getDn().addAll( childDn );
-
-            ldapUrl.setDn( urlDn );
-            urls.add( ldapUrl.toString() );
+            // manage each Referral, building the correct URL for each of them
+            for ( Value<?> url : refs )
+            {
+                // we have to replace the parent by the referral
+                LdapURL ldapUrl = new LdapURL( url.getString() );
+    
+                // We have a problem with the DN : we can't use the UpName,
+                // as we may have some spaces around the ',' and '+'.
+                // So we have to take the RDN one by one, and create a 
+                // new DN with the type and value UP form
+    
+                DN urlDn = ( DN ) ldapUrl.getDn().addAll( childDn );
+    
+                ldapUrl.setDn( urlDn );
+                urls.add( ldapUrl.toString() );
+            }
+        } 
+        catch ( LdapInvalidDnException lide )
+        {
+            throw new LdapOperationErrorException( lide.getMessage() );
+        }
+        catch ( LdapURLEncodingException luee )
+        {
+            throw new LdapOperationErrorException( luee.getMessage() );
         }
 
         // Return with an exception
@@ -126,7 +138,7 @@ public class DefaultOperationManager imp
 
 
     private LdapReferralException buildReferralExceptionForSearch( Entry parentEntry, DN childDn, SearchScope scope )
-        throws LdapInvalidDnException, LdapURLEncodingException
+        throws LdapException
     {
         // Get the Ref attributeType
         EntryAttribute refs = parentEntry.get( SchemaConstants.REF_AT );
@@ -209,7 +221,7 @@ public class DefaultOperationManager imp
     /**
      * {@inheritDoc}
      */
-    public void add( AddOperationContext opContext ) throws Exception
+    public void add( AddOperationContext opContext ) throws LdapException
     {
         LOG.debug( ">> AddOperation : {}", opContext );
         LOG_CHANGES.debug( ">> AddOperation : {}", opContext );
@@ -295,7 +307,7 @@ public class DefaultOperationManager imp
     /**
      * {@inheritDoc}
      */
-    public boolean compare( CompareOperationContext opContext ) throws Exception
+    public boolean compare( CompareOperationContext opContext ) throws LdapException
     {
         LOG.debug( ">> CompareOperation : {}", opContext );
 
@@ -374,7 +386,7 @@ public class DefaultOperationManager imp
     /**
      * {@inheritDoc}
      */
-    public void delete( DeleteOperationContext opContext ) throws Exception
+    public void delete( DeleteOperationContext opContext ) throws LdapException
     {
         LOG.debug( ">> DeleteOperation : {}", opContext );
         LOG_CHANGES.debug( ">> DeleteOperation : {}", opContext );
@@ -456,7 +468,7 @@ public class DefaultOperationManager imp
     /**
      * {@inheritDoc}
      */
-    public DN getMatchedName( GetMatchedNameOperationContext opContext ) throws Exception
+    public DN getMatchedName( GetMatchedNameOperationContext opContext ) throws LdapException
     {
         LOG.debug( ">> GetMatchedNameOperation : {}", opContext );
 
@@ -479,7 +491,7 @@ public class DefaultOperationManager imp
     /**
      * {@inheritDoc}
      */
-    public ClonedServerEntry getRootDSE( GetRootDSEOperationContext opContext ) throws Exception
+    public ClonedServerEntry getRootDSE( GetRootDSEOperationContext opContext ) throws LdapException
     {
         LOG.debug( ">> GetRootDSEOperation : {}", opContext );
 
@@ -503,7 +515,7 @@ public class DefaultOperationManager imp
     /**
      * {@inheritDoc}
      */
-    public DN getSuffix( GetSuffixOperationContext opContext ) throws Exception
+    public DN getSuffix( GetSuffixOperationContext opContext ) throws LdapException
     {
         LOG.debug( ">> GetSuffixOperation : {}", opContext );
 
@@ -526,7 +538,7 @@ public class DefaultOperationManager imp
     /**
      * {@inheritDoc}
      */
-    public boolean hasEntry( EntryOperationContext opContext ) throws Exception
+    public boolean hasEntry( EntryOperationContext opContext ) throws LdapException
     {
         LOG.debug( ">> hasEntryOperation : {}", opContext );
 
@@ -549,7 +561,7 @@ public class DefaultOperationManager imp
     /**
      * {@inheritDoc}
      */
-    public EntryFilteringCursor list( ListOperationContext opContext ) throws Exception
+    public EntryFilteringCursor list( ListOperationContext opContext ) throws LdapException
     {
         LOG.debug( ">> ListOperation : {}", opContext );
 
@@ -572,7 +584,7 @@ public class DefaultOperationManager imp
     /**
      * {@inheritDoc}
      */
-    public Set<String> listSuffixes( ListSuffixOperationContext opContext ) throws Exception
+    public Set<String> listSuffixes( ListSuffixOperationContext opContext ) throws LdapException
     {
         LOG.debug( ">> ListSuffixesOperation : {}", opContext );
 
@@ -595,7 +607,7 @@ public class DefaultOperationManager imp
     /**
      * {@inheritDoc}
      */
-    public Entry lookup( LookupOperationContext opContext ) throws Exception
+    public Entry lookup( LookupOperationContext opContext ) throws LdapException
     {
         LOG.debug( ">> LookupOperation : {}", opContext );
 
@@ -619,7 +631,7 @@ public class DefaultOperationManager imp
     /**
      * {@inheritDoc}
      */
-    public void modify( ModifyOperationContext opContext ) throws Exception
+    public void modify( ModifyOperationContext opContext ) throws LdapException
     {
         LOG.debug( ">> ModifyOperation : {}", opContext );
         LOG_CHANGES.debug( ">> ModifyOperation : {}", opContext );
@@ -710,7 +722,7 @@ public class DefaultOperationManager imp
     /**
      * {@inheritDoc}
      */
-    public void move( MoveOperationContext opContext ) throws Exception
+    public void move( MoveOperationContext opContext ) throws LdapException
     {
         LOG.debug( ">> MoveOperation : {}", opContext );
         LOG_CHANGES.debug( ">> MoveOperation : {}", opContext );
@@ -812,7 +824,7 @@ public class DefaultOperationManager imp
     /**
      * {@inheritDoc}
      */
-    public void moveAndRename( MoveAndRenameOperationContext opContext ) throws Exception
+    public void moveAndRename( MoveAndRenameOperationContext opContext ) throws LdapException
     {
         LOG.debug( ">> MoveAndRenameOperation : {}", opContext );
         LOG_CHANGES.debug( ">> MoveAndRenameOperation : {}", opContext );
@@ -916,7 +928,7 @@ public class DefaultOperationManager imp
     /**
      * {@inheritDoc} 
      */
-    public void rename( RenameOperationContext opContext ) throws Exception
+    public void rename( RenameOperationContext opContext ) throws LdapException
     {
         LOG.debug( ">> RenameOperation : {}", opContext );
         LOG_CHANGES.debug( ">> RenameOperation : {}", opContext );
@@ -1009,7 +1021,7 @@ public class DefaultOperationManager imp
     /**
      * {@inheritDoc}
      */
-    public EntryFilteringCursor search( SearchOperationContext opContext ) throws Exception
+    public EntryFilteringCursor search( SearchOperationContext opContext ) throws LdapException
     {
         LOG.debug( ">> SearchOperation : {}", opContext );
 

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/ReferralManagerImpl.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/ReferralManagerImpl.java?rev=951068&r1=951067&r2=951068&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/ReferralManagerImpl.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/ReferralManagerImpl.java Thu Jun  3 17:05:26 2010
@@ -29,9 +29,10 @@ import org.apache.directory.server.core.
 import org.apache.directory.server.core.interceptor.context.SearchOperationContext;
 import org.apache.directory.server.core.partition.PartitionNexus;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
-import org.apache.directory.shared.ldap.entry.StringValue;
 import org.apache.directory.shared.ldap.entry.Entry;
+import org.apache.directory.shared.ldap.entry.StringValue;
 import org.apache.directory.shared.ldap.exception.LdapException;
+import org.apache.directory.shared.ldap.exception.LdapOperationException;
 import org.apache.directory.shared.ldap.filter.EqualityNode;
 import org.apache.directory.shared.ldap.filter.ExprNode;
 import org.apache.directory.shared.ldap.message.AliasDerefMode;
@@ -64,7 +65,7 @@ public class ReferralManagerImpl impleme
      * @param directoryService The directory service
      * @throws Exception If we can't initialize the manager
      */
-    public ReferralManagerImpl( DirectoryService directoryService ) throws Exception
+    public ReferralManagerImpl( DirectoryService directoryService ) throws LdapException
     {
         lockWrite();
         
@@ -140,7 +141,7 @@ public class ReferralManagerImpl impleme
     /**
      * {@inheritDoc}
      */
-    public void init( DirectoryService directoryService, String... suffixes ) throws Exception
+    public void init( DirectoryService directoryService, String... suffixes ) throws LdapException
     {
         ExprNode referralFilter = new EqualityNode<String>( SchemaConstants.OBJECT_CLASS_AT, 
             new StringValue( SchemaConstants.REFERRAL_OC ) );
@@ -163,21 +164,30 @@ public class ReferralManagerImpl impleme
             searchOperationContext.setAliasDerefMode( AliasDerefMode.DEREF_ALWAYS );
             EntryFilteringCursor cursor = nexus.search( searchOperationContext );
             
-            // Move to the first entry in the cursor
-            cursor.beforeFirst();
-            
-            while ( cursor.next() ) 
+            try
             {
-                Entry entry = cursor.get();
-
-                // Lock the referralManager
-                lockWrite();
+                // Move to the first entry in the cursor
+                cursor.beforeFirst();
                 
-                // Add it at the right place
-                addReferral( entry );
+                while ( cursor.next() ) 
+                {
+                    Entry entry = cursor.get();
+    
+                    // Lock the referralManager
+                    lockWrite();
+                    
+                    // Add it at the right place
+                    addReferral( entry );
+                    
+                    // Unlock the referralManager
+                    unlock();
+                }
                 
-                // Unlock the referralManager
-                unlock();
+                cursor.close();
+            }
+            catch ( Exception e )
+            {
+                throw new LdapOperationException( e.getMessage() );
             }
         }
     }

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/AbstractAuthenticator.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/AbstractAuthenticator.java?rev=951068&r1=951067&r2=951068&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/AbstractAuthenticator.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/AbstractAuthenticator.java Thu Jun  3 17:05:26 2010
@@ -24,6 +24,7 @@ import javax.naming.NamingException;
 
 import org.apache.directory.server.core.DirectoryService;
 import org.apache.directory.shared.ldap.constants.AuthenticationLevel;
+import org.apache.directory.shared.ldap.exception.LdapException;
 import org.apache.directory.shared.ldap.name.DN;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -83,7 +84,7 @@ public abstract class AbstractAuthentica
      * @param directoryService the directory core for this authenticator
      * @throws NamingException if there is a problem starting up the authenticator
      */
-    public final void init( DirectoryService directoryService ) throws Exception
+    public final void init( DirectoryService directoryService ) throws LdapException
     {
         this.directoryService = directoryService;
         doInit();

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/AuthenticationInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/AuthenticationInterceptor.java?rev=951068&r1=951067&r2=951068&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/AuthenticationInterceptor.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/AuthenticationInterceptor.java Thu Jun  3 17:05:26 2010
@@ -100,7 +100,7 @@ public class AuthenticationInterceptor e
     /**
      * Registers and initializes all {@link Authenticator}s to this service.
      */
-    public void init( DirectoryService directoryService ) throws Exception
+    public void init( DirectoryService directoryService ) throws LdapException
     {
         this.directoryService = directoryService;
         
@@ -166,7 +166,7 @@ public class AuthenticationInterceptor e
      * @param directoryService configuration info to supply to the Authenticator during initialization
      * @throws javax.naming.Exception if initialization fails.
      */
-    private void register( Authenticator authenticator, DirectoryService directoryService ) throws Exception
+    private void register( Authenticator authenticator, DirectoryService directoryService ) throws LdapException
     {
         authenticator.init( directoryService );
 
@@ -203,7 +203,7 @@ public class AuthenticationInterceptor e
     }
 
 
-    public void add( NextInterceptor next, AddOperationContext opContext ) throws Exception
+    public void add( NextInterceptor next, AddOperationContext opContext ) throws LdapException
     {
         if ( IS_DEBUG )
         {
@@ -215,7 +215,7 @@ public class AuthenticationInterceptor e
     }
 
 
-    public void delete( NextInterceptor next, DeleteOperationContext opContext ) throws Exception
+    public void delete( NextInterceptor next, DeleteOperationContext opContext ) throws LdapException
     {
         if ( IS_DEBUG )
         {
@@ -228,7 +228,7 @@ public class AuthenticationInterceptor e
     }
 
 
-    public DN getMatchedName( NextInterceptor next, GetMatchedNameOperationContext opContext ) throws Exception
+    public DN getMatchedName( NextInterceptor next, GetMatchedNameOperationContext opContext ) throws LdapException
     {
         if ( IS_DEBUG )
         {
@@ -240,7 +240,7 @@ public class AuthenticationInterceptor e
     }
 
 
-    public ClonedServerEntry getRootDSE( NextInterceptor next, GetRootDSEOperationContext opContext ) throws Exception
+    public ClonedServerEntry getRootDSE( NextInterceptor next, GetRootDSEOperationContext opContext ) throws LdapException
     {
         if ( IS_DEBUG )
         {
@@ -252,7 +252,7 @@ public class AuthenticationInterceptor e
     }
 
 
-    public DN getSuffix( NextInterceptor next, GetSuffixOperationContext opContext ) throws Exception
+    public DN getSuffix( NextInterceptor next, GetSuffixOperationContext opContext ) throws LdapException
     {
         if ( IS_DEBUG )
         {
@@ -264,7 +264,7 @@ public class AuthenticationInterceptor e
     }
 
 
-    public boolean hasEntry( NextInterceptor next, EntryOperationContext opContext ) throws Exception
+    public boolean hasEntry( NextInterceptor next, EntryOperationContext opContext ) throws LdapException
     {
         if ( IS_DEBUG )
         {
@@ -276,7 +276,7 @@ public class AuthenticationInterceptor e
     }
 
 
-    public EntryFilteringCursor list( NextInterceptor next, ListOperationContext opContext ) throws Exception
+    public EntryFilteringCursor list( NextInterceptor next, ListOperationContext opContext ) throws LdapException
     {
         if ( IS_DEBUG )
         {
@@ -288,7 +288,7 @@ public class AuthenticationInterceptor e
     }
 
 
-    public Set<String> listSuffixes( NextInterceptor next, ListSuffixOperationContext opContext ) throws Exception
+    public Set<String> listSuffixes( NextInterceptor next, ListSuffixOperationContext opContext ) throws LdapException
     {
         if ( IS_DEBUG )
         {
@@ -300,7 +300,7 @@ public class AuthenticationInterceptor e
     }
 
 
-    public Entry lookup( NextInterceptor next, LookupOperationContext opContext ) throws Exception
+    public Entry lookup( NextInterceptor next, LookupOperationContext opContext ) throws LdapException
     {
         if ( IS_DEBUG )
         {
@@ -327,7 +327,7 @@ public class AuthenticationInterceptor e
     }
 
 
-    public void modify( NextInterceptor next, ModifyOperationContext opContext ) throws Exception
+    public void modify( NextInterceptor next, ModifyOperationContext opContext ) throws LdapException
     {
         if ( IS_DEBUG )
         {
@@ -340,7 +340,7 @@ public class AuthenticationInterceptor e
     }
 
 
-    public void rename( NextInterceptor next, RenameOperationContext opContext ) throws Exception
+    public void rename( NextInterceptor next, RenameOperationContext opContext ) throws LdapException
     {
         if ( IS_DEBUG )
         {
@@ -353,7 +353,7 @@ public class AuthenticationInterceptor e
     }
 
 
-    public boolean compare( NextInterceptor next, CompareOperationContext opContext ) throws Exception
+    public boolean compare( NextInterceptor next, CompareOperationContext opContext ) throws LdapException
     {
         if ( IS_DEBUG )
         {
@@ -368,7 +368,7 @@ public class AuthenticationInterceptor e
 
 
     public void moveAndRename( NextInterceptor next, MoveAndRenameOperationContext opContext )
-            throws Exception
+            throws LdapException
     {
         if ( IS_DEBUG )
         {
@@ -381,7 +381,7 @@ public class AuthenticationInterceptor e
     }
 
 
-    public void move( NextInterceptor next, MoveOperationContext opContext ) throws Exception
+    public void move( NextInterceptor next, MoveOperationContext opContext ) throws LdapException
     {
         if ( IS_DEBUG )
         {
@@ -394,7 +394,7 @@ public class AuthenticationInterceptor e
     }
 
 
-    public EntryFilteringCursor search( NextInterceptor next, SearchOperationContext opContext ) throws Exception
+    public EntryFilteringCursor search( NextInterceptor next, SearchOperationContext opContext ) throws LdapException
     {
         if ( IS_DEBUG )
         {
@@ -413,7 +413,7 @@ public class AuthenticationInterceptor e
      * @param operation the operation type
      * @throws Exception
      */
-    private void checkAuthenticated( OperationContext operation ) throws Exception
+    private void checkAuthenticated( OperationContext operation ) throws LdapException
     {
         if ( operation.getSession().isAnonymous() && !directoryService.isAllowAnonymousAccess() 
             && !operation.getDn().isEmpty() )

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/Authenticator.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/Authenticator.java?rev=951068&r1=951067&r2=951068&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/Authenticator.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/Authenticator.java Thu Jun  3 17:05:26 2010
@@ -27,6 +27,7 @@ import org.apache.directory.server.core.
 import org.apache.directory.server.core.interceptor.context.BindOperationContext;
 import org.apache.directory.server.core.partition.DefaultPartitionNexus;
 import org.apache.directory.shared.ldap.constants.AuthenticationLevel;
+import org.apache.directory.shared.ldap.exception.LdapException;
 import org.apache.directory.shared.ldap.name.DN;
 
 
@@ -59,7 +60,7 @@ public interface Authenticator
      * Called by {@link AuthenticationInterceptor} to indicate that this
      * authenticator is being placed into service.
      */
-    public void init( DirectoryService directoryService ) throws Exception;
+    public void init( DirectoryService directoryService ) throws LdapException;
 
 
     /**

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java?rev=951068&r1=951067&r2=951068&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java Thu Jun  3 17:05:26 2010
@@ -70,6 +70,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.entry.EntryAttribute;
 import org.apache.directory.shared.ldap.entry.Modification;
 import org.apache.directory.shared.ldap.entry.Value;
+import org.apache.directory.shared.ldap.exception.LdapException;
 import org.apache.directory.shared.ldap.exception.LdapNoPermissionException;
 import org.apache.directory.shared.ldap.exception.LdapOperationErrorException;
 import org.apache.directory.shared.ldap.name.DN;
@@ -190,7 +191,7 @@ public class AciAuthorizationInterceptor
      * @param directoryService the directory service core
      * @throws Exception if there are problems during initialization
      */
-    public void init( DirectoryService directoryService ) throws Exception
+    public void init( DirectoryService directoryService ) throws LdapException
     {
         super.init( directoryService );
 
@@ -227,7 +228,7 @@ public class AciAuthorizationInterceptor
     }
 
 
-    private void protectCriticalEntries( DN dn ) throws Exception
+    private void protectCriticalEntries( DN dn ) throws LdapException
     {
         DN principalDn = getPrincipal().getDNRef();
 
@@ -262,7 +263,7 @@ public class AciAuthorizationInterceptor
      * @param proxy the partition nexus proxy object
      */
     private void addPerscriptiveAciTuples( OperationContext opContext, Collection<ACITuple> tuples, DN dn, Entry entry )
-        throws Exception
+        throws LdapException
     {
         EntryAttribute oc = null;
 
@@ -314,7 +315,7 @@ public class AciAuthorizationInterceptor
      * @param entry the target entry that access to is being regulated
      * @throws Exception if there are problems accessing attribute values
      */
-    private void addEntryAciTuples( Collection<ACITuple> tuples, Entry entry ) throws Exception
+    private void addEntryAciTuples( Collection<ACITuple> tuples, Entry entry ) throws LdapException
     {
         EntryAttribute entryAci = entry.get( entryAciType );
 
@@ -355,7 +356,7 @@ public class AciAuthorizationInterceptor
      * @param proxy the partition nexus proxy object
      */
     private void addSubentryAciTuples( OperationContext opContext, Collection<ACITuple> tuples, DN dn, Entry entry )
-        throws Exception
+        throws LdapException
     {
         // only perform this for subentries
         if ( !entry.contains( SchemaConstants.OBJECT_CLASS_AT, SchemaConstants.SUBENTRY_OC ) )
@@ -419,7 +420,7 @@ public class AciAuthorizationInterceptor
      * -------------------------------------------------------------------------------
      */
 
-    public void add( NextInterceptor next, AddOperationContext addContext ) throws Exception
+    public void add( NextInterceptor next, AddOperationContext addContext ) throws LdapException
     {
         // Access the principal requesting the operation, and bypass checks if it is the admin
         LdapPrincipal principal = addContext.getSession().getEffectivePrincipal();
@@ -495,7 +496,7 @@ public class AciAuthorizationInterceptor
     }
 
 
-    public void delete( NextInterceptor next, DeleteOperationContext deleteContext ) throws Exception
+    public void delete( NextInterceptor next, DeleteOperationContext deleteContext ) throws LdapException
     {
         CoreSession session = deleteContext.getSession();
 
@@ -543,7 +544,7 @@ public class AciAuthorizationInterceptor
 
     // False positive, we want to keep the comment
     @SuppressWarnings("PMD.CollapsibleIfStatements")
-    public void modify( NextInterceptor next, ModifyOperationContext opContext ) throws Exception
+    public void modify( NextInterceptor next, ModifyOperationContext opContext ) throws LdapException
     {
         DN dn = opContext.getDn();
 
@@ -661,7 +662,7 @@ public class AciAuthorizationInterceptor
     }
 
 
-    public boolean hasEntry( NextInterceptor next, EntryOperationContext entryContext ) throws Exception
+    public boolean hasEntry( NextInterceptor next, EntryOperationContext entryContext ) throws LdapException
     {
         DN name = entryContext.getDn();
 
@@ -719,7 +720,7 @@ public class AciAuthorizationInterceptor
      * @param entry the raw entry pulled from the nexus
      * @throws Exception if undlying access to the DIT fails
      */
-    private void checkLookupAccess( LookupOperationContext lookupContext, Entry entry ) throws Exception
+    private void checkLookupAccess( LookupOperationContext lookupContext, Entry entry ) throws LdapException
     {
         // no permissions checks on the RootDSE
         if ( lookupContext.getDn().getNormName().trim().equals( "" ) )
@@ -753,7 +754,7 @@ public class AciAuthorizationInterceptor
     }
 
 
-    public Entry lookup( NextInterceptor next, LookupOperationContext lookupContext ) throws Exception
+    public Entry lookup( NextInterceptor next, LookupOperationContext lookupContext ) throws LdapException
     {
         CoreSession session = lookupContext.getSession();
         DirectoryService directoryService = session.getDirectoryService();
@@ -780,7 +781,7 @@ public class AciAuthorizationInterceptor
     }
 
 
-    public void rename( NextInterceptor next, RenameOperationContext renameContext ) throws Exception
+    public void rename( NextInterceptor next, RenameOperationContext renameContext ) throws LdapException
     {
         DN oldName = renameContext.getDn();
         Entry originalEntry = null;
@@ -831,7 +832,7 @@ public class AciAuthorizationInterceptor
 
 
     public void moveAndRename( NextInterceptor next, MoveAndRenameOperationContext moveAndRenameContext )
-        throws Exception
+        throws LdapException
     {
         DN oriChildName = moveAndRenameContext.getDn();
         DN newParentName = moveAndRenameContext.getParent();
@@ -908,7 +909,7 @@ public class AciAuthorizationInterceptor
     }
 
 
-    public void move( NextInterceptor next, MoveOperationContext moveContext ) throws Exception
+    public void move( NextInterceptor next, MoveOperationContext moveContext ) throws LdapException
     {
         DN oriChildName = moveContext.getDn();
         DN newParentName = moveContext.getParent();
@@ -983,7 +984,7 @@ public class AciAuthorizationInterceptor
     }
 
 
-    public EntryFilteringCursor list( NextInterceptor next, ListOperationContext opContext ) throws Exception
+    public EntryFilteringCursor list( NextInterceptor next, ListOperationContext opContext ) throws LdapException
     {
         LdapPrincipal user = opContext.getSession().getEffectivePrincipal();
         EntryFilteringCursor cursor = next.list( opContext );
@@ -1000,7 +1001,7 @@ public class AciAuthorizationInterceptor
     }
 
 
-    public EntryFilteringCursor search( NextInterceptor next, SearchOperationContext opContext ) throws Exception
+    public EntryFilteringCursor search( NextInterceptor next, SearchOperationContext opContext ) throws LdapException
     {
         LdapPrincipal user = opContext.getSession().getEffectivePrincipal();
         DN principalDn = user.getDN();
@@ -1029,7 +1030,7 @@ public class AciAuthorizationInterceptor
     }
 
 
-    public boolean compare( NextInterceptor next, CompareOperationContext opContext ) throws Exception
+    public boolean compare( NextInterceptor next, CompareOperationContext opContext ) throws LdapException
     {
         DN name = opContext.getDn();
         String oid = opContext.getOid();
@@ -1061,7 +1062,7 @@ public class AciAuthorizationInterceptor
     }
 
 
-    public DN getMatchedName( NextInterceptor next, GetMatchedNameOperationContext opContext ) throws Exception
+    public DN getMatchedName( NextInterceptor next, GetMatchedNameOperationContext opContext ) throws LdapException
     {
         // Access the principal requesting the operation, and bypass checks if it is the admin
         LdapPrincipal principal = opContext.getSession().getEffectivePrincipal();

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationInterceptor.java?rev=951068&r1=951067&r2=951068&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationInterceptor.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationInterceptor.java Thu Jun  3 17:05:26 2010
@@ -54,6 +54,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.entry.Entry;
 import org.apache.directory.shared.ldap.entry.EntryAttribute;
 import org.apache.directory.shared.ldap.entry.Value;
+import org.apache.directory.shared.ldap.exception.LdapException;
 import org.apache.directory.shared.ldap.exception.LdapNoPermissionException;
 import org.apache.directory.shared.ldap.name.DN;
 import org.apache.directory.shared.ldap.schema.AttributeType;
@@ -104,7 +105,7 @@ public class DefaultAuthorizationInterce
     }
 
 
-    public void init( DirectoryService directoryService ) throws Exception
+    public void init( DirectoryService directoryService ) throws LdapException
     {
         nexus = directoryService.getPartitionNexus();
         SchemaManager schemaManager = directoryService.getSchemaManager();
@@ -124,7 +125,7 @@ public class DefaultAuthorizationInterce
     }
 
 
-    private void loadAdministrators( DirectoryService directoryService ) throws Exception
+    private void loadAdministrators( DirectoryService directoryService ) throws LdapException
     {
         // read in the administrators and cache their normalized names
         Set<String> newAdministrators = new HashSet<String>( 2 );
@@ -157,7 +158,7 @@ public class DefaultAuthorizationInterce
     //    Lookup, search and list operations need to be handled using a filter
     // and so we need access to the filter service.
 
-    public void delete( NextInterceptor nextInterceptor, DeleteOperationContext opContext ) throws Exception
+    public void delete( NextInterceptor nextInterceptor, DeleteOperationContext opContext ) throws LdapException
     {
         if ( opContext.getSession().getDirectoryService().isAccessControlEnabled() )
         {
@@ -233,7 +234,7 @@ public class DefaultAuthorizationInterce
      * users to self access these resources.  As far as we're concerned no one but
      * the admin needs access.
      */
-    public void modify( NextInterceptor nextInterceptor, ModifyOperationContext opContext ) throws Exception
+    public void modify( NextInterceptor nextInterceptor, ModifyOperationContext opContext ) throws LdapException
     {
         if ( !opContext.getSession().getDirectoryService().isAccessControlEnabled() )
         {
@@ -255,7 +256,7 @@ public class DefaultAuthorizationInterce
     }
 
 
-    private void protectModifyAlterations( DN dn ) throws Exception
+    private void protectModifyAlterations( DN dn ) throws LdapException
     {
         DN principalDn = getPrincipal().getDN();
 
@@ -310,7 +311,7 @@ public class DefaultAuthorizationInterce
     //  o The administrator entry cannot be moved or renamed by anyone
     // ------------------------------------------------------------------------
 
-    public void rename( NextInterceptor nextInterceptor, RenameOperationContext opContext ) throws Exception
+    public void rename( NextInterceptor nextInterceptor, RenameOperationContext opContext ) throws LdapException
     {
         if ( !opContext.getSession().getDirectoryService().isAccessControlEnabled() )
         {
@@ -321,7 +322,7 @@ public class DefaultAuthorizationInterce
     }
 
 
-    public void move( NextInterceptor nextInterceptor, MoveOperationContext opContext ) throws Exception
+    public void move( NextInterceptor nextInterceptor, MoveOperationContext opContext ) throws LdapException
     {
         if ( !opContext.getSession().getDirectoryService().isAccessControlEnabled() )
         {
@@ -333,7 +334,7 @@ public class DefaultAuthorizationInterce
 
 
     public void moveAndRename( NextInterceptor nextInterceptor, MoveAndRenameOperationContext opContext )
-        throws Exception
+        throws LdapException
     {
         if ( !opContext.getSession().getDirectoryService().isAccessControlEnabled() )
         {
@@ -344,7 +345,7 @@ public class DefaultAuthorizationInterce
     }
 
 
-    private void protectDnAlterations( DN dn ) throws Exception
+    private void protectDnAlterations( DN dn ) throws LdapException
     {
         DN principalDn = getPrincipal().getDN();
 
@@ -385,7 +386,7 @@ public class DefaultAuthorizationInterce
     }
 
 
-    public Entry lookup( NextInterceptor nextInterceptor, LookupOperationContext opContext ) throws Exception
+    public Entry lookup( NextInterceptor nextInterceptor, LookupOperationContext opContext ) throws LdapException
     {
         CoreSession session = opContext.getSession();
         Entry entry = nextInterceptor.lookup( opContext );
@@ -401,7 +402,7 @@ public class DefaultAuthorizationInterce
     }
 
 
-    private void protectLookUp( DN principalDn, DN normalizedDn ) throws Exception
+    private void protectLookUp( DN principalDn, DN normalizedDn ) throws LdapException
     {
         if ( !isAnAdministrator( principalDn ) )
         {
@@ -451,7 +452,7 @@ public class DefaultAuthorizationInterce
 
 
     public EntryFilteringCursor search( NextInterceptor nextInterceptor, SearchOperationContext opContext )
-        throws Exception
+        throws LdapException
     {
         EntryFilteringCursor cursor = nextInterceptor.search( opContext );
 
@@ -472,7 +473,7 @@ public class DefaultAuthorizationInterce
 
 
     public EntryFilteringCursor list( NextInterceptor nextInterceptor, ListOperationContext opContext )
-        throws Exception
+        throws LdapException
     {
         EntryFilteringCursor cursor = nextInterceptor.list( opContext );
 

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/GroupCache.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/GroupCache.java?rev=951068&r1=951067&r2=951068&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/GroupCache.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/GroupCache.java Thu Jun  3 17:05:26 2010
@@ -35,13 +35,14 @@ import org.apache.directory.server.core.
 import org.apache.directory.server.core.partition.PartitionNexus;
 import org.apache.directory.server.i18n.I18n;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
-import org.apache.directory.shared.ldap.entry.StringValue;
+import org.apache.directory.shared.ldap.entry.Entry;
 import org.apache.directory.shared.ldap.entry.EntryAttribute;
 import org.apache.directory.shared.ldap.entry.Modification;
 import org.apache.directory.shared.ldap.entry.ModificationOperation;
-import org.apache.directory.shared.ldap.entry.Entry;
+import org.apache.directory.shared.ldap.entry.StringValue;
 import org.apache.directory.shared.ldap.entry.Value;
 import org.apache.directory.shared.ldap.exception.LdapException;
+import org.apache.directory.shared.ldap.exception.LdapOperationException;
 import org.apache.directory.shared.ldap.filter.BranchNode;
 import org.apache.directory.shared.ldap.filter.EqualityNode;
 import org.apache.directory.shared.ldap.filter.OrNode;
@@ -97,7 +98,7 @@ public class GroupCache
      * @param directoryService the directory service core
      * @throws LdapException if there are failures on initialization 
      */
-    public GroupCache( CoreSession session ) throws Exception
+    public GroupCache( CoreSession session ) throws LdapException
     {
         SchemaManager schemaManager = session.getDirectoryService().getSchemaManager();
         normalizerMap = schemaManager.getNormalizerMapping();
@@ -120,7 +121,7 @@ public class GroupCache
     }
 
 
-    private void initialize( CoreSession session ) throws Exception
+    private void initialize( CoreSession session ) throws LdapException
     {
         // search all naming contexts for static groups and generate
         // normalized sets of members to cache within the map
@@ -147,25 +148,32 @@ public class GroupCache
             searchOperationContext.setAliasDerefMode( AliasDerefMode.DEREF_ALWAYS );
             EntryFilteringCursor results = nexus.search( searchOperationContext );
 
-            while ( results.next() )
+            try
             {
-                Entry result = results.get();
-                DN groupDn = result.getDn().normalize( normalizerMap );
-                EntryAttribute members = getMemberAttribute( result );
-
-                if ( members != null )
+                while ( results.next() )
                 {
-                    Set<String> memberSet = new HashSet<String>( members.size() );
-                    addMembers( memberSet, members );
-                    groups.put( groupDn.getNormName(), memberSet );
-                }
-                else
-                {
-                    LOG.warn( "Found group '{}' without any member or uniqueMember attributes", groupDn.getName() );
+                    Entry result = results.get();
+                    DN groupDn = result.getDn().normalize( normalizerMap );
+                    EntryAttribute members = getMemberAttribute( result );
+    
+                    if ( members != null )
+                    {
+                        Set<String> memberSet = new HashSet<String>( members.size() );
+                        addMembers( memberSet, members );
+                        groups.put( groupDn.getNormName(), memberSet );
+                    }
+                    else
+                    {
+                        LOG.warn( "Found group '{}' without any member or uniqueMember attributes", groupDn.getName() );
+                    }
                 }
+    
+                results.close();
+            }
+            catch ( Exception e )
+            {
+                throw new LdapOperationException( e.getMessage() );
             }
-
-            results.close();
         }
 
         if ( IS_DEBUG )

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/TupleCache.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/TupleCache.java?rev=951068&r1=951067&r2=951068&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/TupleCache.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/TupleCache.java Thu Jun  3 17:05:26 2010
@@ -28,6 +28,7 @@ import java.util.List;
 import java.util.Map;
 import java.util.Set;
 
+import javax.naming.NamingException;
 import javax.naming.directory.SearchControls;
 
 import org.apache.directory.server.core.CoreSession;
@@ -39,12 +40,13 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.aci.ACIItemParser;
 import org.apache.directory.shared.ldap.aci.ACITuple;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
-import org.apache.directory.shared.ldap.entry.StringValue;
+import org.apache.directory.shared.ldap.entry.Entry;
 import org.apache.directory.shared.ldap.entry.EntryAttribute;
 import org.apache.directory.shared.ldap.entry.Modification;
-import org.apache.directory.shared.ldap.entry.Entry;
+import org.apache.directory.shared.ldap.entry.StringValue;
 import org.apache.directory.shared.ldap.entry.Value;
 import org.apache.directory.shared.ldap.exception.LdapException;
+import org.apache.directory.shared.ldap.exception.LdapOperationErrorException;
 import org.apache.directory.shared.ldap.exception.LdapSchemaViolationException;
 import org.apache.directory.shared.ldap.filter.EqualityNode;
 import org.apache.directory.shared.ldap.filter.ExprNode;
@@ -91,7 +93,7 @@ public class TupleCache
      * @param directoryService the context factory configuration for the server
      * @throws NamingException if initialization fails
      */
-    public TupleCache( CoreSession session ) throws Exception
+    public TupleCache( CoreSession session ) throws LdapException
     {
         SchemaManager schemaManager = session.getDirectoryService().getSchemaManager();
         this.nexus = session.getDirectoryService().getPartitionNexus();
@@ -110,7 +112,7 @@ public class TupleCache
     }
 
 
-    private void initialize( CoreSession session ) throws Exception
+    private void initialize( CoreSession session ) throws LdapException
     {
         // search all naming contexts for access control subentenries
         // generate ACITuple Arrays for each subentry
@@ -131,24 +133,31 @@ public class TupleCache
 
             EntryFilteringCursor results = nexus.search( searchOperationContext );
 
-            while ( results.next() )
+            try
             {
-                Entry result = results.get();
-                DN subentryDn = result.getDn().normalize( session.getDirectoryService().getSchemaManager().
-                        getNormalizerMapping() );
-                EntryAttribute aci = result.get( prescriptiveAciAT );
-
-                if ( aci == null )
+                while ( results.next() )
                 {
-                    LOG.warn( "Found accessControlSubentry '" + subentryDn + "' without any "
-                        + SchemaConstants.PRESCRIPTIVE_ACI_AT );
-                    continue;
+                    Entry result = results.get();
+                    DN subentryDn = result.getDn().normalize( session.getDirectoryService().getSchemaManager().
+                            getNormalizerMapping() );
+                    EntryAttribute aci = result.get( prescriptiveAciAT );
+    
+                    if ( aci == null )
+                    {
+                        LOG.warn( "Found accessControlSubentry '" + subentryDn + "' without any "
+                            + SchemaConstants.PRESCRIPTIVE_ACI_AT );
+                        continue;
+                    }
+    
+                    subentryAdded( subentryDn, result );
                 }
-
-                subentryAdded( subentryDn, result );
+    
+                results.close();
+            }
+            catch ( Exception e )
+            {
+                throw new LdapOperationErrorException( e.getMessage() );
             }
-
-            results.close();
         }
     }
 

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/ACDFEngine.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/ACDFEngine.java?rev=951068&r1=951067&r2=951068&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/ACDFEngine.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/ACDFEngine.java Thu Jun  3 17:05:26 2010
@@ -47,6 +47,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.constants.AuthenticationLevel;
 import org.apache.directory.shared.ldap.entry.Entry;
 import org.apache.directory.shared.ldap.entry.Value;
+import org.apache.directory.shared.ldap.exception.LdapException;
 import org.apache.directory.shared.ldap.exception.LdapNoPermissionException;
 import org.apache.directory.shared.ldap.name.DN;
 import org.apache.directory.shared.ldap.schema.SchemaManager;
@@ -89,7 +90,7 @@ public class ACDFEngine
      * 
      * @throws NamingException if failed to initialize internal components
      */
-    public ACDFEngine( OidRegistry oidRegistry, SchemaManager schemaManager ) throws NamingException
+    public ACDFEngine( OidRegistry oidRegistry, SchemaManager schemaManager ) throws LdapException
     {
         Evaluator entryEvaluator = new ExpressionEvaluator( oidRegistry, schemaManager );
         SubtreeEvaluator subtreeEvaluator = new SubtreeEvaluator( oidRegistry, schemaManager );
@@ -138,7 +139,7 @@ public class ACDFEngine
         Collection<MicroOperation> microOperations, 
         Collection<ACITuple> aciTuples, 
         Entry entry, 
-        Entry entryView ) throws Exception
+        Entry entryView ) throws LdapException
     {
         if ( !hasPermission( schemaManager, opContext, userGroupNames, username, authenticationLevel, entryName, 
             attrId, attrValue, microOperations, aciTuples, entry, entryView ) )
@@ -196,7 +197,7 @@ public class ACDFEngine
         Collection<MicroOperation> microOperations, 
         Collection<ACITuple> aciTuples, 
         Entry entry, 
-        Entry entryView ) throws Exception
+        Entry entryView ) throws LdapException
     {
         if ( entryName == null )
         {

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/ACITupleFilter.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/ACITupleFilter.java?rev=951068&r1=951067&r2=951068&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/ACITupleFilter.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/ACITupleFilter.java Thu Jun  3 17:05:26 2010
@@ -22,12 +22,15 @@ package org.apache.directory.server.core
 
 import java.util.Collection;
 
+import javax.naming.NamingException;
+
 import org.apache.directory.server.core.interceptor.context.OperationContext;
 import org.apache.directory.shared.ldap.aci.ACITuple;
 import org.apache.directory.shared.ldap.aci.MicroOperation;
 import org.apache.directory.shared.ldap.constants.AuthenticationLevel;
 import org.apache.directory.shared.ldap.entry.Entry;
 import org.apache.directory.shared.ldap.entry.Value;
+import org.apache.directory.shared.ldap.exception.LdapException;
 import org.apache.directory.shared.ldap.name.DN;
 import org.apache.directory.shared.ldap.schema.SchemaManager;
 
@@ -77,5 +80,5 @@ public interface ACITupleFilter
             Entry entry, 
             Collection<MicroOperation> microOperations,
             Entry entryView )
-        throws Exception;
+        throws LdapException;
 }

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/HighestPrecedenceFilter.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/HighestPrecedenceFilter.java?rev=951068&r1=951067&r2=951068&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/HighestPrecedenceFilter.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/HighestPrecedenceFilter.java Thu Jun  3 17:05:26 2010
@@ -23,14 +23,13 @@ package org.apache.directory.server.core
 import java.util.Collection;
 import java.util.Iterator;
 
-import javax.naming.NamingException;
-
 import org.apache.directory.server.core.interceptor.context.OperationContext;
 import org.apache.directory.shared.ldap.aci.ACITuple;
 import org.apache.directory.shared.ldap.aci.MicroOperation;
 import org.apache.directory.shared.ldap.constants.AuthenticationLevel;
 import org.apache.directory.shared.ldap.entry.Entry;
 import org.apache.directory.shared.ldap.entry.Value;
+import org.apache.directory.shared.ldap.exception.LdapException;
 import org.apache.directory.shared.ldap.name.DN;
 import org.apache.directory.shared.ldap.schema.SchemaManager;
 
@@ -59,7 +58,7 @@ public class HighestPrecedenceFilter imp
             Entry entry, 
             Collection<MicroOperation> microOperations,
             Entry entryView )
-        throws NamingException
+        throws LdapException
     {
         if ( tuples.size() <= 1 )
         {

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/MaxImmSubFilter.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/MaxImmSubFilter.java?rev=951068&r1=951067&r2=951068&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/MaxImmSubFilter.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/MaxImmSubFilter.java Thu Jun  3 17:05:26 2010
@@ -45,6 +45,9 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.entry.Entry;
 import org.apache.directory.shared.ldap.entry.Value;
+import org.apache.directory.shared.ldap.exception.LdapException;
+import org.apache.directory.shared.ldap.exception.LdapOperationException;
+import org.apache.directory.shared.ldap.exception.LdapOtherException;
 import org.apache.directory.shared.ldap.filter.ExprNode;
 import org.apache.directory.shared.ldap.filter.PresenceNode;
 import org.apache.directory.shared.ldap.message.AliasDerefMode;
@@ -89,7 +92,7 @@ public class MaxImmSubFilter implements 
             Entry entry, 
             Collection<MicroOperation> microOperations,
             Entry entryView )
-        throws Exception
+        throws LdapException
     {
         if ( entryName.size() == 0 )
         {
@@ -154,7 +157,7 @@ public class MaxImmSubFilter implements 
     }
 
 
-    private int getImmSubCount( OperationContext opContext, DN entryName ) throws Exception
+    private int getImmSubCount( OperationContext opContext, DN entryName ) throws LdapException
     {
         int cnt = 0;
         EntryFilteringCursor results = null;
@@ -168,18 +171,31 @@ public class MaxImmSubFilter implements 
             
             results = opContext.getSession().getDirectoryService().getOperationManager().search( searchContext );
 
-            while ( results.next() )
+            try
             {
-                results.get();
-                cnt++;
+                while ( results.next() )
+                {
+                    results.get();
+                    cnt++;
+                }
+            }
+            catch ( Exception e )
+            {
+                throw new LdapOtherException( e.getMessage() );
             }
-
         }
         finally
         {
             if ( results != null )
             {
-                results.close();
+                try
+                {
+                    results.close();
+                }
+                catch ( Exception e )
+                {
+                    throw new LdapOperationException( e.getMessage() );
+                }
             }
         }
 

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/MaxValueCountFilter.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/MaxValueCountFilter.java?rev=951068&r1=951067&r2=951068&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/MaxValueCountFilter.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/MaxValueCountFilter.java Thu Jun  3 17:05:26 2010
@@ -23,17 +23,16 @@ package org.apache.directory.server.core
 import java.util.Collection;
 import java.util.Iterator;
 
-import javax.naming.NamingException;
-
 import org.apache.directory.server.core.interceptor.context.OperationContext;
 import org.apache.directory.shared.ldap.aci.ACITuple;
 import org.apache.directory.shared.ldap.aci.MicroOperation;
 import org.apache.directory.shared.ldap.aci.ProtectedItem;
 import org.apache.directory.shared.ldap.aci.ProtectedItem.MaxValueCountItem;
 import org.apache.directory.shared.ldap.constants.AuthenticationLevel;
-import org.apache.directory.shared.ldap.entry.EntryAttribute;
 import org.apache.directory.shared.ldap.entry.Entry;
+import org.apache.directory.shared.ldap.entry.EntryAttribute;
 import org.apache.directory.shared.ldap.entry.Value;
+import org.apache.directory.shared.ldap.exception.LdapException;
 import org.apache.directory.shared.ldap.name.DN;
 import org.apache.directory.shared.ldap.schema.SchemaManager;
 
@@ -62,7 +61,7 @@ public class MaxValueCountFilter impleme
             Entry entry, 
             Collection<MicroOperation> microOperations,
             Entry entryView )
-        throws NamingException
+        throws LdapException
     {
         if ( scope != OperationScope.ATTRIBUTE_TYPE_AND_VALUE )
         {
@@ -104,7 +103,7 @@ public class MaxValueCountFilter impleme
     }
 
 
-    private boolean isRemovable( ProtectedItem.MaxValueCount mvc, String attrId, Entry entryView ) throws NamingException
+    private boolean isRemovable( ProtectedItem.MaxValueCount mvc, String attrId, Entry entryView ) throws LdapException
     {
         for ( Iterator<ProtectedItem.MaxValueCountItem> k = mvc.iterator(); k.hasNext(); )
         {

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/MicroOperationFilter.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/MicroOperationFilter.java?rev=951068&r1=951067&r2=951068&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/MicroOperationFilter.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/MicroOperationFilter.java Thu Jun  3 17:05:26 2010
@@ -23,14 +23,13 @@ package org.apache.directory.server.core
 import java.util.Collection;
 import java.util.Iterator;
 
-import javax.naming.NamingException;
-
 import org.apache.directory.server.core.interceptor.context.OperationContext;
 import org.apache.directory.shared.ldap.aci.ACITuple;
 import org.apache.directory.shared.ldap.aci.MicroOperation;
 import org.apache.directory.shared.ldap.constants.AuthenticationLevel;
 import org.apache.directory.shared.ldap.entry.Entry;
 import org.apache.directory.shared.ldap.entry.Value;
+import org.apache.directory.shared.ldap.exception.LdapException;
 import org.apache.directory.shared.ldap.name.DN;
 import org.apache.directory.shared.ldap.schema.SchemaManager;
 
@@ -60,7 +59,7 @@ public class MicroOperationFilter implem
             Entry entry, 
             Collection<MicroOperation> microOperations,
             Entry entryView )
-        throws NamingException
+        throws LdapException
     {
         if ( tuples.size() == 0 )
         {

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/MostSpecificProtectedItemFilter.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/MostSpecificProtectedItemFilter.java?rev=951068&r1=951067&r2=951068&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/MostSpecificProtectedItemFilter.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/MostSpecificProtectedItemFilter.java Thu Jun  3 17:05:26 2010
@@ -23,8 +23,6 @@ package org.apache.directory.server.core
 import java.util.ArrayList;
 import java.util.Collection;
 
-import javax.naming.NamingException;
-
 import org.apache.directory.server.core.interceptor.context.OperationContext;
 import org.apache.directory.shared.ldap.aci.ACITuple;
 import org.apache.directory.shared.ldap.aci.MicroOperation;
@@ -32,6 +30,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.constants.AuthenticationLevel;
 import org.apache.directory.shared.ldap.entry.Entry;
 import org.apache.directory.shared.ldap.entry.Value;
+import org.apache.directory.shared.ldap.exception.LdapException;
 import org.apache.directory.shared.ldap.name.DN;
 import org.apache.directory.shared.ldap.schema.SchemaManager;
 
@@ -68,7 +67,7 @@ public class MostSpecificProtectedItemFi
             Entry entry, 
             Collection<MicroOperation> microOperations,
             Entry entryView )
-        throws NamingException
+        throws LdapException
     {
         if ( tuples.size() <= 1 )
         {

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/MostSpecificUserClassFilter.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/MostSpecificUserClassFilter.java?rev=951068&r1=951067&r2=951068&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/MostSpecificUserClassFilter.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/MostSpecificUserClassFilter.java Thu Jun  3 17:05:26 2010
@@ -23,8 +23,6 @@ package org.apache.directory.server.core
 import java.util.ArrayList;
 import java.util.Collection;
 
-import javax.naming.NamingException;
-
 import org.apache.directory.server.core.interceptor.context.OperationContext;
 import org.apache.directory.shared.ldap.aci.ACITuple;
 import org.apache.directory.shared.ldap.aci.MicroOperation;
@@ -32,6 +30,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.constants.AuthenticationLevel;
 import org.apache.directory.shared.ldap.entry.Entry;
 import org.apache.directory.shared.ldap.entry.Value;
+import org.apache.directory.shared.ldap.exception.LdapException;
 import org.apache.directory.shared.ldap.name.DN;
 import org.apache.directory.shared.ldap.schema.SchemaManager;
 
@@ -66,7 +65,7 @@ public class MostSpecificUserClassFilter
             Entry entry, 
             Collection<MicroOperation> microOperations,
             Entry entryView )
-        throws NamingException
+        throws LdapException
     {
         if ( tuples.size() <= 1 )
         {

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/RelatedProtectedItemFilter.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/RelatedProtectedItemFilter.java?rev=951068&r1=951067&r2=951068&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/RelatedProtectedItemFilter.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/RelatedProtectedItemFilter.java Thu Jun  3 17:05:26 2010
@@ -23,7 +23,6 @@ package org.apache.directory.server.core
 import java.util.Collection;
 import java.util.Iterator;
 
-import javax.naming.NamingException;
 import javax.naming.directory.Attribute;
 
 import org.apache.directory.server.core.event.Evaluator;
@@ -37,8 +36,8 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.aci.ProtectedItem.RestrictedByItem;
 import org.apache.directory.shared.ldap.constants.AuthenticationLevel;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
-import org.apache.directory.shared.ldap.entry.EntryAttribute;
 import org.apache.directory.shared.ldap.entry.Entry;
+import org.apache.directory.shared.ldap.entry.EntryAttribute;
 import org.apache.directory.shared.ldap.entry.Value;
 import org.apache.directory.shared.ldap.exception.LdapException;
 import org.apache.directory.shared.ldap.name.DN;
@@ -86,7 +85,7 @@ public class RelatedProtectedItemFilter 
             Entry entry, 
             Collection<MicroOperation> microOperations,
             Entry entryView )
-        throws LdapException, NamingException
+        throws LdapException
     {
         if ( tuples.size() == 0 )
         {
@@ -108,7 +107,7 @@ public class RelatedProtectedItemFilter 
 
 
     private boolean isRelated( ACITuple tuple, OperationScope scope, DN userName, DN entryName, String attrId,
-                               Value<?> attrValue, Entry entry ) throws LdapException, NamingException, InternalError
+                               Value<?> attrValue, Entry entry ) throws LdapException, InternalError
     {
         String oid = null;
         

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/RestrictedByFilter.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/RestrictedByFilter.java?rev=951068&r1=951067&r2=951068&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/RestrictedByFilter.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/RestrictedByFilter.java Thu Jun  3 17:05:26 2010
@@ -23,17 +23,16 @@ package org.apache.directory.server.core
 import java.util.Collection;
 import java.util.Iterator;
 
-import javax.naming.NamingException;
-
 import org.apache.directory.server.core.interceptor.context.OperationContext;
 import org.apache.directory.shared.ldap.aci.ACITuple;
 import org.apache.directory.shared.ldap.aci.MicroOperation;
 import org.apache.directory.shared.ldap.aci.ProtectedItem;
 import org.apache.directory.shared.ldap.aci.ProtectedItem.RestrictedByItem;
 import org.apache.directory.shared.ldap.constants.AuthenticationLevel;
-import org.apache.directory.shared.ldap.entry.EntryAttribute;
 import org.apache.directory.shared.ldap.entry.Entry;
+import org.apache.directory.shared.ldap.entry.EntryAttribute;
 import org.apache.directory.shared.ldap.entry.Value;
+import org.apache.directory.shared.ldap.exception.LdapException;
 import org.apache.directory.shared.ldap.name.DN;
 import org.apache.directory.shared.ldap.schema.SchemaManager;
 
@@ -62,7 +61,7 @@ public class RestrictedByFilter implemen
             Entry entry, 
             Collection<MicroOperation> microOperations,
             Entry entryView )
-        throws NamingException
+        throws LdapException
     {
         if ( scope != OperationScope.ATTRIBUTE_TYPE_AND_VALUE )
         {
@@ -93,7 +92,7 @@ public class RestrictedByFilter implemen
     }
 
 
-    public boolean isRemovable( ACITuple tuple, String attrId, Value<?> attrValue, Entry entry ) throws NamingException
+    public boolean isRemovable( ACITuple tuple, String attrId, Value<?> attrValue, Entry entry ) throws LdapException
     {
         for ( ProtectedItem item : tuple.getProtectedItems() )
         {

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/changelog/ChangeLogInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/changelog/ChangeLogInterceptor.java?rev=951068&r1=951067&r2=951068&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/changelog/ChangeLogInterceptor.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/changelog/ChangeLogInterceptor.java Thu Jun  3 17:05:26 2010
@@ -41,6 +41,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.entry.Entry;
 import org.apache.directory.shared.ldap.entry.EntryAttribute;
 import org.apache.directory.shared.ldap.entry.Modification;
+import org.apache.directory.shared.ldap.exception.LdapException;
 import org.apache.directory.shared.ldap.ldif.ChangeType;
 import org.apache.directory.shared.ldap.ldif.LdifEntry;
 import org.apache.directory.shared.ldap.ldif.LdifRevertor;
@@ -84,7 +85,7 @@ public class ChangeLogInterceptor extend
      * The init method will initialize the local variables and load the 
      * entryDeleted AttributeType.
      */
-    public void init( DirectoryService directoryService ) throws Exception
+    public void init( DirectoryService directoryService ) throws LdapException
     {
         super.init( directoryService );
 
@@ -100,7 +101,7 @@ public class ChangeLogInterceptor extend
     // -----------------------------------------------------------------------
     
 
-    public void add( NextInterceptor next, AddOperationContext opContext ) throws Exception
+    public void add( NextInterceptor next, AddOperationContext opContext ) throws LdapException
     {
         next.add( opContext );
 
@@ -137,7 +138,7 @@ public class ChangeLogInterceptor extend
      * The delete operation has to be stored with a way to restore the deleted element.
      * There is no way to do that but reading the entry and dump it into the LOG.
      */
-    public void delete( NextInterceptor next, DeleteOperationContext opContext ) throws Exception
+    public void delete( NextInterceptor next, DeleteOperationContext opContext ) throws LdapException
     {
         // @todo make sure we're not putting in operational attributes that cannot be user modified
         // must save the entry if change log is enabled
@@ -189,7 +190,7 @@ public class ChangeLogInterceptor extend
      * @return the entry's attributes (may be immutable if the schema subentry)
      * @throws Exception on error accessing the entry's attributes
      */
-    private Entry getAttributes( OperationContext opContext ) throws Exception
+    private Entry getAttributes( OperationContext opContext ) throws LdapException
     {
         DN dn = opContext.getDn();
         Entry serverEntry;
@@ -211,7 +212,7 @@ public class ChangeLogInterceptor extend
     /**
      * 
      */
-    public void modify( NextInterceptor next, ModifyOperationContext opContext ) throws Exception
+    public void modify( NextInterceptor next, ModifyOperationContext opContext ) throws LdapException
     {
         Entry serverEntry = null;
         Modification modification = ServerEntryUtils.getModificationItem( opContext.getModItems(), entryDeleted );
@@ -290,7 +291,7 @@ public class ChangeLogInterceptor extend
     // -----------------------------------------------------------------------
 
 
-    public void rename ( NextInterceptor next, RenameOperationContext renameContext ) throws Exception
+    public void rename ( NextInterceptor next, RenameOperationContext renameContext ) throws LdapException
     {
         Entry serverEntry = null;
         
@@ -323,7 +324,7 @@ public class ChangeLogInterceptor extend
 
 
     public void moveAndRename( NextInterceptor next, MoveAndRenameOperationContext opCtx )
-        throws Exception
+        throws LdapException
     {
         Entry serverEntry = null;
         
@@ -353,7 +354,7 @@ public class ChangeLogInterceptor extend
     }
 
 
-    public void move ( NextInterceptor next, MoveOperationContext opCtx ) throws Exception
+    public void move ( NextInterceptor next, MoveOperationContext opCtx ) throws LdapException
     {
         next.move( opCtx );
 

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/changelog/DefaultChangeLog.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/changelog/DefaultChangeLog.java?rev=951068&r1=951067&r2=951068&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/changelog/DefaultChangeLog.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/changelog/DefaultChangeLog.java Thu Jun  3 17:05:26 2010
@@ -25,7 +25,10 @@ import org.apache.directory.server.core.
 import org.apache.directory.server.core.LdapPrincipal;
 import org.apache.directory.server.core.partition.Partition;
 import org.apache.directory.server.i18n.I18n;
+import org.apache.directory.shared.ldap.exception.LdapException;
+import org.apache.directory.shared.ldap.exception.LdapUnwillingToPerformException;
 import org.apache.directory.shared.ldap.ldif.LdifEntry;
+import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -121,28 +124,44 @@ public class DefaultChangeLog implements
     /**
      * {@inheritDoc}
      */
-    public ChangeLogEvent log( LdapPrincipal principal, LdifEntry forward, LdifEntry reverse ) throws Exception
+    public ChangeLogEvent log( LdapPrincipal principal, LdifEntry forward, LdifEntry reverse ) throws LdapException
     {
         if ( !enabled )
         {
             throw new IllegalStateException( I18n.err( I18n.ERR_236 ) );
         }
 
-        return store.log( principal, forward, reverse );
+        try
+        {
+            ChangeLogEvent event = store.log( principal, forward, reverse );
+            
+            return event;
+        }
+        catch ( Exception e )
+        {
+            throw new LdapUnwillingToPerformException( ResultCodeEnum.UNWILLING_TO_PERFORM, e.getMessage() );
+        }
     }
 
 
     /**
      * {@inheritDoc}
      */
-    public ChangeLogEvent log( LdapPrincipal principal, LdifEntry forward, List<LdifEntry> reverses ) throws Exception
+    public ChangeLogEvent log( LdapPrincipal principal, LdifEntry forward, List<LdifEntry> reverses ) throws LdapException
     {
         if ( !enabled )
         {
             throw new IllegalStateException( I18n.err( I18n.ERR_236 ) );
         }
 
-        return store.log( principal, forward, reverses );
+        try
+        {
+            return store.log( principal, forward, reverses );
+        }
+        catch ( Exception e )
+        {
+            throw new LdapUnwillingToPerformException( ResultCodeEnum.UNWILLING_TO_PERFORM, e.getMessage() );
+        }
     }