directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r658864 - in /directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core: ./ jndi/ normalization/ operational/ partition/
Date Wed, 21 May 2008 20:54:03 GMT
Author: akarasulu
Date: Wed May 21 13:54:03 2008
New Revision: 658864

URL: http://svn.apache.org/viewvc?rev=658864&view=rev
Log:
fixing breakage by replacing NamingException and NamingEnumeration

Modified:
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/jndi/ServerLdapContext.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/normalization/NormalizationInterceptor.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/PartitionNexus.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/PartitionNexusProxy.java

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java?rev=658864&r1=658863&r2=658864&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java Wed May 21 13:54:03 2008
@@ -509,7 +509,7 @@
     }
 
 
-    public void addPartition( Partition parition ) throws NamingException
+    public void addPartition( Partition parition ) throws Exception
     {
         partitions.add( parition );
 
@@ -756,7 +756,7 @@
                     {
                         shutdown();
                     }
-                    catch ( NamingException e )
+                    catch ( Exception e )
                     {
                         LOG.warn( "Failed to shut down the directory service: "
                             + DefaultDirectoryService.this.instanceId, e );
@@ -787,7 +787,7 @@
     }
 
 
-    public synchronized void sync() throws NamingException
+    public synchronized void sync() throws Exception
     {
         if ( !started )
         {
@@ -799,7 +799,7 @@
     }
 
 
-    public synchronized void shutdown() throws NamingException
+    public synchronized void shutdown() throws Exception
     {
         if ( !started )
         {
@@ -1207,7 +1207,7 @@
      * Displays security warning messages if any possible secutiry issue is found.
      * @throws NamingException if there are failures parsing and accessing internal structures
      */
-    private void showSecurityWarnings() throws NamingException
+    private void showSecurityWarnings() throws Exception
     {
         // Warn if the default password is not changed.
         boolean needToChangeAdminPassword = false;
@@ -1242,7 +1242,7 @@
      * 
      * @throws NamingException if the creation of test entries fails.
      */
-    private void createTestEntries() throws NamingException
+    private void createTestEntries() throws Exception
     {
         LdapPrincipal principal = new LdapPrincipal( adminDn, AuthenticationLevel.SIMPLE );
         ServerLdapContext ctx = new ServerLdapContext( this, principal, new LdapDN() );

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/jndi/ServerLdapContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/jndi/ServerLdapContext.java?rev=658864&r1=658863&r2=658864&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/jndi/ServerLdapContext.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/jndi/ServerLdapContext.java Wed May 21 13:54:03 2008
@@ -212,7 +212,15 @@
         opCtx.addRequestControls( requestControls );
 
         // execute operation
-        boolean result = super.getNexusProxy().compare( opCtx );
+        boolean result = false;
+        try
+        {
+            result = super.getNexusProxy().compare( opCtx );
+        }
+        catch ( Exception e )
+        {
+            JndiUtils.wrap( e );
+        }
         
         // extract the response controls from the operation and return
         responseControls = getResponseControls();

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/normalization/NormalizationInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/normalization/NormalizationInterceptor.java?rev=658864&r1=658863&r2=658864&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/normalization/NormalizationInterceptor.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/normalization/NormalizationInterceptor.java Wed May 21 13:54:03 2008
@@ -21,8 +21,9 @@
 
 
 import org.apache.directory.server.core.DirectoryService;
+import org.apache.directory.server.core.cursor.Cursor;
+import org.apache.directory.server.core.cursor.EmptyCursor;
 import org.apache.directory.server.core.entry.ServerEntry;
-import org.apache.directory.server.core.entry.ServerSearchResult;
 import org.apache.directory.server.core.interceptor.BaseInterceptor;
 import org.apache.directory.server.core.interceptor.NextInterceptor;
 import org.apache.directory.server.core.interceptor.context.AddContextPartitionOperationContext;
@@ -49,12 +50,9 @@
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.name.NameComponentNormalizer;
 import org.apache.directory.shared.ldap.schema.OidNormalizer;
-import org.apache.directory.shared.ldap.util.EmptyEnumeration;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import javax.naming.NamingEnumeration;
-import javax.naming.NamingException;
 import java.util.Map;
 
 
@@ -85,7 +83,7 @@
     /**
      * Initialize the registries, normalizers. 
      */
-    public void init( DirectoryService directoryService ) throws NamingException
+    public void init( DirectoryService directoryService ) throws Exception
     {
         OidRegistry oidRegistry = directoryService.getRegistries().getOidRegistry();
         attributeRegistry = directoryService.getRegistries().getAttributeTypeRegistry();
@@ -106,28 +104,28 @@
     // Normalize all Name based arguments for ContextPartition interface operations
     // ------------------------------------------------------------------------
 
-    public void add( NextInterceptor nextInterceptor, AddOperationContext opContext ) throws NamingException
+    public void add( NextInterceptor nextInterceptor, AddOperationContext opContext ) throws Exception
     {
         opContext.getDn().normalize( attrNormalizers );
         nextInterceptor.add( opContext );
     }
 
 
-    public void delete( NextInterceptor nextInterceptor, DeleteOperationContext opContext ) throws NamingException
+    public void delete( NextInterceptor nextInterceptor, DeleteOperationContext opContext ) throws Exception
     {
         opContext.getDn().normalize( attrNormalizers );
         nextInterceptor.delete( opContext );
     }
 
 
-    public void modify( NextInterceptor nextInterceptor, ModifyOperationContext opContext ) throws NamingException
+    public void modify( NextInterceptor nextInterceptor, ModifyOperationContext opContext ) throws Exception
     {
         opContext.getDn().normalize( attrNormalizers );
         nextInterceptor.modify( opContext );
     }
 
 
-    public void rename( NextInterceptor nextInterceptor, RenameOperationContext opContext ) throws NamingException
+    public void rename( NextInterceptor nextInterceptor, RenameOperationContext opContext ) throws Exception
     {
         LdapDN rdn = new LdapDN();
         rdn.add( opContext.getNewRdn() );
@@ -139,7 +137,7 @@
     }
 
 
-    public void move( NextInterceptor nextInterceptor, MoveOperationContext opContext ) throws NamingException
+    public void move( NextInterceptor nextInterceptor, MoveOperationContext opContext ) throws Exception
     {
         opContext.getDn().normalize( attrNormalizers );
         opContext.getParent().normalize( attrNormalizers);
@@ -148,7 +146,7 @@
 
 
     public void moveAndRename( NextInterceptor nextInterceptor, MoveAndRenameOperationContext opContext )
-        throws NamingException
+        throws Exception
     {
         LdapDN rdn = new LdapDN();
         rdn.add( opContext.getNewRdn() );
@@ -161,7 +159,7 @@
     }
 
 
-    public NamingEnumeration<ServerSearchResult> search( NextInterceptor nextInterceptor, SearchOperationContext opContext ) throws NamingException
+    public Cursor<ServerEntry> search( NextInterceptor nextInterceptor, SearchOperationContext opContext ) throws Exception
     {
         ExprNode filter = opContext.getFilter();
         opContext.getDn().normalize( attrNormalizers );
@@ -170,7 +168,7 @@
         if ( result == null )
         {
             LOG.warn( "undefined filter based on undefined attributeType not evaluted at all.  Returning empty enumeration." );
-            return new EmptyEnumeration<ServerSearchResult>();
+            return new EmptyCursor<ServerEntry>();
         }
         else
         {
@@ -182,21 +180,21 @@
     }
 
 
-    public boolean hasEntry( NextInterceptor nextInterceptor, EntryOperationContext opContext ) throws NamingException
+    public boolean hasEntry( NextInterceptor nextInterceptor, EntryOperationContext opContext ) throws Exception
     {
         opContext.getDn().normalize( attrNormalizers );
         return nextInterceptor.hasEntry( opContext );
     }
 
 
-    public NamingEnumeration<ServerSearchResult> list( NextInterceptor nextInterceptor, ListOperationContext opContext ) throws NamingException
+    public Cursor<ServerEntry> list( NextInterceptor nextInterceptor, ListOperationContext opContext ) throws Exception
     {
         opContext.getDn().normalize( attrNormalizers );
         return nextInterceptor.list( opContext );
     }
 
     
-    private String[] normalizeAttrsId( String[] attrIds ) throws NamingException
+    private String[] normalizeAttrsId( String[] attrIds ) throws Exception
     {
         if ( attrIds == null )
         {
@@ -215,7 +213,7 @@
         return normalizedAttrIds;
     }
 
-    public ServerEntry lookup( NextInterceptor nextInterceptor, LookupOperationContext opContext ) throws NamingException
+    public ServerEntry lookup( NextInterceptor nextInterceptor, LookupOperationContext opContext ) throws Exception
     {
         opContext.getDn().normalize( attrNormalizers );
         
@@ -233,41 +231,41 @@
     // Normalize all Name based arguments for other interface operations
     // ------------------------------------------------------------------------
 
-    public LdapDN getMatchedName ( NextInterceptor nextInterceptor, GetMatchedNameOperationContext opContext ) throws NamingException
+    public LdapDN getMatchedName ( NextInterceptor nextInterceptor, GetMatchedNameOperationContext opContext ) throws Exception
     {
         opContext.getDn().normalize( attrNormalizers );
         return nextInterceptor.getMatchedName( opContext );
     }
 
 
-    public LdapDN getSuffix ( NextInterceptor nextInterceptor, GetSuffixOperationContext opContext ) throws NamingException
+    public LdapDN getSuffix ( NextInterceptor nextInterceptor, GetSuffixOperationContext opContext ) throws Exception
     {
         opContext.getDn().normalize( attrNormalizers );
         return nextInterceptor.getSuffix( opContext );
     }
 
 
-    public boolean compare( NextInterceptor next, CompareOperationContext opContext ) throws NamingException
+    public boolean compare( NextInterceptor next, CompareOperationContext opContext ) throws Exception
     {
         opContext.getDn().normalize( attrNormalizers );
         return next.compare( opContext );
     }
     
     
-    public void bind( NextInterceptor next, BindOperationContext opContext )  throws NamingException
+    public void bind( NextInterceptor next, BindOperationContext opContext )  throws Exception
     {
         opContext.getDn().normalize( attrNormalizers );
         next.bind( opContext );
     }
 
 
-    public void addContextPartition( NextInterceptor next, AddContextPartitionOperationContext opContext ) throws NamingException
+    public void addContextPartition( NextInterceptor next, AddContextPartitionOperationContext opContext ) throws Exception
     {
         next.addContextPartition( opContext );
     }
 
 
-    public void removeContextPartition( NextInterceptor next, RemoveContextPartitionOperationContext opContext ) throws NamingException
+    public void removeContextPartition( NextInterceptor next, RemoveContextPartitionOperationContext opContext ) throws Exception
     {
         opContext.getDn().normalize( attrNormalizers );
         next.removeContextPartition( opContext );

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java?rev=658864&r1=658863&r2=658864&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java Wed May 21 13:54:03 2008
@@ -25,8 +25,10 @@
 import java.util.List;
 import java.util.Set;
 
+import org.apache.commons.lang.NotImplementedException;
 import org.apache.directory.server.constants.ApacheSchemaConstants;
 import org.apache.directory.server.core.DirectoryService;
+import org.apache.directory.server.core.cursor.Cursor;
 import org.apache.directory.server.core.entry.DefaultServerAttribute;
 import org.apache.directory.server.core.entry.DefaultServerEntry;
 import org.apache.directory.server.core.entry.ServerAttribute;
@@ -34,7 +36,6 @@
 import org.apache.directory.server.core.entry.ServerModification;
 import org.apache.directory.server.core.entry.ServerSearchResult;
 import org.apache.directory.server.core.enumeration.SearchResultFilter;
-import org.apache.directory.server.core.enumeration.SearchResultFilteringEnumeration;
 import org.apache.directory.server.core.interceptor.BaseInterceptor;
 import org.apache.directory.server.core.interceptor.Interceptor;
 import org.apache.directory.server.core.interceptor.NextInterceptor;
@@ -62,8 +63,6 @@
 import org.apache.directory.shared.ldap.schema.UsageEnum;
 import org.apache.directory.shared.ldap.util.DateUtils;
 
-import javax.naming.NamingEnumeration;
-import javax.naming.NamingException;
 import javax.naming.directory.SearchControls;
 
 
@@ -83,7 +82,7 @@
     private final SearchResultFilter DENORMALIZING_SEARCH_FILTER = new SearchResultFilter()
     {
         public boolean accept( Invocation invocation, ServerSearchResult result, SearchControls controls ) 
-            throws NamingException
+            throws Exception
         {
             ServerEntry serverEntry = result.getServerEntry(); 
             
@@ -106,7 +105,7 @@
     private final SearchResultFilter SEARCH_FILTER = new SearchResultFilter()
     {
         public boolean accept( Invocation invocation, ServerSearchResult result, SearchControls controls )
-            throws NamingException
+            throws Exception
         {
             ServerEntry serverEntry = result.getServerEntry(); 
             
@@ -132,7 +131,7 @@
     }
 
 
-    public void init( DirectoryService directoryService ) throws NamingException
+    public void init( DirectoryService directoryService ) throws Exception
     {
         service = directoryService;
         registries = directoryService.getRegistries();
@@ -155,7 +154,7 @@
      * Adds extra operational attributes to the entry before it is added.
      */
     public void add( NextInterceptor nextInterceptor, AddOperationContext opContext )
-        throws NamingException
+        throws Exception
     {
         String principal = getPrincipal().getName();
         
@@ -169,7 +168,7 @@
 
 
     public void modify( NextInterceptor nextInterceptor, ModifyOperationContext opContext )
-        throws NamingException
+        throws Exception
     {
         nextInterceptor.modify( opContext );
         
@@ -214,7 +213,7 @@
 
 
     public void rename( NextInterceptor nextInterceptor, RenameOperationContext opContext )
-        throws NamingException
+        throws Exception
     {
         nextInterceptor.rename( opContext );
 
@@ -236,7 +235,7 @@
     }
 
 
-    public void move( NextInterceptor nextInterceptor, MoveOperationContext opContext ) throws NamingException
+    public void move( NextInterceptor nextInterceptor, MoveOperationContext opContext ) throws Exception
     {
         nextInterceptor.move( opContext );
 
@@ -256,7 +255,7 @@
 
 
     public void moveAndRename( NextInterceptor nextInterceptor, MoveAndRenameOperationContext opContext )
-        throws NamingException
+        throws Exception
     {
         nextInterceptor.moveAndRename( opContext );
 
@@ -275,7 +274,7 @@
     }
 
 
-    public ServerEntry lookup( NextInterceptor nextInterceptor, LookupOperationContext opContext ) throws NamingException
+    public ServerEntry lookup( NextInterceptor nextInterceptor, LookupOperationContext opContext ) throws Exception
     {
         ServerEntry result = nextInterceptor.lookup( opContext );
         
@@ -297,32 +296,38 @@
     }
 
 
-    public NamingEnumeration<ServerSearchResult> list( NextInterceptor nextInterceptor, ListOperationContext opContext ) throws NamingException
+    public Cursor<ServerEntry> list( NextInterceptor nextInterceptor, ListOperationContext opContext ) throws Exception
     {
-        NamingEnumeration<ServerSearchResult> result = nextInterceptor.list( opContext );
+        Cursor<ServerEntry> result = nextInterceptor.list( opContext );
         Invocation invocation = InvocationStack.getInstance().peek();
         
-        return new SearchResultFilteringEnumeration( result, new SearchControls(), invocation, SEARCH_FILTER, "List Operational Filter" );
+//        return new SearchResultFilteringEnumeration( result, new SearchControls(), invocation, SEARCH_FILTER, "List Operational Filter" );
+        // TODO not implemented
+        throw new NotImplementedException();
     }
 
 
-    public NamingEnumeration<ServerSearchResult> search( NextInterceptor nextInterceptor, SearchOperationContext opContext ) throws NamingException
+    public Cursor<ServerEntry> search( NextInterceptor nextInterceptor, SearchOperationContext opContext ) throws Exception
     {
         Invocation invocation = InvocationStack.getInstance().peek();
-        NamingEnumeration<ServerSearchResult> result = nextInterceptor.search( opContext );
+        Cursor<ServerEntry> result = nextInterceptor.search( opContext );
         SearchControls searchCtls = opContext.getSearchControls();
         
         if ( searchCtls.getReturningAttributes() != null )
         {
             if ( service.isDenormalizeOpAttrsEnabled() )
             {
-                return new SearchResultFilteringEnumeration( result, searchCtls, invocation, DENORMALIZING_SEARCH_FILTER, "Search Operational Filter denormalized" );
+//                return new SearchResultFilteringEnumeration( result, searchCtls, invocation, DENORMALIZING_SEARCH_FILTER, "Search Operational Filter denormalized" );
+                // TODO not implemented
+                throw new NotImplementedException();
             }
                 
             return result;
         }
 
-        return new SearchResultFilteringEnumeration( result, searchCtls, invocation, SEARCH_FILTER , "Search Operational Filter");
+//        return new SearchResultFilteringEnumeration( result, searchCtls, invocation, SEARCH_FILTER , "Search Operational Filter");
+        // TODO Not implemented
+        throw new NotImplementedException();
     }
 
 
@@ -332,9 +337,9 @@
      *
      * @param attributes the resultant attributes to filter
      * @return true always
-     * @throws NamingException if there are failures in evaluation
+     * @throws Exception if there are failures in evaluation
      */
-    private boolean filterOperationalAttributes( ServerEntry attributes ) throws NamingException
+    private boolean filterOperationalAttributes( ServerEntry attributes ) throws Exception
     {
         Set<AttributeType> removedAttributes = new HashSet<AttributeType>();
 
@@ -357,7 +362,7 @@
     }
 
 
-    private void filter( LookupOperationContext lookupContext, ServerEntry entry ) throws NamingException
+    private void filter( LookupOperationContext lookupContext, ServerEntry entry ) throws Exception
     {
         LdapDN dn = lookupContext.getDn();
         List<String> ids = lookupContext.getAttrsId();
@@ -390,7 +395,7 @@
     }
 
     
-    public void denormalizeEntryOpAttrs( ServerEntry entry ) throws NamingException
+    public void denormalizeEntryOpAttrs( ServerEntry entry ) throws Exception
     {
         if ( service.isDenormalizeOpAttrsEnabled() )
         {
@@ -433,9 +438,9 @@
      * 
      * @param dn the normalized distinguished name
      * @return the distinuished name denormalized
-     * @throws NamingException if there are problems denormalizing
+     * @throws Exception if there are problems denormalizing
      */
-    public LdapDN denormalizeTypes( LdapDN dn ) throws NamingException
+    public LdapDN denormalizeTypes( LdapDN dn ) throws Exception
     {
         LdapDN newDn = new LdapDN();
         
@@ -477,7 +482,7 @@
     }
 
 
-    private boolean filterDenormalized( ServerEntry entry ) throws NamingException
+    private boolean filterDenormalized( ServerEntry entry ) throws Exception
     {
         denormalizeEntryOpAttrs( entry );
         return true;

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java?rev=658864&r1=658863&r2=658864&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java Wed May 21 13:54:03 2008
@@ -22,6 +22,8 @@
 
 import org.apache.directory.server.constants.ServerDNConstants;
 import org.apache.directory.server.core.DirectoryService;
+import org.apache.directory.server.core.cursor.Cursor;
+import org.apache.directory.server.core.cursor.SingletonCursor;
 import org.apache.directory.server.core.entry.DefaultServerAttribute;
 import org.apache.directory.server.core.entry.DefaultServerEntry;
 import org.apache.directory.server.core.entry.ServerAttribute;
@@ -62,6 +64,7 @@
 import org.apache.directory.shared.ldap.entry.Value;
 import org.apache.directory.shared.ldap.exception.LdapInvalidAttributeIdentifierException;
 import org.apache.directory.shared.ldap.exception.LdapNameNotFoundException;
+import org.apache.directory.shared.ldap.exception.LdapNamingException;
 import org.apache.directory.shared.ldap.exception.LdapNoSuchAttributeException;
 import org.apache.directory.shared.ldap.filter.ExprNode;
 import org.apache.directory.shared.ldap.filter.PresenceNode;
@@ -84,7 +87,6 @@
 
 import javax.naming.ConfigurationException;
 import javax.naming.NameNotFoundException;
-import javax.naming.NamingEnumeration;
 import javax.naming.NamingException;
 import javax.naming.directory.SearchControls;
 import javax.naming.ldap.LdapContext;
@@ -154,9 +156,9 @@
      *
      * @see <a href="http://www.faqs.org/rfcs/rfc3045.html">Vendor Information</a>
      * @param rootDSE the root entry for the DSA
-     * @throws javax.naming.NamingException on failure to initialize
+     * @throws javax.naming.Exception on failure to initialize
      */
-    public DefaultPartitionNexus( ServerEntry rootDSE ) throws NamingException
+    public DefaultPartitionNexus( ServerEntry rootDSE ) throws Exception
     {
         // setup that root DSE
         this.rootDSE = rootDSE;
@@ -289,7 +291,7 @@
 
 
     public void init( DirectoryService directoryService )
-        throws NamingException
+        throws Exception
     {
         // NOTE: We ignore ContextPartitionConfiguration parameter here.
         if ( initialized )
@@ -347,7 +349,7 @@
     }
 
 
-    private Partition initializeSystemPartition() throws NamingException
+    private Partition initializeSystemPartition() throws Exception
     {
         // initialize system partition first
         Partition override = directoryService.getSystemPartition();
@@ -403,7 +405,7 @@
             // add all attribute oids of index configs to a hashset
             if ( override instanceof JdbmPartition )
             {
-                Set<Index> indices = ( ( JdbmPartition ) override ).getIndexedAttributes();
+                Set<Index<Object,ServerEntry>> indices = ( ( JdbmPartition ) override ).getIndexedAttributes();
                 Set<String> indexOids = new HashSet<String>();
                 OidRegistry registry = registries.getOidRegistry();
 
@@ -435,7 +437,7 @@
             system.setSuffix( ServerDNConstants.SYSTEM_DN );
     
             // Add objectClass attribute for the system partition
-            Set<Index> indexedAttrs = new HashSet<Index>();
+            Set<Index<Object,ServerEntry>> indexedAttrs = new HashSet<Index<Object,ServerEntry>>();
             indexedAttrs.add( new JdbmIndex( SchemaConstants.OBJECT_CLASS_AT ) );
             ( ( JdbmPartition ) system ).setIndexedAttributes( indexedAttrs );
     
@@ -510,7 +512,7 @@
             {
                 removeContextPartition( new RemoveContextPartitionOperationContext( registries, new LdapDN( suffix ) ) );
             }
-            catch ( NamingException e )
+            catch ( Exception e )
             {
                 LOG.warn( "Failed to destroy a partition: " + suffix, e );
             }
@@ -523,7 +525,7 @@
     /**
      * @see Partition#sync()
      */
-    public void sync() throws NamingException
+    public void sync() throws Exception
     {
         MultiException error = null;
 
@@ -533,7 +535,7 @@
             {
                 partition.sync();
             }
-            catch ( NamingException e )
+            catch ( Exception e )
             {
                 LOG.warn( "Failed to flush partition data out.", e );
                 if ( error == null )
@@ -549,10 +551,7 @@
 
         if ( error != null )
         {
-            String msg = "Encountered failures while performing a sync() operation on backing stores";
-            //noinspection ThrowableInstanceNeverThrown
-            NamingException total = new NamingException( msg );
-            total.setRootCause( error );
+            throw error;
         }
     }
 
@@ -561,7 +560,7 @@
     // ContextPartitionNexus Method Implementations
     // ------------------------------------------------------------------------
 
-    public boolean compare( CompareOperationContext compareContext ) throws NamingException
+    public boolean compare( CompareOperationContext compareContext ) throws Exception
     {
         Partition partition = getPartition( compareContext.getDn() );
         AttributeTypeRegistry registry = registries.getAttributeTypeRegistry();
@@ -628,7 +627,7 @@
     }
 
 
-    public synchronized void addContextPartition( AddContextPartitionOperationContext opContext ) throws NamingException
+    public synchronized void addContextPartition( AddContextPartitionOperationContext opContext ) throws Exception
     {
         Partition partition = opContext.getPartition();
 
@@ -682,7 +681,7 @@
     }
 
 
-    public synchronized void removeContextPartition( RemoveContextPartitionOperationContext removeContextPartition ) throws NamingException
+    public synchronized void removeContextPartition( RemoveContextPartitionOperationContext removeContextPartition ) throws Exception
     {
         String key = removeContextPartition.getDn().getNormName();
         Partition partition = partitions.get( key );
@@ -737,7 +736,7 @@
     /**
      * @see PartitionNexus#getMatchedName( GetMatchedNameOperationContext )
      */
-    public LdapDN getMatchedName ( GetMatchedNameOperationContext getMatchedNameContext ) throws NamingException
+    public LdapDN getMatchedName ( GetMatchedNameOperationContext getMatchedNameContext ) throws Exception
     {
         LdapDN dn = ( LdapDN ) getMatchedNameContext.getDn().clone();
         
@@ -769,7 +768,7 @@
     /**
      * @see PartitionNexus#getSuffix( GetSuffixOperationContext )
      */
-    public LdapDN getSuffix ( GetSuffixOperationContext getSuffixContext ) throws NamingException
+    public LdapDN getSuffix ( GetSuffixOperationContext getSuffixContext ) throws Exception
     {
         Partition backend = getPartition( getSuffixContext.getDn() );
         return backend.getSuffixDn();
@@ -779,7 +778,7 @@
     /**
      * @see PartitionNexus#listSuffixes( ListSuffixOperationContext )
      */
-    public Iterator<String> listSuffixes ( ListSuffixOperationContext emptyContext ) throws NamingException
+    public Iterator<String> listSuffixes ( ListSuffixOperationContext emptyContext ) throws Exception
     {
         return Collections.unmodifiableSet( partitions.keySet() ).iterator();
     }
@@ -802,9 +801,9 @@
      *
      * @param partition ContextPartition component to unregister with this
      * BackendNexus.
-     * @throws NamingException if there are problems unregistering the partition
+     * @throws Exception if there are problems unregistering the partition
      */
-    private void unregister( Partition partition ) throws NamingException
+    private void unregister( Partition partition ) throws Exception
     {
         EntryAttribute namingContexts = rootDSE.get( SchemaConstants.NAMING_CONTEXTS_AT );
         
@@ -820,13 +819,13 @@
     // ------------------------------------------------------------------------
     // DirectoryPartition Interface Method Implementations
     // ------------------------------------------------------------------------
-    public void bind( BindOperationContext bindContext ) throws NamingException
+    public void bind( BindOperationContext bindContext ) throws Exception
     {
         Partition partition = getPartition( bindContext.getDn() );
         partition.bind( bindContext );
     }
 
-    public void unbind( UnbindOperationContext unbindContext ) throws NamingException
+    public void unbind( UnbindOperationContext unbindContext ) throws Exception
     {
         Partition partition = getPartition( unbindContext.getDn() );
         partition.unbind( unbindContext );
@@ -836,7 +835,7 @@
     /**
      * @see Partition#delete(DeleteOperationContext)
      */
-    public void delete( DeleteOperationContext deleteContext ) throws NamingException
+    public void delete( DeleteOperationContext deleteContext ) throws Exception
     {
         Partition backend = getPartition( deleteContext.getDn() );
         backend.delete( deleteContext );
@@ -852,14 +851,14 @@
      *
      * @see Partition#add( AddOperationContext )
      */
-    public void add( AddOperationContext addContext ) throws NamingException
+    public void add( AddOperationContext addContext ) throws Exception
     {
         Partition backend = getPartition( addContext.getDn() );
         backend.add( addContext );
     }
 
 
-    public void modify( ModifyOperationContext modifyContext ) throws NamingException
+    public void modify( ModifyOperationContext modifyContext ) throws Exception
     {
         Partition backend = getPartition( modifyContext.getDn() );
         backend.modify( modifyContext );
@@ -869,15 +868,15 @@
     /**
      * @see Partition#list(ListOperationContext)
      */
-    public NamingEnumeration<ServerSearchResult> list( ListOperationContext opContext ) throws NamingException
+    public Cursor<ServerEntry> list( ListOperationContext opContext ) throws Exception
     {
         Partition backend = getPartition( opContext.getDn() );
         return backend.list( opContext );
     }
 
 
-    public NamingEnumeration<ServerSearchResult> search( SearchOperationContext opContext )
-        throws NamingException
+    public Cursor<ServerEntry> search( SearchOperationContext opContext )
+        throws Exception
     {
         LdapDN base = opContext.getDn();
         SearchControls searchCtls = opContext.getSearchControls();
@@ -905,8 +904,7 @@
                 if ( ( ids == null ) || ( ids.length == 0 ) )
                 {
                 	ServerEntry rootDSE = (ServerEntry)getRootDSE( null ).clone();
-                    ServerSearchResult result = new ServerSearchResult( LdapDN.EMPTY_LDAPDN, null, rootDSE, false );
-                    return new SingletonEnumeration<ServerSearchResult>( result );
+                    return new SingletonCursor<ServerEntry>( rootDSE );
                 }
                 
                 // -----------------------------------------------------------
@@ -941,7 +939,7 @@
                         {
                             realIds.add( oidRegistry.getOid( idTrimmed ) );
                         }
-                        catch ( NamingException e )
+                        catch ( Exception e )
                         {
                             realIds.add( idTrimmed );
                         }
@@ -952,16 +950,14 @@
                 if ( containsOneDotOne )
                 {
                 	ServerEntry serverEntry = new DefaultServerEntry( registries, base );
-                    ServerSearchResult result = new ServerSearchResult( LdapDN.EMPTY_LDAPDN, null, serverEntry, false );
-                    return new SingletonEnumeration<ServerSearchResult>( result );
+                    return new SingletonCursor<ServerEntry>( serverEntry );
                 }
                 
                 // return everything
                 if ( containsAsterisk && containsPlus )
                 {
                 	ServerEntry rootDSE = (ServerEntry)getRootDSE( null ).clone();
-                    ServerSearchResult result = new ServerSearchResult( LdapDN.EMPTY_LDAPDN, null, rootDSE, false );
-                    return new SingletonEnumeration<ServerSearchResult>( result );
+                    return new SingletonCursor<ServerEntry>( rootDSE );
                 }
                 
                 ServerEntry serverEntry = new DefaultServerEntry( registries, opContext.getDn() );
@@ -986,8 +982,7 @@
                     }
                 }
 
-                ServerSearchResult result = new ServerSearchResult( LdapDN.EMPTY_LDAPDN, null, serverEntry, false );
-                return new SingletonEnumeration<ServerSearchResult>( result );
+                return new SingletonCursor<ServerEntry>( serverEntry );
             }
 
             throw new LdapNameNotFoundException();
@@ -998,7 +993,7 @@
     }
 
 
-    public ServerEntry lookup( LookupOperationContext opContext ) throws NamingException
+    public ServerEntry lookup( LookupOperationContext opContext ) throws Exception
     {
         LdapDN dn = opContext.getDn();
         
@@ -1043,7 +1038,7 @@
     /**
      * @see Partition#hasEntry(EntryOperationContext)
      */
-    public boolean hasEntry( EntryOperationContext opContext ) throws NamingException
+    public boolean hasEntry( EntryOperationContext opContext ) throws Exception
     {
         LdapDN dn = opContext.getDn();
         
@@ -1065,7 +1060,7 @@
     /**
      * @see Partition#rename(RenameOperationContext)
      */
-    public void rename( RenameOperationContext opContext ) throws NamingException
+    public void rename( RenameOperationContext opContext ) throws Exception
     {
         Partition backend = getPartition( opContext.getDn() );
         backend.rename( opContext );
@@ -1075,14 +1070,14 @@
     /**
      * @see Partition#move(MoveOperationContext)
      */
-    public void move( MoveOperationContext opContext ) throws NamingException
+    public void move( MoveOperationContext opContext ) throws Exception
     {
         Partition backend = getPartition( opContext.getDn() );
         backend.move( opContext );
     }
 
 
-    public void moveAndRename( MoveAndRenameOperationContext opContext ) throws NamingException
+    public void moveAndRename( MoveAndRenameOperationContext opContext ) throws Exception
     {
         Partition backend = getPartition( opContext.getDn() );
         backend.moveAndRename( opContext );
@@ -1094,9 +1089,9 @@
      *
      * @param dn the normalized distinguished name to resolve to a partition
      * @return the backend partition associated with the normalized dn
-     * @throws NamingException if the name cannot be resolved to a partition
+     * @throws Exception if the name cannot be resolved to a partition
      */
-    public Partition getPartition( LdapDN dn ) throws NamingException
+    public Partition getPartition( LdapDN dn ) throws Exception
     {
         Enumeration<String> rdns = dn.getAll();
         
@@ -1139,7 +1134,7 @@
     }
 
 
-    public void registerSupportedExtensions( Set<String> extensionOids ) throws NamingException
+    public void registerSupportedExtensions( Set<String> extensionOids ) throws Exception
     {
         EntryAttribute supportedExtension = rootDSE.get( SchemaConstants.SUPPORTED_EXTENSION_AT );
 
@@ -1156,7 +1151,7 @@
     }
 
 
-    public void registerSupportedSaslMechanisms( Set<String> supportedSaslMechanisms ) throws NamingException
+    public void registerSupportedSaslMechanisms( Set<String> supportedSaslMechanisms ) throws Exception
     {
         EntryAttribute supportedSaslMechanismsAttribute = rootDSE.get( SchemaConstants.SUPPORTED_SASL_MECHANISMS_AT );
 
@@ -1171,4 +1166,12 @@
             supportedSaslMechanismsAttribute.add( saslMechanism );
         }
     }
+
+
+    public ServerEntry lookup( Long id ) throws Exception
+    {
+        // TODO not implemented until we can use id to figure out the partition using
+        // the partition ID component of the 64 bit Long identifier
+        throw new NotImplementedException();
+    }
 }

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/PartitionNexus.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/PartitionNexus.java?rev=658864&r1=658863&r2=658864&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/PartitionNexus.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/PartitionNexus.java Wed May 21 13:54:03 2008
@@ -26,7 +26,6 @@
 import java.util.Set;
 
 import javax.naming.InvalidNameException;
-import javax.naming.NamingException;
 import javax.naming.ldap.LdapContext;
 
 import org.apache.directory.server.constants.ServerDNConstants;
@@ -77,7 +76,7 @@
         {
             adminDn = new LdapDN( ServerDNConstants.ADMIN_SYSTEM_DN );
         }
-        catch ( NamingException e )
+        catch ( Exception e )
         {
             throw new InternalError();
         }
@@ -100,7 +99,7 @@
         {
             // Nothing we can do ...
         }
-        catch ( NamingException ne )
+        catch ( Exception ne )
         {
             // Nothing we can do ...
         }
@@ -122,7 +121,7 @@
         {
             groupsBaseDn = new LdapDN( ServerDNConstants.GROUPS_SYSTEM_DN );
         }
-        catch ( NamingException e )
+        catch ( Exception e )
         {
             throw new InternalError();
         }
@@ -144,7 +143,7 @@
         {
             usersBaseDn = new LdapDN( ServerDNConstants.USERS_SYSTEM_DN );
         }
-        catch ( NamingException e )
+        catch ( Exception e )
         {
             throw new InternalError();
         }
@@ -167,7 +166,7 @@
      *
      * @return the attributes of the RootDSE
      */
-    public abstract ServerEntry getRootDSE( GetRootDSEOperationContext opContext ) throws NamingException;
+    public abstract ServerEntry getRootDSE( GetRootDSEOperationContext opContext ) throws Exception;
 
 
     /**
@@ -176,15 +175,16 @@
      *
      * @param compareContext the context used to compare
      * @return true if the entry contains an attribute with the value, false otherwise
-     * @throws NamingException if there is a problem accessing the entry and its values
+     * @throws Exception if there is a problem accessing the entry and its values
+     * @throws Exception 
      */
-    public abstract boolean compare( CompareOperationContext compareContext ) throws NamingException;
+    public abstract boolean compare( CompareOperationContext compareContext ) throws Exception;
 
 
-    public abstract void addContextPartition( AddContextPartitionOperationContext opContext ) throws NamingException;
+    public abstract void addContextPartition( AddContextPartitionOperationContext opContext ) throws Exception;
 
 
-    public abstract void removeContextPartition( RemoveContextPartitionOperationContext opContext ) throws NamingException;
+    public abstract void removeContextPartition( RemoveContextPartitionOperationContext opContext ) throws Exception;
 
 
     public abstract Partition getSystemPartition();
@@ -198,9 +198,9 @@
      * 
      * @param dn the normalized distinguished name to get a partition for
      * @return the partition containing the entry represented by the dn
-     * @throws NamingException if there is no partition for the dn
+     * @throws Exception if there is no partition for the dn
      */
-    public abstract Partition getPartition( LdapDN dn ) throws NamingException;
+    public abstract Partition getPartition( LdapDN dn ) throws Exception;
 
 
     /**
@@ -211,9 +211,9 @@
      * @return a distinguished name representing the matching portion of dn,
      * as originally provided by the user on creation of the matched entry or 
      * the empty string distinguished name if no match was found.
-     * @throws NamingException if there are any problems
+     * @throws Exception if there are any problems
      */
-    public abstract LdapDN getMatchedName ( GetMatchedNameOperationContext getMatchedNameContext ) throws NamingException;
+    public abstract LdapDN getMatchedName ( GetMatchedNameOperationContext getMatchedNameContext ) throws Exception;
 
 
     /**
@@ -225,9 +225,9 @@
      * name to use for finding a suffix.
      * @return the suffix portion of dn, or the valid empty string Dn if no
      * naming context was found for dn.
-     * @throws NamingException if there are any problems
+     * @throws Exception if there are any problems
      */
-    public abstract LdapDN getSuffix ( GetSuffixOperationContext suffixContext ) throws NamingException;
+    public abstract LdapDN getSuffix ( GetSuffixOperationContext suffixContext ) throws Exception;
 
 
     /**
@@ -235,9 +235,9 @@
      * {@link PartitionNexus}.
      *
      * @return Iteration over ContextPartition suffix names as Names.
-     * @throws NamingException if there are any problems
+     * @throws Exception if there are any problems
      */
-    public abstract Iterator<String> listSuffixes( ListSuffixOperationContext opContext ) throws NamingException;
+    public abstract Iterator<String> listSuffixes( ListSuffixOperationContext opContext ) throws Exception;
 
 
     /**
@@ -246,8 +246,8 @@
      * @param extensionOids a set of OID strings to add to the supportedExtension 
      * attribute in the RootDSE
      */
-    public abstract void registerSupportedExtensions( Set<String> extensionOids ) throws NamingException;
+    public abstract void registerSupportedExtensions( Set<String> extensionOids ) throws Exception;
 
 
-    public abstract void registerSupportedSaslMechanisms( Set<String> strings ) throws NamingException;
+    public abstract void registerSupportedSaslMechanisms( Set<String> strings ) throws Exception;
 }

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/PartitionNexusProxy.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/PartitionNexusProxy.java?rev=658864&r1=658863&r2=658864&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/PartitionNexusProxy.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/PartitionNexusProxy.java Wed May 21 13:54:03 2008
@@ -28,8 +28,6 @@
 import java.util.Set;
 
 import javax.naming.Context;
-import javax.naming.NamingEnumeration;
-import javax.naming.NamingException;
 import javax.naming.ServiceUnavailableException;
 import javax.naming.directory.SearchControls;
 import javax.naming.event.EventContext;
@@ -42,6 +40,7 @@
 import org.apache.directory.server.core.authz.DefaultAuthorizationInterceptor;
 import org.apache.directory.server.core.changelog.ChangeLogInterceptor;
 import org.apache.directory.server.core.collective.CollectiveAttributeInterceptor;
+import org.apache.directory.server.core.cursor.Cursor;
 import org.apache.directory.server.core.entry.ServerEntry;
 import org.apache.directory.server.core.entry.ServerSearchResult;
 import org.apache.directory.server.core.enumeration.SearchResultFilter;
@@ -76,6 +75,7 @@
 import org.apache.directory.server.core.schema.SchemaInterceptor;
 import org.apache.directory.server.core.subtree.SubentryInterceptor;
 import org.apache.directory.server.core.trigger.TriggerInterceptor;
+import org.apache.directory.shared.ldap.NotImplementedException;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.exception.LdapSizeLimitExceededException;
 import org.apache.directory.shared.ldap.exception.LdapTimeLimitExceededException;
@@ -217,7 +217,7 @@
      * @param caller  a JNDI {@link Context} object that will call this proxy
      * @param service a JNDI service
      */
-    public PartitionNexusProxy( Context caller, DirectoryService service ) throws NamingException
+    public PartitionNexusProxy( Context caller, DirectoryService service ) throws Exception
     {
         this.caller = caller;
         this.service = service;
@@ -278,7 +278,7 @@
     }
 
 
-    public void init( DirectoryService core ) throws NamingException
+    public void init( DirectoryService core ) throws Exception
     {
     }
 
@@ -294,30 +294,30 @@
     }
 
 
-    public Partition getPartition( LdapDN dn ) throws NamingException
+    public Partition getPartition( LdapDN dn ) throws Exception
     {
         return service.getPartitionNexus().getPartition( dn );
     }
 
 
-    public LdapDN getSuffixDn() throws NamingException
+    public LdapDN getSuffixDn() throws Exception
     {
         return service.getPartitionNexus().getSuffixDn();
     }
 
-    public LdapDN getUpSuffixDn() throws NamingException
+    public LdapDN getUpSuffixDn() throws Exception
     {
         return service.getPartitionNexus().getUpSuffixDn();
     }
 
 
-    public void sync() throws NamingException
+    public void sync() throws Exception
     {
         this.service.sync();
     }
 
 
-    public void close() throws NamingException
+    public void close() throws Exception
     {
         this.service.shutdown();
     }
@@ -329,13 +329,13 @@
     }
 
 
-    public LdapDN getMatchedName( GetMatchedNameOperationContext opContext ) throws NamingException
+    public LdapDN getMatchedName( GetMatchedNameOperationContext opContext ) throws Exception
     {
         return getMatchedName( opContext, null );
     }
 
 
-    public LdapDN getMatchedName( GetMatchedNameOperationContext opContext, Collection<String> bypass ) throws NamingException
+    public LdapDN getMatchedName( GetMatchedNameOperationContext opContext, Collection<String> bypass ) throws Exception
     {
         ensureStarted();
         opContext.push( new Invocation( this, caller, "getMatchedName", bypass ) );
@@ -351,13 +351,13 @@
     }
 
 
-    public LdapDN getSuffix( GetSuffixOperationContext opContext ) throws NamingException
+    public LdapDN getSuffix( GetSuffixOperationContext opContext ) throws Exception
     {
         return getSuffix( opContext, null );
     }
 
 
-    public LdapDN getSuffix( GetSuffixOperationContext opContext, Collection<String> bypass ) throws NamingException
+    public LdapDN getSuffix( GetSuffixOperationContext opContext, Collection<String> bypass ) throws Exception
     {
         ensureStarted();
         opContext.push( new Invocation( this, caller, "getSuffixDn", bypass ) );
@@ -373,13 +373,13 @@
     }
 
 
-    public Iterator<String> listSuffixes( ListSuffixOperationContext opContext ) throws NamingException
+    public Iterator<String> listSuffixes( ListSuffixOperationContext opContext ) throws Exception
     {
         return listSuffixes( opContext, null );
     }
 
 
-    public Iterator<String> listSuffixes( ListSuffixOperationContext opContext, Collection<String> bypass ) throws NamingException
+    public Iterator<String> listSuffixes( ListSuffixOperationContext opContext, Collection<String> bypass ) throws Exception
     {
         ensureStarted();
         opContext.push( new Invocation( this, caller, "listSuffices", bypass ) );
@@ -395,13 +395,13 @@
     }
 
 
-    public boolean compare( CompareOperationContext opContext ) throws NamingException
+    public boolean compare( CompareOperationContext opContext ) throws Exception
     {
         return compare( opContext, null );
     }
 
 
-    public boolean compare( CompareOperationContext opContext, Collection<String> bypass ) throws NamingException
+    public boolean compare( CompareOperationContext opContext, Collection<String> bypass ) throws Exception
     {
         ensureStarted();
         opContext.push( new Invocation( this, caller, "compare", bypass ) );
@@ -417,13 +417,13 @@
     }
 
 
-    public void delete( DeleteOperationContext opContext ) throws NamingException
+    public void delete( DeleteOperationContext opContext ) throws Exception
     {
         delete( opContext, null );
     }
 
 
-    public void delete( DeleteOperationContext opContext, Collection<String> bypass ) throws NamingException
+    public void delete( DeleteOperationContext opContext, Collection<String> bypass ) throws Exception
     {
         ensureStarted();
         opContext.push( new Invocation( this, caller, "delete", bypass ) );
@@ -439,13 +439,13 @@
     }
 
 
-    public void add( AddOperationContext opContext ) throws NamingException
+    public void add( AddOperationContext opContext ) throws Exception
     {
         add( opContext, null );
     }
 
 
-    public void add( AddOperationContext opContext, Collection<String> bypass ) throws NamingException
+    public void add( AddOperationContext opContext, Collection<String> bypass ) throws Exception
     {
         ensureStarted();
         opContext.push( new Invocation( this, caller, "add", bypass ) );
@@ -461,13 +461,13 @@
     }
 
 
-    public void modify( ModifyOperationContext opContext ) throws NamingException
+    public void modify( ModifyOperationContext opContext ) throws Exception
     {
         modify( opContext, null );
     }
 
 
-    public void modify( ModifyOperationContext opContext, Collection<String> bypass ) throws NamingException
+    public void modify( ModifyOperationContext opContext, Collection<String> bypass ) throws Exception
     {
         ensureStarted();
         opContext.push( new Invocation( this, caller, "modify", bypass ) );
@@ -483,14 +483,14 @@
     }
 
 
-    public NamingEnumeration<ServerSearchResult> list( ListOperationContext opContext ) throws NamingException
+    public Cursor<ServerEntry> list( ListOperationContext opContext ) throws Exception
     {
         return list( opContext, null );
     }
 
 
-    public NamingEnumeration<ServerSearchResult> list( ListOperationContext opContext, Collection<String> bypass )
-            throws NamingException
+    public Cursor<ServerEntry> list( ListOperationContext opContext, Collection<String> bypass )
+            throws Exception
     {
         ensureStarted();
         opContext.push( new Invocation( this, caller, "list", bypass ) );
@@ -506,10 +506,9 @@
     }
 
 
-    public NamingEnumeration<ServerSearchResult> search( SearchOperationContext opContext )
-            throws NamingException
+    public Cursor<ServerEntry> search( SearchOperationContext opContext ) throws Exception
     {
-        NamingEnumeration<ServerSearchResult> ne = search( opContext, null );
+        Cursor<ServerEntry> ne = search( opContext, null );
 
         if ( ne instanceof SearchResultFilteringEnumeration )
         {
@@ -528,7 +527,7 @@
 
 
                     public boolean accept( Invocation invocation, ServerSearchResult result, SearchControls controls )
-                            throws NamingException
+                            throws Exception
                     {
                         if ( controls.getTimeLimit() > 0 )
                         {
@@ -558,8 +557,8 @@
     }
 
 
-    public NamingEnumeration<ServerSearchResult> search( SearchOperationContext opContext, Collection<String> bypass )
-            throws NamingException
+    public Cursor<ServerEntry> search( SearchOperationContext opContext, Collection<String> bypass )
+            throws Exception
     {
         ensureStarted();
         opContext.push( new Invocation( this, caller, "search", bypass ) );
@@ -575,7 +574,7 @@
     }
 
 
-    public ServerEntry lookup( LookupOperationContext opContext ) throws NamingException
+    public ServerEntry lookup( LookupOperationContext opContext ) throws Exception
     {
         if ( opContext.getDn().size() == 0 )
         {
@@ -612,7 +611,7 @@
     }
 
 
-    public ServerEntry lookup( LookupOperationContext opContext, Collection<String> bypass ) throws NamingException
+    public ServerEntry lookup( LookupOperationContext opContext, Collection<String> bypass ) throws Exception
     {
         ensureStarted();
         opContext.push( new Invocation( this, caller, "lookup", bypass ) );
@@ -627,13 +626,13 @@
         }
     }
 
-    public boolean hasEntry( EntryOperationContext opContext ) throws NamingException
+    public boolean hasEntry( EntryOperationContext opContext ) throws Exception
     {
         return hasEntry( opContext, null );
     }
 
 
-    public boolean hasEntry( EntryOperationContext opContext, Collection<String> bypass ) throws NamingException
+    public boolean hasEntry( EntryOperationContext opContext, Collection<String> bypass ) throws Exception
     {
         ensureStarted();
         opContext.push( new Invocation( this, caller, "hasEntry", bypass ) );
@@ -649,13 +648,13 @@
     }
 
 
-    public void rename( RenameOperationContext opContext ) throws NamingException
+    public void rename( RenameOperationContext opContext ) throws Exception
     {
         rename( opContext, null );
     }
 
 
-    public void rename( RenameOperationContext opContext, Collection<String> bypass ) throws NamingException
+    public void rename( RenameOperationContext opContext, Collection<String> bypass ) throws Exception
     {
         ensureStarted();
         opContext.push( new Invocation( this, caller, "rename", bypass ) );
@@ -671,13 +670,13 @@
     }
 
 
-    public void move( MoveOperationContext opContext ) throws NamingException
+    public void move( MoveOperationContext opContext ) throws Exception
     {
         move( opContext, null );
     }
 
 
-    public void move( MoveOperationContext opContext, Collection<String> bypass ) throws NamingException
+    public void move( MoveOperationContext opContext, Collection<String> bypass ) throws Exception
     {
         ensureStarted();
         opContext.push( new Invocation( this, caller, "move", bypass ) );
@@ -693,14 +692,14 @@
     }
 
 
-    public void moveAndRename( MoveAndRenameOperationContext opContext ) throws NamingException
+    public void moveAndRename( MoveAndRenameOperationContext opContext ) throws Exception
     {
         moveAndRename( opContext, null );
     }
 
 
     public void moveAndRename( MoveAndRenameOperationContext opContext, Collection<String> bypass )
-            throws NamingException
+            throws Exception
     {
         ensureStarted();
         opContext.push( new Invocation( this, caller, "moveAndRename", bypass ) );
@@ -720,10 +719,10 @@
      *
      * @param opContext The operation context
      * @param bypass bypass instructions to skip interceptors
-     * @throws NamingException if bind fails
+     * @throws Exception if bind fails
      */
     public void bind( BindOperationContext opContext, Collection<String> bypass )
-            throws NamingException
+            throws Exception
     {
         ensureStarted();
         opContext.push( new Invocation( this, caller, "bind", bypass ) );
@@ -739,7 +738,7 @@
     }
 
 
-    public void unbind( UnbindOperationContext opContext, Collection<String> bypass ) throws NamingException
+    public void unbind( UnbindOperationContext opContext, Collection<String> bypass ) throws Exception
     {
         ensureStarted();
         opContext.push( new Invocation( this, caller, "unbind", bypass ) );
@@ -755,19 +754,19 @@
     }
 
 
-    public void bind( BindOperationContext opContext ) throws NamingException
+    public void bind( BindOperationContext opContext ) throws Exception
     {
         bind( opContext, null );
     }
 
 
-    public void unbind( UnbindOperationContext opContext ) throws NamingException
+    public void unbind( UnbindOperationContext opContext ) throws Exception
     {
         unbind( opContext, null );
     }
 
 
-    public ServerEntry getRootDSE( GetRootDSEOperationContext opContext ) throws NamingException
+    public ServerEntry getRootDSE( GetRootDSEOperationContext opContext ) throws Exception
     {
         if ( opContext.getDn().size() == 0 )
         {
@@ -787,7 +786,7 @@
 
 
     public ServerEntry getRootDSE( GetRootDSEOperationContext opContext, Collection<String> bypass )
-            throws NamingException
+            throws Exception
     {
         ensureStarted();
         opContext.push( new Invocation( this, caller, "getRootDSE", GET_ROOT_DSE_BYPASS ) );
@@ -803,14 +802,14 @@
     }
 
 
-    public void addContextPartition( AddContextPartitionOperationContext opContext ) throws NamingException
+    public void addContextPartition( AddContextPartitionOperationContext opContext ) throws Exception
     {
         addContextPartition( opContext, null );
     }
 
 
     public void addContextPartition( AddContextPartitionOperationContext opContext, Collection<String> bypass )
-            throws NamingException
+            throws Exception
     {
         ensureStarted();
         opContext.push( new Invocation( this, caller, "addContextPartition", bypass ) );
@@ -826,14 +825,14 @@
     }
 
 
-    public void removeContextPartition( RemoveContextPartitionOperationContext opContext ) throws NamingException
+    public void removeContextPartition( RemoveContextPartitionOperationContext opContext ) throws Exception
     {
         removeContextPartition( opContext, null );
     }
 
 
     public void removeContextPartition( RemoveContextPartitionOperationContext opContext, Collection<String> bypass )
-            throws NamingException
+            throws Exception
     {
         ensureStarted();
         opContext.push( new Invocation( this, caller, "removeContextPartition", bypass ) );
@@ -858,13 +857,13 @@
     }
 
 
-    public void registerSupportedExtensions( Set<String> extensionOids ) throws NamingException
+    public void registerSupportedExtensions( Set<String> extensionOids ) throws Exception
     {
         service.getPartitionNexus().registerSupportedExtensions( extensionOids );
     }
 
 
-    public void registerSupportedSaslMechanisms( Set<String> supportedSaslMechanisms ) throws NamingException
+    public void registerSupportedSaslMechanisms( Set<String> supportedSaslMechanisms ) throws Exception
     {
         service.getPartitionNexus().registerSupportedSaslMechanisms( supportedSaslMechanisms );
     }
@@ -882,7 +881,7 @@
      */
 
     public void addNamingListener( EventContext ctx, LdapDN name, ExprNode filter, SearchControls searchControls,
-            NamingListener namingListener ) throws NamingException
+            NamingListener namingListener ) throws Exception
     {
         InterceptorChain chain = service.getInterceptorChain();
         EventInterceptor interceptor = ( EventInterceptor ) chain.get( EventInterceptor.class.getName() );
@@ -890,7 +889,7 @@
     }
 
 
-    public void removeNamingListener( EventContext ctx, NamingListener namingListener ) throws NamingException
+    public void removeNamingListener( EventContext ctx, NamingListener namingListener ) throws Exception
     {
         InterceptorChain chain = service.getInterceptorChain();
         if ( chain == null )
@@ -900,4 +899,12 @@
         EventInterceptor interceptor = ( EventInterceptor ) chain.get( EventInterceptor.class.getName() );
         interceptor.removeNamingListener( ctx, namingListener );
     }
+
+
+    public ServerEntry lookup( Long id ) throws Exception
+    {
+        // TODO not implemented until we can lookup partition using the 
+        // partition id component of the 64 bit identifier
+        throw new NotImplementedException();
+    }
 }



Mime
View raw message