directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From erodrig...@apache.org
Subject svn commit: r541123 [10/25] - in /directory/apacheds/branches/apacheds-sasl-branch: ./ benchmarks/ bootstrap-extract/ bootstrap-extract/src/ bootstrap-extract/src/main/ bootstrap-extract/src/main/java/ bootstrap-extract/src/main/java/org/ bootstrap-ext...
Date Thu, 24 May 2007 00:27:07 GMT
Modified: directory/apacheds/branches/apacheds-sasl-branch/core/src/main/java/org/apache/directory/server/core/partition/PartitionNexus.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-sasl-branch/core/src/main/java/org/apache/directory/server/core/partition/PartitionNexus.java?view=diff&rev=541123&r1=541122&r2=541123
==============================================================================
--- directory/apacheds/branches/apacheds-sasl-branch/core/src/main/java/org/apache/directory/server/core/partition/PartitionNexus.java (original)
+++ directory/apacheds/branches/apacheds-sasl-branch/core/src/main/java/org/apache/directory/server/core/partition/PartitionNexus.java Wed May 23 17:26:40 2007
@@ -30,7 +30,8 @@
 import javax.naming.directory.Attributes;
 import javax.naming.ldap.LdapContext;
 
-import org.apache.directory.server.core.configuration.PartitionConfiguration;
+import org.apache.directory.server.core.interceptor.context.OperationContext;
+import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.schema.NoOpNormalizer;
 import org.apache.directory.shared.ldap.schema.OidNormalizer;
@@ -68,16 +69,6 @@
     /** the base dn under which all groups reside */
     public final static String GROUPS_BASE_NAME = "ou=groups,ou=system";
 
-    /** UID attribute name and OID */
-    private static final String UID_ATTRIBUTE = "uid";
-    private static final String UID_ATTRIBUTE_ALIAS = "userid";
-    private static final String UID_ATTRIBUTE_OID = "0.9.2342.19200300.100.1.1";
-    
-    /** OU attribute names and OID **/
-    private static final String OU_ATTRIBUTE = "ou";
-    private static final String OU_ATTRIBUTE_ALIAS = "organizationalUnitName";
-    private static final String OU_ATTRIBUTE_OID = "2.5.4.11";
-
     /**
      * System partition suffix constant.  Should be kept down to a single Dn name 
      * component or the default constructor will have to parse it instead of 
@@ -109,13 +100,13 @@
         {
         	Map<String, OidNormalizer> oidsMap = new HashMap<String, OidNormalizer>();
         	
-        	oidsMap.put( UID_ATTRIBUTE, new OidNormalizer( UID_ATTRIBUTE_OID, new NoOpNormalizer() ) );
-        	oidsMap.put( UID_ATTRIBUTE_ALIAS, new OidNormalizer( UID_ATTRIBUTE_OID, new NoOpNormalizer() ) );
-        	oidsMap.put( UID_ATTRIBUTE_OID, new OidNormalizer( UID_ATTRIBUTE_OID, new NoOpNormalizer() ) );
+        	oidsMap.put( SchemaConstants.UID_AT, new OidNormalizer( SchemaConstants.UID_AT_OID, new NoOpNormalizer() ) );
+        	oidsMap.put( SchemaConstants.USER_ID_AT, new OidNormalizer( SchemaConstants.UID_AT_OID, new NoOpNormalizer() ) );
+        	oidsMap.put( SchemaConstants.UID_AT_OID, new OidNormalizer( SchemaConstants.UID_AT_OID, new NoOpNormalizer() ) );
         	
-        	oidsMap.put( OU_ATTRIBUTE, new OidNormalizer( OU_ATTRIBUTE_OID, new NoOpNormalizer()  ) );
-        	oidsMap.put( OU_ATTRIBUTE_ALIAS, new OidNormalizer( OU_ATTRIBUTE_OID, new NoOpNormalizer()  ) );
-        	oidsMap.put( OU_ATTRIBUTE_OID, new OidNormalizer( OU_ATTRIBUTE_OID, new NoOpNormalizer()  ) );
+        	oidsMap.put( SchemaConstants.OU_AT, new OidNormalizer( SchemaConstants.OU_AT_OID, new NoOpNormalizer()  ) );
+        	oidsMap.put( SchemaConstants.ORGANIZATIONAL_UNIT_NAME_AT, new OidNormalizer( SchemaConstants.OU_AT_OID, new NoOpNormalizer()  ) );
+        	oidsMap.put( SchemaConstants.OU_AT_OID, new OidNormalizer( SchemaConstants.OU_AT_OID, new NoOpNormalizer()  ) );
 
             adminDn.normalize( oidsMap );
         }
@@ -190,26 +181,24 @@
      *
      * @return the attributes of the RootDSE
      */
-    public abstract Attributes getRootDSE() throws NamingException;
+    public abstract Attributes getRootDSE( OperationContext opContext ) throws NamingException;
 
 
     /**
      * Performs a comparison check to see if an attribute of an entry has
      * a specified value.
      *
-     * @param name the normalized name of the entry
-     * @param oid the attribute being compared
-     * @param value the value the attribute is compared to
+     * @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
      */
-    public abstract boolean compare( LdapDN name, String oid, Object value ) throws NamingException;
+    public abstract boolean compare( OperationContext opContext ) throws NamingException;
 
 
-    public abstract void addContextPartition( PartitionConfiguration config ) throws NamingException;
+    public abstract void addContextPartition( OperationContext opContext ) throws NamingException;
 
 
-    public abstract void removeContextPartition( LdapDN suffix ) throws NamingException;
+    public abstract void removeContextPartition( OperationContext opContext ) throws NamingException;
 
 
     public abstract Partition getSystemPartition();
@@ -231,13 +220,14 @@
     /**
      * Gets the most significant Dn that exists within the server for any Dn.
      *
-     * @param name the normalized distinguished name to use for matching.
+     * @param getMatchedNameContext the context containing the  distinguished name 
+     * to use for matching.
      * @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
      */
-    public abstract LdapDN getMatchedName ( LdapDN name ) throws NamingException;
+    public abstract LdapDN getMatchedName ( OperationContext opContext ) throws NamingException;
 
 
     /**
@@ -245,12 +235,13 @@
      * the supplied distinguished name parameter.  If the DN argument does not
      * fall under a partition suffix then the empty string Dn is returned.
      *
-     * @param name the normalized distinguished name to use for finding a suffix.
+     * @param getSuffixContext the Context containing normalized distinguished 
+     * 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
      */
-    public abstract LdapDN getSuffix ( LdapDN name ) throws NamingException;
+    public abstract LdapDN getSuffix ( OperationContext opContext ) throws NamingException;
 
 
     /**
@@ -260,7 +251,7 @@
      * @return Iteration over ContextPartition suffix names as Names.
      * @throws NamingException if there are any problems
      */
-    public abstract Iterator listSuffixes () throws NamingException;
+    public abstract Iterator listSuffixes( OperationContext opContext ) throws NamingException;
 
 
     /**

Modified: directory/apacheds/branches/apacheds-sasl-branch/core/src/main/java/org/apache/directory/server/core/partition/PartitionNexusProxy.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-sasl-branch/core/src/main/java/org/apache/directory/server/core/partition/PartitionNexusProxy.java?view=diff&rev=541123&r1=541122&r2=541123
==============================================================================
--- directory/apacheds/branches/apacheds-sasl-branch/core/src/main/java/org/apache/directory/server/core/partition/PartitionNexusProxy.java (original)
+++ directory/apacheds/branches/apacheds-sasl-branch/core/src/main/java/org/apache/directory/server/core/partition/PartitionNexusProxy.java Wed May 23 17:26:40 2007
@@ -25,7 +25,6 @@
 import java.util.HashSet;
 import java.util.Iterator;
 import java.util.List;
-import java.util.Map;
 import java.util.Set;
 
 import javax.naming.Context;
@@ -35,7 +34,6 @@
 import javax.naming.ServiceUnavailableException;
 import javax.naming.directory.Attributes;
 import javax.naming.directory.SearchControls;
-import javax.naming.directory.DirContext;
 import javax.naming.directory.SearchResult;
 import javax.naming.event.EventContext;
 import javax.naming.event.NamingListener;
@@ -43,17 +41,29 @@
 
 import org.apache.directory.server.core.DirectoryService;
 import org.apache.directory.server.core.DirectoryServiceConfiguration;
+import org.apache.directory.server.core.authn.AuthenticationService;
+import org.apache.directory.server.core.authz.AuthorizationService;
+import org.apache.directory.server.core.authz.DefaultAuthorizationService;
 import org.apache.directory.server.core.configuration.PartitionConfiguration;
 import org.apache.directory.server.core.enumeration.SearchResultFilter;
 import org.apache.directory.server.core.enumeration.SearchResultFilteringEnumeration;
 import org.apache.directory.server.core.event.EventService;
 import org.apache.directory.server.core.interceptor.InterceptorChain;
+import org.apache.directory.server.core.interceptor.context.GetRootDSEOperationContext;
+import org.apache.directory.server.core.interceptor.context.LookupOperationContext;
+import org.apache.directory.server.core.interceptor.context.OperationContext;
+import org.apache.directory.server.core.interceptor.context.SearchOperationContext;
 import org.apache.directory.server.core.invocation.Invocation;
 import org.apache.directory.server.core.invocation.InvocationStack;
+import org.apache.directory.server.core.normalization.NormalizationService;
+import org.apache.directory.server.core.operational.OperationalAttributeService;
+import org.apache.directory.server.core.referral.ReferralService;
+import org.apache.directory.server.core.schema.SchemaService;
+import org.apache.directory.server.core.subtree.SubentryService;
+import org.apache.directory.server.core.trigger.TriggerService;
 import org.apache.directory.shared.ldap.exception.LdapSizeLimitExceededException;
 import org.apache.directory.shared.ldap.exception.LdapTimeLimitExceededException;
 import org.apache.directory.shared.ldap.filter.ExprNode;
-import org.apache.directory.shared.ldap.message.ModificationItemImpl;
 import org.apache.directory.shared.ldap.name.LdapDN;
 
 
@@ -84,15 +94,18 @@
     /** Bypass String to use when ALL interceptors should be skipped */
     public static final Collection BYPASS_ALL_COLLECTION = Collections.singleton( BYPASS_ALL );
     
-    /** Integer const for DirContext.ADD_ATTRIBUTE */
-    private static final Integer ADD_MODOP = new Integer( DirContext.ADD_ATTRIBUTE );
+    /** A static object to store the rootDSE entry with all the attributes */
+    private static Attributes ROOT_DSE_ALL;
+
+    /** A static object to store the rootDSE entry without operationnal attributes */
+    private static Attributes ROOT_DSE_NO_OPERATIONNAL;
+
+    /** A mutex to protect the rootDSE construction */
+    private static final Object ROOT_DSE_ALL_MUTEX = new Object();
     
-    /** Integer const for DirContext.REMOVE_ATTRIBUTE */
-    private static final Integer REMOVE_MODOP = new Integer( DirContext.REMOVE_ATTRIBUTE );
+    /** A mutex to protect the rootDSE construction */
+    private static final Object ROOT_DSE_NOOP_MUTEX = new Object();
     
-    /** Integer const for DirContext.REPLACE_ATTRIBUTE */
-    private static final Integer REPLACE_MODOP = new Integer( DirContext.REPLACE_ATTRIBUTE );
-
     private final Context caller;
     private final DirectoryService service;
     private final DirectoryServiceConfiguration configuration;
@@ -100,38 +113,38 @@
     static
     {
         Collection<String> c = new HashSet<String>();
-        c.add( "normalizationService" );
-        c.add( "authenticationService" );
-        c.add( "authorizationService" );
-        c.add( "defaultAuthorizationService" );
-        c.add( "schemaService" );
-        c.add( "subentryService" );
-        c.add( "operationalAttributeService" );
-        c.add( "referralService" );
-        c.add( "eventService" );
+        c.add( NormalizationService.NAME );
+        c.add( AuthenticationService.NAME );
+        c.add( AuthorizationService.NAME );
+        c.add( DefaultAuthorizationService.NAME );
+        c.add( SchemaService.NAME );
+        c.add( SubentryService.NAME );
+        c.add( OperationalAttributeService.NAME );
+        c.add( ReferralService.NAME );
+        c.add( EventService.NAME );
         LOOKUP_BYPASS = Collections.unmodifiableCollection( c );
 
         c = new HashSet<String>();
-        c.add( "authenticationService" );
-        c.add( "authorizationService" );
-        c.add( "defaultAuthorizationService" );
-        c.add( "schemaService" );
-        c.add( "subentryService" );
-        c.add( "operationalAttributeService" );
-        c.add( "referralService" );
-        c.add( "eventService" );
+        c.add( AuthenticationService.NAME );
+        c.add( AuthorizationService.NAME );
+        c.add( DefaultAuthorizationService.NAME );
+        c.add( SchemaService.NAME );
+        c.add( SubentryService.NAME );
+        c.add( OperationalAttributeService.NAME );
+        c.add( ReferralService.NAME );
+        c.add( EventService.NAME );
         GETMATCHEDDN_BYPASS = Collections.unmodifiableCollection( c );
 
     	c = new HashSet<String>();
-    	c.add( "normalizationService" );
-    	c.add( "authenticationService" );
-    	c.add( "authorizationService" );
-    	c.add( "defaultAuthorizationService" );
-    	c.add( "schemaService" );
-    	c.add( "subentryService" );
-    	c.add( "referralService" );
-    	c.add( "eventService" );
-    	c.add( "triggerService" );
+    	c.add( NormalizationService.NAME );
+    	c.add( AuthenticationService.NAME );
+    	c.add( AuthorizationService.NAME );
+    	c.add( DefaultAuthorizationService.NAME );
+    	c.add( SchemaService.NAME );
+    	c.add( SubentryService.NAME );
+    	c.add( ReferralService.NAME );
+    	c.add( EventService.NAME );
+    	c.add( TriggerService.NAME );
     	LOOKUP_EXCLUDING_OPR_ATTRS_BYPASS = Collections.unmodifiableCollection( c );
     }
 
@@ -142,7 +155,7 @@
      * @param caller a JNDI {@link Context} object that will call this proxy
      * @param service a JNDI service
      */
-    public PartitionNexusProxy(Context caller, DirectoryService service)
+    public PartitionNexusProxy(Context caller, DirectoryService service) throws NamingException
     {
         this.caller = caller;
         this.service = service;
@@ -156,7 +169,7 @@
     }
 
 
-    public void init( DirectoryServiceConfiguration factoryCfg, PartitionConfiguration cfg )
+    public void init( DirectoryServiceConfiguration factoryCfg, PartitionConfiguration cfg ) throws NamingException
     {
     }
 
@@ -207,21 +220,22 @@
     }
 
 
-    public LdapDN getMatchedName ( LdapDN dn ) throws NamingException
+    public LdapDN getMatchedName ( OperationContext opContext ) throws NamingException
     {
-        return getMatchedName( dn, null );
+        return getMatchedName( opContext, null );
     }
 
 
-    public LdapDN getMatchedName( LdapDN dn, Collection bypass ) throws NamingException
+    public LdapDN getMatchedName( OperationContext opContext, Collection bypass ) throws NamingException
     {
         ensureStarted();
         InvocationStack stack = InvocationStack.getInstance();
-        Object[] args = new Object[] { dn };
-        stack.push( new Invocation( this, caller, "getMatchedDn", args, bypass ) );
+        Object[] args = new Object[] { opContext };
+        stack.push( new Invocation( this, caller, "getMatchedName", args, bypass ) );
+        
         try
         {
-            return this.configuration.getInterceptorChain().getMatchedName( dn );
+            return this.configuration.getInterceptorChain().getMatchedName( opContext );
         }
         finally
         {
@@ -230,21 +244,21 @@
     }
 
 
-    public LdapDN getSuffix ( LdapDN dn ) throws NamingException
+    public LdapDN getSuffix ( OperationContext opContext ) throws NamingException
     {
-        return getSuffix( dn, null );
+        return getSuffix( opContext, null );
     }
 
 
-    public LdapDN getSuffix( LdapDN dn, Collection bypass ) throws NamingException
+    public LdapDN getSuffix( OperationContext opContext, Collection bypass ) throws NamingException
     {
         ensureStarted();
         InvocationStack stack = InvocationStack.getInstance();
-        Object[] args = new Object[] { dn };
+        Object[] args = new Object[] { opContext };
         stack.push( new Invocation( this, caller, "getSuffix", args, bypass ) );
         try
         {
-            return this.configuration.getInterceptorChain().getSuffix( dn );
+            return this.configuration.getInterceptorChain().getSuffix( opContext );
         }
         finally
         {
@@ -253,13 +267,13 @@
     }
 
 
-    public Iterator listSuffixes () throws NamingException
+    public Iterator listSuffixes( OperationContext opContext ) throws NamingException
     {
-        return listSuffixes( null );
+        return listSuffixes( opContext );
     }
 
 
-    public Iterator listSuffixes( Collection bypass ) throws NamingException
+    public Iterator listSuffixes( OperationContext opContext, Collection bypass ) throws NamingException
     {
         ensureStarted();
         InvocationStack stack = InvocationStack.getInstance();
@@ -267,7 +281,7 @@
         stack.push( new Invocation( this, caller, "listSuffixes", args, bypass ) );
         try
         {
-            return this.configuration.getInterceptorChain().listSuffixes();
+            return this.configuration.getInterceptorChain().listSuffixes( opContext );
         }
         finally
         {
@@ -276,21 +290,21 @@
     }
 
 
-    public boolean compare( LdapDN name, String oid, Object value ) throws NamingException
+    public boolean compare( OperationContext opContext ) throws NamingException
     {
-        return compare( name, oid, value, null );
+        return compare( opContext, null );
     }
 
 
-    public boolean compare( LdapDN name, String oid, Object value, Collection bypass ) throws NamingException
+    public boolean compare( OperationContext opContext, Collection bypass ) throws NamingException
     {
         ensureStarted();
         InvocationStack stack = InvocationStack.getInstance();
         stack.push( new Invocation( this, caller, "compare", new Object[]
-            { name, oid, value }, bypass ) );
+            { opContext }, bypass ) );
         try
         {
-            return this.configuration.getInterceptorChain().compare( name, oid, value );
+            return this.configuration.getInterceptorChain().compare( opContext );
         }
         finally
         {
@@ -299,21 +313,21 @@
     }
 
 
-    public void delete( LdapDN name ) throws NamingException
+    public void delete( OperationContext opContext ) throws NamingException
     {
-        delete( name, null );
+        delete( opContext, null );
     }
 
 
-    public void delete( LdapDN name, Collection bypass ) throws NamingException
+    public void delete( OperationContext opContext, Collection bypass ) throws NamingException
     {
         ensureStarted();
         InvocationStack stack = InvocationStack.getInstance();
         stack.push( new Invocation( this, caller, "delete", new Object[]
-            { name }, bypass ) );
+            { opContext }, bypass ) );
         try
         {
-            this.configuration.getInterceptorChain().delete( name );
+            this.configuration.getInterceptorChain().delete( opContext );
         }
         finally
         {
@@ -322,21 +336,21 @@
     }
 
 
-    public void add( LdapDN normName, Attributes entry ) throws NamingException
+    public void add( OperationContext opContext ) throws NamingException
     {
-        add( normName, entry, null );
+        add( opContext, null );
     }
 
 
-    public void add( LdapDN normName, Attributes entry, Collection bypass ) throws NamingException
+    public void add( OperationContext opContext, Collection bypass ) throws NamingException
     {
         ensureStarted();
         InvocationStack stack = InvocationStack.getInstance();
         stack.push( new Invocation( this, caller, "add", new Object[]
-            { normName, entry }, bypass ) );
+            { opContext }, bypass ) );
         try
         {
-            this.configuration.getInterceptorChain().add( normName, entry );
+            this.configuration.getInterceptorChain().add( opContext );
         }
         finally
         {
@@ -345,61 +359,22 @@
     }
 
 
-    public void modify( LdapDN name, int modOp, Attributes mods ) throws NamingException
+    public void modify( OperationContext opContext ) throws NamingException
     {
-        modify( name, modOp, mods, null );
+        modify( opContext, null );
     }
 
 
-    public void modify( LdapDN name, int modOp, Attributes mods, Collection bypass ) throws NamingException
+    public void modify( OperationContext opContext, Collection bypass ) throws NamingException
     {
         ensureStarted();
         InvocationStack stack = InvocationStack.getInstance();
-        Integer modOpObj;
-
-        switch ( modOp )
-        {
-            case ( DirContext.ADD_ATTRIBUTE  ):
-                modOpObj = ADD_MODOP;
-                break;
-            case ( DirContext.REMOVE_ATTRIBUTE  ):
-                modOpObj = REMOVE_MODOP;
-                break;
-            case ( DirContext.REPLACE_ATTRIBUTE  ):
-                modOpObj = REPLACE_MODOP;
-                break;
-            default:
-                throw new IllegalArgumentException( "bad modification operation value: " + modOp );
-        }
-
         stack.push( new Invocation( this, caller, "modify", new Object[]
-            { name, modOpObj, mods }, bypass ) );
-        try
-        {
-            this.configuration.getInterceptorChain().modify( name, modOp, mods );
-        }
-        finally
-        {
-            stack.pop();
-        }
-    }
-
-
-    public void modify( LdapDN name, ModificationItemImpl[] mods ) throws NamingException
-    {
-        modify( name, mods, null );
-    }
-
-
-    public void modify( LdapDN name, ModificationItemImpl[] mods, Collection bypass ) throws NamingException
-    {
-        ensureStarted();
-        InvocationStack stack = InvocationStack.getInstance();
-        stack.push( new Invocation( this, caller, "modify", new Object[]
-            { name, mods }, bypass ) );
+            { opContext }, bypass ) );
+        
         try
         {
-            this.configuration.getInterceptorChain().modify( name, mods );
+            this.configuration.getInterceptorChain().modify( opContext );
         }
         finally
         {
@@ -408,21 +383,21 @@
     }
 
 
-    public NamingEnumeration list( LdapDN base ) throws NamingException
+    public NamingEnumeration list( OperationContext opContext ) throws NamingException
     {
-        return list( base, null );
+        return list( opContext, null );
     }
 
 
-    public NamingEnumeration list( LdapDN base, Collection bypass ) throws NamingException
+    public NamingEnumeration list( OperationContext opContext, Collection bypass ) throws NamingException
     {
         ensureStarted();
         InvocationStack stack = InvocationStack.getInstance();
         stack.push( new Invocation( this, caller, "list", new Object[]
-            { base }, bypass ) );
+            { opContext }, bypass ) );
         try
         {
-            return this.configuration.getInterceptorChain().list( base );
+            return this.configuration.getInterceptorChain().list( opContext );
         }
         finally
         {
@@ -431,14 +406,16 @@
     }
 
 
-    public NamingEnumeration search( LdapDN base, Map env, ExprNode filter, SearchControls searchCtls )
+    public NamingEnumeration<SearchResult> search( OperationContext opContext )
         throws NamingException
     {
-        NamingEnumeration ne = search( base, env, filter, searchCtls, null );
+        NamingEnumeration<SearchResult> ne = search( opContext, null );
 
         if ( ne instanceof SearchResultFilteringEnumeration )
         {
             SearchResultFilteringEnumeration results = ( SearchResultFilteringEnumeration ) ne;
+            SearchControls searchCtls = ((SearchOperationContext)opContext).getSearchControls();
+            
             if ( searchCtls.getTimeLimit() + searchCtls.getCountLimit() > 0 )
             {
                 // this will be he last filter added so other filters before it must 
@@ -476,20 +453,21 @@
                 } );
             }
         }
+        
         return ne;
     }
 
 
-    public NamingEnumeration search( LdapDN base, Map env, ExprNode filter, SearchControls searchCtls, Collection bypass )
+    public NamingEnumeration<SearchResult> search( OperationContext opContext, Collection bypass )
         throws NamingException
     {
         ensureStarted();
         InvocationStack stack = InvocationStack.getInstance();
         stack.push( new Invocation( this, caller, "search", new Object[]
-            { base, env, filter, searchCtls }, bypass ) );
+            { opContext }, bypass ) );
         try
         {
-            return this.configuration.getInterceptorChain().search( base, env, filter, searchCtls );
+            return this.configuration.getInterceptorChain().search( opContext );
         }
         finally
         {
@@ -498,21 +476,52 @@
     }
 
 
-    public Attributes lookup( LdapDN name ) throws NamingException
+    public Attributes lookup( OperationContext opContext ) throws NamingException
     {
-        return lookup( name, ( Collection ) null );
+    	if ( opContext.getDn().size() == 0 )
+    	{
+    		List<String> attrs = ( (LookupOperationContext)opContext).getAttrsId();
+    		
+    		if ( ( attrs == null ) || ( attrs.size() == 0 ) )
+    		{
+    			synchronized( ROOT_DSE_NOOP_MUTEX )
+    			{
+    				if ( ROOT_DSE_NO_OPERATIONNAL == null )
+    				{
+    					ROOT_DSE_NO_OPERATIONNAL = lookup( opContext, ( Collection ) null );
+    				}
+    			}
+    			
+        		return ROOT_DSE_NO_OPERATIONNAL;
+    		}
+    		else if ( ( attrs.size() == 1 ) && ( attrs.contains( "+" ) ) )
+    		{
+    			synchronized( ROOT_DSE_ALL_MUTEX )
+    			{
+    				if ( ROOT_DSE_ALL == null )
+    				{
+    					ROOT_DSE_ALL = lookup( opContext, ( Collection ) null );
+    				}
+    			}
+    			
+    			return ROOT_DSE_ALL;
+    		}
+    			
+    	}
+    	
+        return lookup( opContext, ( Collection ) null );
     }
 
 
-    public Attributes lookup( LdapDN name, Collection bypass ) throws NamingException
+    public Attributes lookup( OperationContext opContext, Collection bypass ) throws NamingException
     {
         ensureStarted();
         InvocationStack stack = InvocationStack.getInstance();
         stack.push( new Invocation( this, caller, "lookup", new Object[]
-            { name }, bypass ) );
+            { opContext }, bypass ) );
         try
         {
-            return this.configuration.getInterceptorChain().lookup( name );
+            return this.configuration.getInterceptorChain().lookup( opContext );
         }
         finally
         {
@@ -520,68 +529,21 @@
         }
     }
 
-
-    public Attributes lookup( LdapDN dn, String[] attrIds ) throws NamingException
+    public boolean hasEntry( OperationContext opContext ) throws NamingException
     {
-        return lookup( dn, attrIds, null );
+        return hasEntry( opContext, null );
     }
 
 
-    public Attributes lookup( LdapDN dn, String[] attrIds, Collection bypass ) throws NamingException
-    {
-        ensureStarted();
-        InvocationStack stack = InvocationStack.getInstance();
-        stack.push( new Invocation( this, caller, "lookup", new Object[]
-            { dn, attrIds }, bypass ) );
-        try
-        {
-            return this.configuration.getInterceptorChain().lookup( dn, attrIds );
-        }
-        finally
-        {
-            stack.pop();
-        }
-    }
-
-
-    public boolean hasEntry( LdapDN name ) throws NamingException
-    {
-        return hasEntry( name, null );
-    }
-
-
-    public boolean hasEntry( LdapDN name, Collection bypass ) throws NamingException
+    public boolean hasEntry( OperationContext opContext, Collection bypass ) throws NamingException
     {
         ensureStarted();
         InvocationStack stack = InvocationStack.getInstance();
         stack.push( new Invocation( this, caller, "hasEntry", new Object[]
-            { name }, bypass ) );
-        try
-        {
-            return this.configuration.getInterceptorChain().hasEntry( name );
-        }
-        finally
-        {
-            stack.pop();
-        }
-    }
-
-
-    public boolean isSuffix( LdapDN name ) throws NamingException
-    {
-        return isSuffix( name, null );
-    }
-
-
-    public boolean isSuffix( LdapDN name, Collection bypass ) throws NamingException
-    {
-        ensureStarted();
-        InvocationStack stack = InvocationStack.getInstance();
-        stack.push( new Invocation( this, caller, "isSuffix", new Object[]
-            { name }, bypass ) );
+            { opContext }, bypass ) );
         try
         {
-            return this.configuration.getInterceptorChain().isSuffix( name );
+            return this.configuration.getInterceptorChain().hasEntry( opContext );
         }
         finally
         {
@@ -590,22 +552,22 @@
     }
 
 
-    public void modifyRn( LdapDN name, String newRn, boolean deleteOldRn ) throws NamingException
+    public void rename( OperationContext opContext ) throws NamingException
     {
-        modifyRn( name, newRn, deleteOldRn, null );
+        rename( opContext, null );
     }
 
 
-    public void modifyRn( LdapDN name, String newRn, boolean deleteOldRn, Collection bypass ) throws NamingException
+    public void rename( OperationContext opContext, Collection bypass ) throws NamingException
     {
         ensureStarted();
         InvocationStack stack = InvocationStack.getInstance();
         Object[] args = new Object[]
-            { name, newRn, deleteOldRn ? Boolean.TRUE : Boolean.FALSE };
-        stack.push( new Invocation( this, caller, "modifyRn", args, bypass ) );
+            { opContext };
+        stack.push( new Invocation( this, caller, "rename", args, bypass ) );
         try
         {
-            this.configuration.getInterceptorChain().modifyRn( name, newRn, deleteOldRn );
+            this.configuration.getInterceptorChain().rename( opContext );
         }
         finally
         {
@@ -614,21 +576,21 @@
     }
 
 
-    public void move( LdapDN oriChildName, LdapDN newParentName ) throws NamingException
+    public void move( OperationContext opContext ) throws NamingException
     {
-        move( oriChildName, newParentName, null );
+        move( opContext, null );
     }
 
 
-    public void move( LdapDN oriChildName, LdapDN newParentName, Collection bypass ) throws NamingException
+    public void move( OperationContext opContext, Collection bypass ) throws NamingException
     {
         ensureStarted();
         InvocationStack stack = InvocationStack.getInstance();
         stack.push( new Invocation( this, caller, "move", new Object[]
-            { oriChildName, newParentName }, bypass ) );
+            { opContext }, bypass ) );
         try
         {
-            this.configuration.getInterceptorChain().move( oriChildName, newParentName );
+            this.configuration.getInterceptorChain().move( opContext );
         }
         finally
         {
@@ -637,23 +599,23 @@
     }
 
 
-    public void move( LdapDN oriChildName, LdapDN newParentName, String newRn, boolean deleteOldRn ) throws NamingException
+    public void moveAndRename( OperationContext opContext ) throws NamingException
     {
-        move( oriChildName, newParentName, newRn, deleteOldRn, null );
+        moveAndRename( opContext, null );
     }
 
 
-    public void move( LdapDN oriChildName, LdapDN newParentName, String newRn, boolean deleteOldRn, Collection bypass )
+    public void moveAndRename( OperationContext opContext, Collection bypass )
         throws NamingException
     {
         ensureStarted();
         InvocationStack stack = InvocationStack.getInstance();
         Object[] args = new Object[]
-            { oriChildName, newParentName, newRn, deleteOldRn ? Boolean.TRUE : Boolean.FALSE };
-        stack.push( new Invocation( this, caller, "move", args, bypass ) );
+            { opContext };
+        stack.push( new Invocation( this, caller, "moveAndRename", args, bypass ) );
         try
         {
-            this.configuration.getInterceptorChain().move( oriChildName, newParentName, newRn, deleteOldRn );
+            this.configuration.getInterceptorChain().moveAndRename( opContext );
         }
         finally
         {
@@ -664,26 +626,23 @@
     /**
      * TODO : check if we can find another way to procect ourselves from recursion.
      * 
-     * @param bindDn
-     * @param credentials
-     * @param mechanisms
-     * @param saslAuthId
+     * @param opContext The operation context
      * @param bypass
      * @throws NamingException
      */
-    public void bind( LdapDN bindDn, byte[] credentials, List<String> mechanisms, String saslAuthId, Collection bypass )
+    public void bind( OperationContext opContext, Collection bypass )
         throws NamingException
     {
         ensureStarted();
         InvocationStack stack = InvocationStack.getInstance();
         Object[] args = new Object[]
-            { bindDn, credentials, mechanisms, saslAuthId };
+            { opContext };
         
         stack.push( new Invocation( this, caller, "bind", args, bypass ) );
         
         try
         {
-            this.configuration.getInterceptorChain().bind( bindDn, credentials, mechanisms, saslAuthId );
+            configuration.getInterceptorChain().bind( opContext );
         }
         finally
         {
@@ -691,17 +650,16 @@
         }
     }
 
-
-    public void unbind( LdapDN bindDn, Collection bypass ) throws NamingException
+    public void unbind( OperationContext opContext, Collection bypass ) throws NamingException
     {
         ensureStarted();
         InvocationStack stack = InvocationStack.getInstance();
         Object[] args = new Object[]
-            { bindDn };
+            { opContext };
         stack.push( new Invocation( this, caller, "unbind", args, bypass ) );
         try
         {
-            this.configuration.getInterceptorChain().unbind( bindDn );
+            this.configuration.getInterceptorChain().unbind( opContext );
         }
         finally
         {
@@ -710,32 +668,45 @@
     }
 
 
-    public void bind( LdapDN bindDn, byte[] credentials, List<String> mechanisms, String saslAuthId ) throws NamingException
+    public void bind( OperationContext opContext ) throws NamingException
     {
-        bind( bindDn, credentials, mechanisms, saslAuthId, null );
+        bind( opContext, null );
     }
 
 
-    public void unbind( LdapDN bindDn ) throws NamingException
+    public void unbind( OperationContext opContext ) throws NamingException
     {
-        unbind( bindDn, null );
+        unbind( opContext, null );
     }
 
 
-    public Attributes getRootDSE() throws NamingException
+    public Attributes getRootDSE( OperationContext opContext ) throws NamingException
     {
-        return getRootDSE( null );
+    	if ( opContext.getDn().size() == 0 )
+    	{
+    		synchronized( ROOT_DSE_ALL_MUTEX )
+    		{
+    			if ( ROOT_DSE_ALL == null )
+    			{
+    				ROOT_DSE_ALL = getRootDSE( null, null );
+    			}
+    		}
+    		
+    		return ROOT_DSE_ALL;
+    	}
+    	
+        return getRootDSE( null, null );
     }
 
 
-    public Attributes getRootDSE( Collection bypass ) throws NamingException
+    public Attributes getRootDSE( OperationContext opContext, Collection bypass ) throws NamingException
     {
         ensureStarted();
         InvocationStack stack = InvocationStack.getInstance();
         stack.push( new Invocation( this, caller, "getRootDSE", null, bypass ) );
         try
         {
-            return this.configuration.getInterceptorChain().getRootDSE();
+            return this.configuration.getInterceptorChain().getRootDSE( opContext );
         }
         finally
         {
@@ -744,21 +715,21 @@
     }
 
 
-    public void addContextPartition( PartitionConfiguration config ) throws NamingException
+    public void addContextPartition( OperationContext opContext ) throws NamingException
     {
-        addContextPartition( config, null );
+        addContextPartition( opContext, null );
     }
 
 
-    public void addContextPartition( PartitionConfiguration config, Collection bypass ) throws NamingException
+    public void addContextPartition( OperationContext opContext, Collection bypass ) throws NamingException
     {
         ensureStarted();
         InvocationStack stack = InvocationStack.getInstance();
         stack.push( new Invocation( this, caller, "addContextPartition", new Object[]
-            { config }, bypass ) );
+            { opContext }, bypass ) );
         try
         {
-            this.configuration.getInterceptorChain().addContextPartition( config );
+            this.configuration.getInterceptorChain().addContextPartition( opContext );
         }
         finally
         {
@@ -767,21 +738,21 @@
     }
 
 
-    public void removeContextPartition( LdapDN suffix ) throws NamingException
+    public void removeContextPartition( OperationContext opContext ) throws NamingException
     {
-        removeContextPartition( suffix, null );
+        removeContextPartition( opContext, null );
     }
 
 
-    public void removeContextPartition( LdapDN suffix, Collection bypass ) throws NamingException
+    public void removeContextPartition( OperationContext opContext, Collection bypass ) throws NamingException
     {
         ensureStarted();
         InvocationStack stack = InvocationStack.getInstance();
         stack.push( new Invocation( this, caller, "removeContextPartition", new Object[]
-            { suffix }, bypass ) );
+            { opContext }, bypass ) );
         try
         {
-            this.configuration.getInterceptorChain().removeContextPartition( suffix );
+            this.configuration.getInterceptorChain().removeContextPartition( opContext );
         }
         finally
         {
@@ -820,7 +791,7 @@
                                    NamingListener namingListener ) throws NamingException
     {
         InterceptorChain chain = this.configuration.getInterceptorChain();
-        EventService interceptor = ( EventService ) chain.get( "eventService" );
+        EventService interceptor = ( EventService ) chain.get( EventService.NAME );
         interceptor.addNamingListener( ctx, name, filter, searchControls, namingListener );
     }
 
@@ -832,7 +803,7 @@
         {
             return;
         }
-        EventService interceptor = ( EventService ) chain.get( "eventService" );
+        EventService interceptor = ( EventService ) chain.get( EventService.NAME );
         interceptor.removeNamingListener( ctx, namingListener );
     }
 }

Modified: directory/apacheds/branches/apacheds-sasl-branch/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreePartition.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-sasl-branch/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreePartition.java?view=diff&rev=541123&r1=541122&r2=541123
==============================================================================
--- directory/apacheds/branches/apacheds-sasl-branch/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreePartition.java (original)
+++ directory/apacheds/branches/apacheds-sasl-branch/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreePartition.java Wed May 23 17:26:40 2007
@@ -20,10 +20,8 @@
 package org.apache.directory.server.core.partition.impl.btree;
 
 
-import java.math.BigInteger;
 import java.util.HashSet;
 import java.util.Iterator;
-import java.util.Map;
 import java.util.Set;
 
 import javax.naming.NamingEnumeration;
@@ -31,24 +29,26 @@
 import javax.naming.directory.Attribute;
 import javax.naming.directory.Attributes;
 import javax.naming.directory.SearchControls;
+import javax.naming.directory.SearchResult;
 
 import org.apache.directory.server.core.DirectoryServiceConfiguration;
 import org.apache.directory.server.core.configuration.PartitionConfiguration;
 import org.apache.directory.server.core.enumeration.SearchResultEnumeration;
-import org.apache.directory.server.core.partition.Partition;
+import org.apache.directory.server.core.interceptor.context.AddOperationContext;
+import org.apache.directory.server.core.interceptor.context.LookupOperationContext;
+import org.apache.directory.server.core.interceptor.context.OperationContext;
+import org.apache.directory.server.core.interceptor.context.SearchOperationContext;
 import org.apache.directory.server.core.partition.Oid;
+import org.apache.directory.server.core.partition.Partition;
 import org.apache.directory.server.core.partition.impl.btree.gui.PartitionViewer;
 import org.apache.directory.server.schema.registries.AttributeTypeRegistry;
 import org.apache.directory.server.schema.registries.OidRegistry;
 import org.apache.directory.server.schema.registries.Registries;
 import org.apache.directory.shared.ldap.exception.LdapContextNotEmptyException;
 import org.apache.directory.shared.ldap.exception.LdapNameNotFoundException;
-import org.apache.directory.shared.ldap.filter.ExprNode;
 import org.apache.directory.shared.ldap.message.AttributesImpl;
-import org.apache.directory.shared.ldap.message.ModificationItemImpl;
-import org.apache.directory.shared.ldap.schema.AttributeType;
 import org.apache.directory.shared.ldap.name.LdapDN;
-
+import org.apache.directory.shared.ldap.schema.AttributeType;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -328,7 +328,7 @@
         {
             LdapDN dn = new LdapDN( suffix );
             LdapDN normalizedSuffix = LdapDN.normalize( dn, attributeTypeRegistry.getNormalizerMapping() );
-            add( normalizedSuffix, entry );
+            add( new AddOperationContext( normalizedSuffix, entry ) );
         }
     }
 
@@ -380,9 +380,11 @@
     // ContextPartition Interface Method Implementations
     // ------------------------------------------------------------------------
 
-    public void delete( LdapDN dn ) throws NamingException
+    public void delete( OperationContext opContext ) throws NamingException
     {
-        BigInteger id = getEntryId( dn.toString() );
+    	LdapDN dn = opContext.getDn();
+    	
+        Long id = getEntryId( dn.getNormName() );
 
         // don't continue if id is null
         if ( id == null )
@@ -402,56 +404,56 @@
     }
 
 
-    public abstract void add(LdapDN dn, Attributes entry) throws NamingException;
-
+    public abstract void add( OperationContext opContext ) throws NamingException;
 
-    public abstract void modify( LdapDN dn, int modOp, Attributes mods ) throws NamingException;
 
-
-    public abstract void modify( LdapDN dn, ModificationItemImpl[] mods ) throws NamingException;
+    public abstract void modify( OperationContext opContext ) throws NamingException;
 
 
     private static final String[] ENTRY_DELETED_ATTRS = new String[] { "entrydeleted" };
-    public NamingEnumeration list( LdapDN base ) throws NamingException
+    
+    public NamingEnumeration list( OperationContext opContext ) throws NamingException
     {
         SearchResultEnumeration list;
-        list = new BTreeSearchResultEnumeration( ENTRY_DELETED_ATTRS, list( getEntryId( base.toString() ) ),
+        list = new BTreeSearchResultEnumeration( ENTRY_DELETED_ATTRS, list( getEntryId( opContext.getDn().getNormName() ) ),
             this, attributeTypeRegistry );
         return list;
     }
 
 
-    public NamingEnumeration search( LdapDN base, Map env, ExprNode filter, SearchControls searchCtls )
+    public NamingEnumeration<SearchResult> search( OperationContext opContext )
         throws NamingException
     {
+        SearchControls searchCtls = ((SearchOperationContext)opContext).getSearchControls();
         String[] attrIds = searchCtls.getReturningAttributes();
         NamingEnumeration underlying = null;
 
-        underlying = searchEngine.search( base, env, filter, searchCtls );
+        underlying = searchEngine.search( 
+            opContext.getDn(), 
+            ((SearchOperationContext)opContext).getEnv(), 
+            ((SearchOperationContext)opContext).getFilter(), 
+            searchCtls );
 
         return new BTreeSearchResultEnumeration( attrIds, underlying, this, attributeTypeRegistry );
     }
 
 
-    public Attributes lookup( LdapDN dn ) throws NamingException
+    public Attributes lookup( OperationContext opContext ) throws NamingException
     {
-        return lookup( getEntryId( dn.getNormName() ) );
-    }
-
+        LookupOperationContext ctx = (LookupOperationContext)opContext;
+        
+        Attributes entry = lookup( getEntryId( ctx.getDn().getNormName() ) );
 
-    public Attributes lookup( LdapDN dn, String[] attrIds ) throws NamingException
-    {
-        if ( attrIds == null || attrIds.length == 0 )
+        if ( ( ctx.getAttrsId() == null ) || ( ctx.getAttrsId().size() == 0 ) )
         {
-            return lookup( dn );
+            return entry;
         }
 
-        Attributes entry = lookup( dn );
         Attributes retval = new AttributesImpl();
 
-        for ( int ii = 0; ii < attrIds.length; ii++ )
+        for ( String attrId:ctx.getAttrsId() )
         {
-            Attribute attr = entry.get( attrIds[ii] );
+            Attribute attr = entry.get( attrId );
 
             if ( attr != null )
             {
@@ -463,19 +465,19 @@
     }
 
 
-    public boolean hasEntry( LdapDN dn ) throws NamingException
+    public boolean hasEntry( OperationContext opContext ) throws NamingException
     {
-        return null != getEntryId( dn.toString() );
+        return null != getEntryId( opContext.getDn().getNormName() );
     }
 
 
-    public abstract void modifyRn( LdapDN dn, String newRdn, boolean deleteOldRdn ) throws NamingException;
+    public abstract void rename( OperationContext opContext ) throws NamingException;
 
 
-    public abstract void move( LdapDN oldChildDn, LdapDN newParentDn ) throws NamingException;
+    public abstract void move( OperationContext opContext ) throws NamingException;
 
 
-    public abstract void move( LdapDN oldChildDn, LdapDN newParentDn, String newRdn, boolean deleteOldRdn )
+    public abstract void moveAndRename( OperationContext opContext )
         throws NamingException;
 
 
@@ -488,12 +490,6 @@
     public abstract boolean isInitialized();
 
 
-    public boolean isSuffix( LdapDN dn ) throws NamingException
-    {
-        return getSuffix().equals( dn );
-    }
-
-
     public void inspect() throws Exception
     {
         PartitionViewer viewer = new PartitionViewer( this, searchEngine );
@@ -643,16 +639,16 @@
     public abstract Index getSystemIndex( String attribute ) throws IndexNotFoundException;
 
 
-    public abstract BigInteger getEntryId( String dn ) throws NamingException;
+    public abstract Long getEntryId( String dn ) throws NamingException;
 
 
-    public abstract String getEntryDn( BigInteger id ) throws NamingException;
+    public abstract String getEntryDn( Long id ) throws NamingException;
 
 
-    public abstract BigInteger getParentId( String dn ) throws NamingException;
+    public abstract Long getParentId( String dn ) throws NamingException;
 
 
-    public abstract BigInteger getParentId( BigInteger childId ) throws NamingException;
+    public abstract Long getParentId( Long childId ) throws NamingException;
 
 
     /**
@@ -662,7 +658,7 @@
      * @return the user provided distinguished name
      * @throws NamingException if the updn index cannot be accessed
      */
-    public abstract String getEntryUpdn( BigInteger id ) throws NamingException;
+    public abstract String getEntryUpdn( Long id ) throws NamingException;
 
 
     /**
@@ -675,16 +671,16 @@
     public abstract String getEntryUpdn( String dn ) throws NamingException;
 
 
-    public abstract Attributes lookup( BigInteger id ) throws NamingException;
+    public abstract Attributes lookup( Long id ) throws NamingException;
 
 
-    public abstract void delete( BigInteger id ) throws NamingException;
+    public abstract void delete( Long id ) throws NamingException;
 
 
-    public abstract NamingEnumeration list( BigInteger id ) throws NamingException;
+    public abstract NamingEnumeration list( Long id ) throws NamingException;
 
 
-    public abstract int getChildCount( BigInteger id ) throws NamingException;
+    public abstract int getChildCount( Long id ) throws NamingException;
 
 
     public abstract Attributes getSuffixEntry() throws NamingException;
@@ -702,7 +698,7 @@
     public abstract Iterator getSystemIndices();
 
 
-    public abstract Attributes getIndices( BigInteger id ) throws NamingException;
+    public abstract Attributes getIndices( Long id ) throws NamingException;
 
 
     /**

Modified: directory/apacheds/branches/apacheds-sasl-branch/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreeSearchResult.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-sasl-branch/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreeSearchResult.java?view=diff&rev=541123&r1=541122&r2=541123
==============================================================================
--- directory/apacheds/branches/apacheds-sasl-branch/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreeSearchResult.java (original)
+++ directory/apacheds/branches/apacheds-sasl-branch/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreeSearchResult.java Wed May 23 17:26:40 2007
@@ -20,11 +20,12 @@
 package org.apache.directory.server.core.partition.impl.btree;
 
 
-import java.math.BigInteger;
-
+import javax.naming.InvalidNameException;
 import javax.naming.directory.Attributes;
 import javax.naming.directory.SearchResult;
 
+import org.apache.directory.shared.ldap.message.ServerSearchResult;
+
 
 /**
  * A special search result that includes the unique database primary key or 
@@ -34,12 +35,12 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$
  */
-public class BTreeSearchResult extends SearchResult
+public class BTreeSearchResult extends ServerSearchResult
 {
     private static final long serialVersionUID = 3976739172700860977L;
 
     /** the primary key used for the resultant entry */
-    private final BigInteger id;
+    private final Long id;
 
 
     // ------------------------------------------------------------------------
@@ -54,7 +55,7 @@
      * @param obj the object if any
      * @param attrs the attributes of the entry
      */
-    public BTreeSearchResult(BigInteger id, String name, Object obj, Attributes attrs)
+    public BTreeSearchResult(Long id, String name, Object obj, Attributes attrs) throws InvalidNameException
     {
         super( name, obj, attrs );
         this.id = id;
@@ -70,7 +71,7 @@
      * @param attrs the attributes of the entry
      * @param isRelative whether or not the name is relative to the base
      */
-    public BTreeSearchResult(BigInteger id, String name, Object obj, Attributes attrs, boolean isRelative)
+    public BTreeSearchResult(Long id, String name, Object obj, Attributes attrs, boolean isRelative) throws InvalidNameException
     {
         super( name, obj, attrs, isRelative );
         this.id = id;
@@ -86,7 +87,7 @@
      * @param obj the object if any
      * @param attrs the attributes of the entry
      */
-    public BTreeSearchResult(BigInteger id, String name, String className, Object obj, Attributes attrs)
+    public BTreeSearchResult(Long id, String name, String className, Object obj, Attributes attrs) throws InvalidNameException
     {
         super( name, className, obj, attrs );
         this.id = id;
@@ -103,8 +104,8 @@
      * @param attrs the attributes of the entry
      * @param isRelative whether or not the name is relative to the base
      */
-    public BTreeSearchResult(BigInteger id, String name, String className, Object obj, Attributes attrs,
-        boolean isRelative)
+    public BTreeSearchResult(Long id, String name, String className, Object obj, Attributes attrs,
+        boolean isRelative) throws InvalidNameException
     {
         super( name, className, obj, attrs, isRelative );
         this.id = id;
@@ -116,7 +117,7 @@
      * 
      * @return Returns the id.
      */
-    public BigInteger getId()
+    public Long getId()
     {
         return id;
     }

Modified: directory/apacheds/branches/apacheds-sasl-branch/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreeSearchResultEnumeration.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-sasl-branch/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreeSearchResultEnumeration.java?view=diff&rev=541123&r1=541122&r2=541123
==============================================================================
--- directory/apacheds/branches/apacheds-sasl-branch/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreeSearchResultEnumeration.java (original)
+++ directory/apacheds/branches/apacheds-sasl-branch/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreeSearchResultEnumeration.java Wed May 23 17:26:40 2007
@@ -104,11 +104,11 @@
     {
         IndexRecord rec = ( IndexRecord ) underlying.next();
         Attributes entry;
-        String name = partition.getEntryUpdn( rec.getEntryId() );
+        String name = partition.getEntryUpdn( (Long)rec.getEntryId() );
 
         if ( null == rec.getAttributes() )
         {
-            rec.setAttributes( partition.lookup( rec.getEntryId() ) );
+            rec.setAttributes( partition.lookup( (Long)rec.getEntryId() ) );
         }
 
         if ( attrIds == null )
@@ -234,7 +234,7 @@
             }
         }
 
-        BTreeSearchResult result = new BTreeSearchResult( rec.getEntryId(), name, null, entry );
+        BTreeSearchResult result = new BTreeSearchResult( (Long)rec.getEntryId(), name, null, entry );
         result.setRelative( false );
         return result;
     }

Modified: directory/apacheds/branches/apacheds-sasl-branch/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/DefaultOptimizer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-sasl-branch/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/DefaultOptimizer.java?view=diff&rev=541123&r1=541122&r2=541123
==============================================================================
--- directory/apacheds/branches/apacheds-sasl-branch/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/DefaultOptimizer.java (original)
+++ directory/apacheds/branches/apacheds-sasl-branch/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/DefaultOptimizer.java Wed May 23 17:26:40 2007
@@ -20,7 +20,6 @@
 package org.apache.directory.server.core.partition.impl.btree;
 
 
-import java.math.BigInteger;
 import java.util.List;
 
 import javax.naming.NamingException;
@@ -44,7 +43,7 @@
 public class DefaultOptimizer implements Optimizer
 {
     /** the maximum size for a count Integer.MAX_VALUE as a BigInteger */
-    private static final BigInteger MAX = BigInteger.valueOf( Integer.MAX_VALUE );
+    private static final Long MAX = Long.MAX_VALUE;
     /** the database this optimizer operates on */
     private BTreePartition db;
 
@@ -71,7 +70,7 @@
     public void annotate( ExprNode node ) throws NamingException
     {
         // Start off with the worst case unless scan count says otherwise.
-        BigInteger count = MAX;
+        Long count = MAX;
 
         /* --------------------------------------------------------------------
          *                 H A N D L E   L E A F   N O D E S          
@@ -165,7 +164,7 @@
         }
 
         // Protect against overflow when counting.
-        if ( count.compareTo( BigInteger.ZERO ) < 0 )
+        if ( count.compareTo( 0L ) < 0 )
         {
             count = MAX;
         }
@@ -185,16 +184,16 @@
      * @return the calculated scan count
      * @throws NamingException if there is an error
      */
-    private BigInteger getConjunctionScan( BranchNode node ) throws NamingException
+    private Long getConjunctionScan( BranchNode node ) throws NamingException
     {
-        BigInteger count = MAX;
+        Long count = MAX;
         List<ExprNode> children = node.getChildren();
 
         for ( int ii = 0; ii < children.size(); ii++ )
         {
             ExprNode child = ( ExprNode ) children.get( ii );
             annotate( child );
-            count = ( ( BigInteger ) child.get( "count" ) ).min( count );
+            count = Math.min( ( ( Long ) child.get( "count" ) ), count );
         }
 
         return count;
@@ -215,7 +214,7 @@
      * @return the scan count
      * @throws NamingException if there is an error
      */
-    private BigInteger getNegationScan( BranchNode node ) throws NamingException
+    private Long getNegationScan( BranchNode node ) throws NamingException
     {
         ExprNode onlyChild = ( ExprNode ) node.getChildren().get( 0 );
 
@@ -229,13 +228,13 @@
             if ( db.hasUserIndexOn( leaf.getAttribute() ) )
             {
                 Index idx = db.getUserIndex( leaf.getAttribute() );
-                return BigInteger.valueOf( idx.count() );
+                return Long.valueOf( idx.count() );
             }
             
-            return BigInteger.valueOf( db.count() );
+            return Long.valueOf( db.count() );
         }
 
-        return BigInteger.valueOf( db.count() );
+        return Long.valueOf( db.count() );
     }
 
 
@@ -248,16 +247,16 @@
      * @return the scan count on the OR node
      * @throws NamingException if there is an error
      */
-    private BigInteger getDisjunctionScan( BranchNode node ) throws NamingException
+    private Long getDisjunctionScan( BranchNode node ) throws NamingException
     {
         List<ExprNode> children = node.getChildren();
-        BigInteger total = BigInteger.ZERO;
+        Long total = 0L;
 
         for ( int ii = 0; ii < children.size(); ii++ )
         {
             ExprNode child = ( ExprNode ) children.get( ii );
             annotate( child );
-            total = total.add( ( BigInteger ) child.get( "count" ) );
+            total += ( Long ) child.get( "count" );
         }
         
         // we don't want values bigger than Integer.MAX_VALUE
@@ -278,12 +277,12 @@
      * @return the worst case
      * @throws NamingException if there is an error accessing an index
      */
-    private BigInteger getEqualityScan( SimpleNode node ) throws NamingException
+    private Long getEqualityScan( SimpleNode node ) throws NamingException
     {
         if ( db.hasUserIndexOn( node.getAttribute() ) )
         {
             Index idx = db.getUserIndex( node.getAttribute() );
-            return BigInteger.valueOf( idx.count( node.getValue() ) );
+            return Long.valueOf( idx.count( node.getValue() ) );
         }
 
         // count for non-indexed attribute is unknown so we presume da worst
@@ -300,13 +299,13 @@
      * @return the scan count of all nodes satisfying the AVA
      * @throws NamingException if there is an error accessing an index
      */
-    private BigInteger getGreaterLessScan( SimpleNode node, boolean isGreaterThan ) throws NamingException
+    private Long getGreaterLessScan( SimpleNode node, boolean isGreaterThan ) throws NamingException
     {
         if ( db.hasUserIndexOn( node.getAttribute() ) )
         {
             Index idx = db.getUserIndex( node.getAttribute() );
             int count = idx.count( node.getValue(), isGreaterThan );
-            return BigInteger.valueOf( count );
+            return Long.valueOf( count );
         }
 
         // count for non-indexed attribute is unknown so we presume da worst
@@ -323,13 +322,13 @@
      * @return the worst case full scan count
      * @throws NamingException if there is an error access database indices
      */
-    private BigInteger getFullScan( LeafNode node ) throws NamingException
+    private Long getFullScan( LeafNode node ) throws NamingException
     {
         if ( db.hasUserIndexOn( node.getAttribute() ) )
         {
             Index idx = db.getUserIndex( node.getAttribute() );
             int count = idx.count();
-            return BigInteger.valueOf( count );
+            return Long.valueOf( count );
         }
 
         return MAX;
@@ -344,13 +343,13 @@
      * @return the number of entries matched for the presence of an attribute
      * @throws NamingException if errors result
      */
-    private BigInteger getPresenceScan( PresenceNode node ) throws NamingException
+    private Long getPresenceScan( PresenceNode node ) throws NamingException
     {
         if ( db.hasUserIndexOn( node.getAttribute() ) )
         {
             Index idx = db.getExistanceIndex();
             int count = idx.count( node.getAttribute() );
-            return BigInteger.valueOf( count );
+            return Long.valueOf( count );
         }
 
         return MAX;
@@ -364,17 +363,20 @@
      * @return the scan count for scope
      * @throws NamingException if any errors result
      */
-    private BigInteger getScopeScan( ScopeNode node ) throws NamingException
+    private Long getScopeScan( ScopeNode node ) throws NamingException
     {
         switch ( node.getScope() )
         {
             case ( SearchControls.OBJECT_SCOPE  ):
-                return BigInteger.ONE;
+                return 1L;
+            
             case ( SearchControls.ONELEVEL_SCOPE  ):
-                BigInteger id = db.getEntryId( node.getBaseDn() );
-                return BigInteger.valueOf( db.getChildCount( id ) );
+                Long id = db.getEntryId( node.getBaseDn() );
+                return Long.valueOf( db.getChildCount( id ) );
+                
             case ( SearchControls.SUBTREE_SCOPE  ):
-                return BigInteger.valueOf( db.count() );
+                return Long.valueOf( db.count() );
+            
             default:
                 throw new IllegalArgumentException( "Unrecognized search scope " + "value for filter scope node" );
         }

Modified: directory/apacheds/branches/apacheds-sasl-branch/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/DefaultSearchEngine.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-sasl-branch/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/DefaultSearchEngine.java?view=diff&rev=541123&r1=541122&r2=541123
==============================================================================
--- directory/apacheds/branches/apacheds-sasl-branch/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/DefaultSearchEngine.java (original)
+++ directory/apacheds/branches/apacheds-sasl-branch/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/DefaultSearchEngine.java Wed May 23 17:26:40 2007
@@ -20,7 +20,6 @@
 package org.apache.directory.server.core.partition.impl.btree;
 
 
-import java.math.BigInteger;
 import java.util.Map;
 
 import javax.naming.Name;
@@ -91,7 +90,7 @@
         throws NamingException
     {
         Name effectiveBase = null;
-        BigInteger baseId = db.getEntryId( base.toString() );
+        Long baseId = db.getEntryId( base.toString() );
         String aliasedBase = ( String ) db.getAliasIndex().reverseLookup( baseId );
         DerefAliasesEnum mode = DerefAliasesEnum.getEnum( env );
 
@@ -140,7 +139,7 @@
     /**
      * @see SearchEngine#evaluate(ExprNode, BigInteger)
      */
-    public boolean evaluate( ExprNode ilter, BigInteger id ) throws NamingException
+    public boolean evaluate( ExprNode ilter, Long id ) throws NamingException
     {
         IndexRecord rec = new IndexRecord();
         rec.setEntryId( id );

Modified: directory/apacheds/branches/apacheds-sasl-branch/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/ExpressionEnumerator.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-sasl-branch/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/ExpressionEnumerator.java?view=diff&rev=541123&r1=541122&r2=541123
==============================================================================
--- directory/apacheds/branches/apacheds-sasl-branch/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/ExpressionEnumerator.java (original)
+++ directory/apacheds/branches/apacheds-sasl-branch/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/ExpressionEnumerator.java Wed May 23 17:26:40 2007
@@ -20,7 +20,6 @@
 package org.apache.directory.server.core.partition.impl.btree;
 
 
-import java.math.BigInteger;
 import java.util.List;
 
 import javax.naming.NamingEnumeration;
@@ -171,7 +170,7 @@
         // Recursively create NamingEnumerations for each child expression node
         for ( int ii = 0; ii < childEnumerations.length; ii++ )
         {
-            childEnumerations[ii] = enumerate( ( ExprNode ) children.get( ii ) );
+            childEnumerations[ii] = enumerate( children.get( ii ) );
         }
 
         return new DisjunctionEnumeration( childEnumerations );
@@ -235,8 +234,8 @@
     private NamingEnumeration enumConj( final BranchNode node ) throws NamingException
     {
         int minIndex = 0;
-        int minValue = Integer.MAX_VALUE;
-        int value = Integer.MAX_VALUE;
+        long minValue = Long.MAX_VALUE;
+        long value = Long.MAX_VALUE;
 
         /*
          * We scan the child nodes of a branch node searching for the child
@@ -247,8 +246,8 @@
         final List<ExprNode> children = node.getChildren();
         for ( int ii = 0; ii < children.size(); ii++ )
         {
-            ExprNode child = ( ExprNode ) children.get( ii );
-            value = ( ( BigInteger ) child.get( "count" ) ).intValue();
+            ExprNode child = children.get( ii );
+            value = ( Long ) child.get( "count" );
             minValue = Math.min( minValue, value );
 
             if ( minValue == value )
@@ -258,14 +257,14 @@
         }
 
         // Once found we build the child enumeration & the wrapping enum
-        final ExprNode minChild = ( ExprNode ) children.get( minIndex );
+        final ExprNode minChild = children.get( minIndex );
         IndexAssertion assertion = new IndexAssertion()
         {
             public boolean assertCandidate( IndexRecord rec ) throws NamingException
             {
                 for ( int ii = 0; ii < children.size(); ii++ )
                 {
-                    ExprNode child = ( ExprNode ) children.get( ii );
+                    ExprNode child = children.get( ii );
 
                     // Skip the child (with min scan count) chosen for enum
                     if ( child == minChild )

Modified: directory/apacheds/branches/apacheds-sasl-branch/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/LeafEvaluator.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-sasl-branch/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/LeafEvaluator.java?view=diff&rev=541123&r1=541122&r2=541123
==============================================================================
--- directory/apacheds/branches/apacheds-sasl-branch/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/LeafEvaluator.java (original)
+++ directory/apacheds/branches/apacheds-sasl-branch/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/LeafEvaluator.java Wed May 23 17:26:40 2007
@@ -20,7 +20,6 @@
 package org.apache.directory.server.core.partition.impl.btree;
 
 
-import java.math.BigInteger;
 import java.util.Comparator;
 
 import javax.naming.NamingEnumeration;
@@ -156,7 +155,7 @@
     private boolean evalGreater( SimpleNode node, IndexRecord record, boolean isGreater ) throws NamingException
     {
         String attrId = node.getAttribute();
-        BigInteger id = record.getEntryId();
+        Long id = (Long)record.getEntryId();
 
         if ( db.hasUserIndexOn( attrId ) )
         {
@@ -251,7 +250,7 @@
         // resusitate entry if need be
         if ( null == rec.getAttributes() )
         {
-            rec.setAttributes( db.lookup( rec.getEntryId() ) );
+            rec.setAttributes( db.lookup( (Long)rec.getEntryId() ) );
         }
 
         // get the attribute associated with the node 
@@ -298,7 +297,7 @@
         // resusitate entry if need be
         if ( null == rec.getAttributes() )
         {
-            rec.setAttributes( db.lookup( rec.getEntryId() ) );
+            rec.setAttributes( db.lookup( (Long)rec.getEntryId() ) );
         }
 
         // get the attribute associated with the node 

Modified: directory/apacheds/branches/apacheds-sasl-branch/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/NoOpOptimizer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-sasl-branch/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/NoOpOptimizer.java?view=diff&rev=541123&r1=541122&r2=541123
==============================================================================
--- directory/apacheds/branches/apacheds-sasl-branch/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/NoOpOptimizer.java (original)
+++ directory/apacheds/branches/apacheds-sasl-branch/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/NoOpOptimizer.java Wed May 23 17:26:40 2007
@@ -19,8 +19,6 @@
  */
 package org.apache.directory.server.core.partition.impl.btree;
 
-import java.math.BigInteger;
-
 import javax.naming.NamingException;
 
 import org.apache.directory.shared.ldap.filter.BranchNode;
@@ -37,7 +35,7 @@
 public class NoOpOptimizer implements Optimizer
 {
     /** the maximum size for a count Integer.MAX_VALUE as a BigInteger */
-    private static final BigInteger MAX = BigInteger.valueOf( Integer.MAX_VALUE );
+    private static final Long MAX = Long.MAX_VALUE;
     
     public void annotate( ExprNode node ) throws NamingException
     {

Modified: directory/apacheds/branches/apacheds-sasl-branch/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/ScopeEnumerator.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-sasl-branch/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/ScopeEnumerator.java?view=diff&rev=541123&r1=541122&r2=541123
==============================================================================
--- directory/apacheds/branches/apacheds-sasl-branch/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/ScopeEnumerator.java (original)
+++ directory/apacheds/branches/apacheds-sasl-branch/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/ScopeEnumerator.java Wed May 23 17:26:40 2007
@@ -20,8 +20,6 @@
 package org.apache.directory.server.core.partition.impl.btree;
 
 
-import java.math.BigInteger;
-
 import javax.naming.NamingEnumeration;
 import javax.naming.NamingException;
 import javax.naming.directory.SearchControls;
@@ -64,7 +62,7 @@
     public NamingEnumeration enumerate( ExprNode node ) throws NamingException
     {
         final ScopeNode snode = ( ScopeNode ) node;
-        final BigInteger id = db.getEntryId( snode.getBaseDn() );
+        final Long id = db.getEntryId( snode.getBaseDn() );
 
         switch ( snode.getScope() )
         {
@@ -97,7 +95,7 @@
     private NamingEnumeration enumerateChildren( String dn, boolean deref ) throws NamingException
     {
         Index idx = db.getHierarchyIndex();
-        final BigInteger id = db.getEntryId( dn );
+        final Long id = db.getEntryId( dn );
         final NamingEnumeration children = idx.listIndices( id );
 
         /*
@@ -203,7 +201,7 @@
          */
         public boolean assertCandidate( IndexRecord record ) throws NamingException
         {
-            String dn = db.getEntryDn( record.getEntryId() );
+            String dn = db.getEntryDn( (Long)record.getEntryId() );
             return dn.endsWith( scope.getBaseDn() );
         }
     }

Modified: directory/apacheds/branches/apacheds-sasl-branch/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/ScopeEvaluator.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-sasl-branch/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/ScopeEvaluator.java?view=diff&rev=541123&r1=541122&r2=541123
==============================================================================
--- directory/apacheds/branches/apacheds-sasl-branch/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/ScopeEvaluator.java (original)
+++ directory/apacheds/branches/apacheds-sasl-branch/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/ScopeEvaluator.java Wed May 23 17:26:40 2007
@@ -20,8 +20,6 @@
 package org.apache.directory.server.core.partition.impl.btree;
 
 
-import java.math.BigInteger;
-
 import javax.naming.NamingException;
 import javax.naming.directory.SearchControls;
 
@@ -63,12 +61,12 @@
         switch ( snode.getScope() )
         {
             case ( SearchControls.OBJECT_SCOPE  ):
-                String dn = db.getEntryDn( record.getEntryId() );
+                String dn = db.getEntryDn( (Long)record.getEntryId() );
                 return dn.equals( snode.getBaseDn() );
             case ( SearchControls.ONELEVEL_SCOPE  ):
-                return assertOneLevelScope( snode, record.getEntryId() );
+                return assertOneLevelScope( snode, (Long)record.getEntryId() );
             case ( SearchControls.SUBTREE_SCOPE  ):
-                return assertSubtreeScope( snode, record.getEntryId() );
+                return assertSubtreeScope( snode, (Long)record.getEntryId() );
             default:
                 throw new NamingException( "Unrecognized search scope!" );
         }
@@ -85,7 +83,7 @@
      * alias dereferencing is enabled.
      * @throws NamingException if the index lookups fail.
      */
-    public boolean assertSubtreeScope( final ScopeNode node, final BigInteger id ) throws NamingException
+    public boolean assertSubtreeScope( final ScopeNode node, final Long id ) throws NamingException
     {
         String dn = db.getEntryDn( id );
         DerefAliasesEnum mode = node.getDerefAliases();
@@ -150,7 +148,7 @@
      * alias dereferencing is enabled.
      * @throws NamingException if the index lookups fail.
      */
-    public boolean assertOneLevelScope( final ScopeNode node, final BigInteger id ) throws NamingException
+    public boolean assertOneLevelScope( final ScopeNode node, final Long id ) throws NamingException
     {
         DerefAliasesEnum mode = node.getDerefAliases();
         Object baseId = db.getEntryId( node.getBaseDn() );

Modified: directory/apacheds/branches/apacheds-sasl-branch/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/SearchEngine.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-sasl-branch/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/SearchEngine.java?view=diff&rev=541123&r1=541122&r2=541123
==============================================================================
--- directory/apacheds/branches/apacheds-sasl-branch/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/SearchEngine.java (original)
+++ directory/apacheds/branches/apacheds-sasl-branch/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/SearchEngine.java Wed May 23 17:26:40 2007
@@ -20,7 +20,6 @@
 package org.apache.directory.server.core.partition.impl.btree;
 
 
-import java.math.BigInteger;
 import java.util.Map;
 
 import javax.naming.Name;
@@ -28,6 +27,7 @@
 import javax.naming.NamingException;
 import javax.naming.directory.SearchControls;
 
+import org.apache.directory.shared.ldap.constants.JndiPropertyConstants;
 import org.apache.directory.shared.ldap.filter.ExprNode;
 
 
@@ -44,7 +44,7 @@
      * @todo put this in the right place
      * The alias dereferencing mode key for JNDI providers 
      */
-    String ALIASMODE_KEY = "java.naming.ldap.derefAliases";
+    String ALIASMODE_KEY = JndiPropertyConstants.JNDI_LDAP_DAP_DEREF_ALIASES;
     /** 
      * @todo put this in the right place
      * The alias dereferencing mode value for JNDI providers 
@@ -96,5 +96,5 @@
      * @return true if the filter passes the entry, false otherwise
      * @throws NamingException if something goes wrong while accessing the db
      */
-    boolean evaluate( ExprNode filter, BigInteger id ) throws NamingException;
+    boolean evaluate( ExprNode filter, Long id ) throws NamingException;
 }

Modified: directory/apacheds/branches/apacheds-sasl-branch/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/SubstringEvaluator.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-sasl-branch/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/SubstringEvaluator.java?view=diff&rev=541123&r1=541122&r2=541123
==============================================================================
--- directory/apacheds/branches/apacheds-sasl-branch/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/SubstringEvaluator.java (original)
+++ directory/apacheds/branches/apacheds-sasl-branch/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/SubstringEvaluator.java Wed May 23 17:26:40 2007
@@ -137,7 +137,7 @@
         // resusitate the entry if it has not been and set entry in IndexRecord
         if ( null == record.getAttributes() )
         {
-            Attributes attrs = db.lookup( record.getEntryId() );
+            Attributes attrs = db.lookup( (Long)record.getEntryId() );
             record.setAttributes( attrs );
         }
 

Modified: directory/apacheds/branches/apacheds-sasl-branch/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/AddEntryDialog.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-sasl-branch/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/AddEntryDialog.java?view=diff&rev=541123&r1=541122&r2=541123
==============================================================================
--- directory/apacheds/branches/apacheds-sasl-branch/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/AddEntryDialog.java (original)
+++ directory/apacheds/branches/apacheds-sasl-branch/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/AddEntryDialog.java Wed May 23 17:26:40 2007
@@ -40,6 +40,7 @@
 import javax.swing.JTable;
 import javax.swing.JTextField;
 
+import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.message.AttributesImpl;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -83,7 +84,7 @@
     public AddEntryDialog(Frame parent, boolean modal)
     {
         super( parent, modal );
-        m_childEntry.put( "objectClass", "top" );
+        m_childEntry.put( SchemaConstants.OBJECT_CLASS_AT, SchemaConstants.TOP_OC );
         initGUI();
     }
 

Modified: directory/apacheds/branches/apacheds-sasl-branch/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/AttributesTableModel.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-sasl-branch/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/AttributesTableModel.java?view=diff&rev=541123&r1=541122&r2=541123
==============================================================================
--- directory/apacheds/branches/apacheds-sasl-branch/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/AttributesTableModel.java (original)
+++ directory/apacheds/branches/apacheds-sasl-branch/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/AttributesTableModel.java Wed May 23 17:26:40 2007
@@ -20,7 +20,6 @@
 package org.apache.directory.server.core.partition.impl.btree.gui;
 
 
-import java.math.BigInteger;
 import java.util.ArrayList;
 
 import javax.naming.NamingEnumeration;
@@ -52,7 +51,7 @@
     /** the attributes for the entry */
     private final Attributes entry;
     /** the unique id of the entry  */
-    private final BigInteger id;
+    private final Long id;
     /** the distinguished name of the entry */
     private final String dn;
     /** whether or not the model is mutable */
@@ -67,7 +66,7 @@
      * @param dn the distinguished name of the entry
      * @param isMutable whether or not the model can be changed
      */
-    public AttributesTableModel(Attributes entry, BigInteger id, String dn, boolean isMutable)
+    public AttributesTableModel(Attributes entry, Long id, String dn, boolean isMutable)
     {
         this.dn = dn;
         this.id = id;
@@ -235,7 +234,7 @@
      *
      * @return the unique id for the entry
      */
-    public BigInteger getEntryId()
+    public Long getEntryId()
     {
         return id;
     }

Modified: directory/apacheds/branches/apacheds-sasl-branch/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/EntryNode.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-sasl-branch/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/EntryNode.java?view=diff&rev=541123&r1=541122&r2=541123
==============================================================================
--- directory/apacheds/branches/apacheds-sasl-branch/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/EntryNode.java (original)
+++ directory/apacheds/branches/apacheds-sasl-branch/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/EntryNode.java Wed May 23 17:26:40 2007
@@ -20,7 +20,6 @@
 package org.apache.directory.server.core.partition.impl.btree.gui;
 
 
-import java.math.BigInteger;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.Enumeration;
@@ -51,16 +50,16 @@
     private final EntryNode parent;
     private final Attributes entry;
     private final ArrayList children;
-    private final BigInteger id;
+    private final Long id;
 
 
-    public EntryNode(BigInteger id, EntryNode parent, BTreePartition partition, Attributes entry, HashMap map)
+    public EntryNode(Long id, EntryNode parent, BTreePartition partition, Attributes entry, HashMap map)
     {
         this( id, parent, partition, entry, map, null, null );
     }
 
 
-    public EntryNode(BigInteger id, EntryNode parent, BTreePartition db, Attributes entry, HashMap map,
+    public EntryNode(Long id, EntryNode parent, BTreePartition db, Attributes entry, HashMap map,
         ExprNode exprNode, SearchEngine engine)
     {
         this.partition = db;
@@ -98,12 +97,12 @@
 
                 if ( engine != null && exprNode != null )
                 {
-                    if ( db.getChildCount( rec.getEntryId() ) == 0 )
+                    if ( db.getChildCount( (Long)rec.getEntryId() ) == 0 )
                     {
-                        if ( engine.evaluate( exprNode, rec.getEntryId() ) )
+                        if ( engine.evaluate( exprNode, (Long)rec.getEntryId() ) )
                         {
-                            Attributes newEntry = db.lookup( rec.getEntryId() );
-                            EntryNode child = new EntryNode( rec.getEntryId(), this, db, newEntry, map, exprNode,
+                            Attributes newEntry = db.lookup( (Long)rec.getEntryId() );
+                            EntryNode child = new EntryNode( (Long)rec.getEntryId(), this, db, newEntry, map, exprNode,
                                 engine );
                             children.add( child );
                         }
@@ -114,15 +113,15 @@
                     }
                     else
                     {
-                        Attributes newEntry = db.lookup( rec.getEntryId() );
-                        EntryNode child = new EntryNode( rec.getEntryId(), this, db, newEntry, map, exprNode, engine );
+                        Attributes newEntry = db.lookup( (Long)rec.getEntryId() );
+                        EntryNode child = new EntryNode( (Long)rec.getEntryId(), this, db, newEntry, map, exprNode, engine );
                         children.add( child );
                     }
                 }
                 else
                 {
-                    Attributes newEntry = db.lookup( rec.getEntryId() );
-                    EntryNode child = new EntryNode( rec.getEntryId(), this, db, newEntry, map );
+                    Attributes newEntry = db.lookup( (Long)rec.getEntryId() );
+                    EntryNode child = new EntryNode( (Long)rec.getEntryId(), this, db, newEntry, map );
                     children.add( child );
                 }
             }
@@ -215,7 +214,7 @@
     }
 
 
-    public BigInteger getEntryId()
+    public Long getEntryId()
     {
         return id;
     }

Modified: directory/apacheds/branches/apacheds-sasl-branch/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/PartitionFrame.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-sasl-branch/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/PartitionFrame.java?view=diff&rev=541123&r1=541122&r2=541123
==============================================================================
--- directory/apacheds/branches/apacheds-sasl-branch/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/PartitionFrame.java (original)
+++ directory/apacheds/branches/apacheds-sasl-branch/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/PartitionFrame.java Wed May 23 17:26:40 2007
@@ -29,7 +29,6 @@
 import java.io.File;
 import java.io.FileNotFoundException;
 import java.io.FileReader;
-import java.math.BigInteger;
 import java.util.HashMap;
 import java.util.Hashtable;
 import java.util.Iterator;
@@ -62,11 +61,13 @@
 import javax.swing.tree.TreeNode;
 import javax.swing.tree.TreePath;
 
+import org.apache.directory.server.core.interceptor.context.AddOperationContext;
 import org.apache.directory.server.core.partition.impl.btree.BTreePartition;
 import org.apache.directory.server.core.partition.impl.btree.Index;
 import org.apache.directory.server.core.partition.impl.btree.IndexRecord;
 import org.apache.directory.server.core.partition.impl.btree.SearchEngine;
 
+import org.apache.directory.shared.ldap.constants.JndiPropertyConstants;
 import org.apache.directory.shared.ldap.filter.ExprNode;
 import org.apache.directory.shared.ldap.filter.FilterParser;
 import org.apache.directory.shared.ldap.filter.FilterParserImpl;
@@ -453,7 +454,7 @@
 
                 if ( null == partition.getEntryId( ndn.toString() ) )
                 {
-                    partition.add(ndn, attrs );
+                    partition.add( new AddOperationContext( ndn, attrs ) );
                     load();
                 }
             }
@@ -647,7 +648,7 @@
 
         Hashtable env = new Hashtable();
 
-        env.put( DerefAliasesEnum.JNDI_DEREF_ALIAS_PROP, DerefAliasesEnum.DEREF_ALWAYS );
+        env.put( JndiPropertyConstants.JNDI_LDAP_DAP_DEREF_ALIASES, DerefAliasesEnum.DEREF_ALWAYS );
 
         NamingEnumeration cursor = eng.search( new LdapDN( base ), env, root, ctls );
         String[] cols = new String[2];
@@ -660,7 +661,7 @@
         {
             IndexRecord rec = ( IndexRecord ) cursor.next();
             row[0] = rec.getEntryId();
-            row[1] = partition.getEntryDn( ( BigInteger ) row[0] );
+            row[1] = partition.getEntryDn( ( Long ) row[0] );
             tableModel.addRow( row );
             count++;
         }
@@ -704,7 +705,7 @@
     }
 
 
-    public void selectTreeNode( BigInteger id )
+    public void selectTreeNode( Long id )
     {
         Stack stack = new Stack();
         Object[] comps = null;
@@ -851,7 +852,7 @@
     }
 
 
-    void displayEntry( BigInteger id, Attributes entry ) throws Exception
+    void displayEntry( Long id, Attributes entry ) throws Exception
     {
         String dn = partition.getEntryUpdn( id );
         AttributesTableModel model = new AttributesTableModel( entry, id, dn, false );
@@ -870,7 +871,7 @@
         nodes = new HashMap();
 
         Attributes suffix = partition.getSuffixEntry();
-        BigInteger id = partition.getEntryId( partition.getSuffix().toString() );
+        Long id = partition.getEntryId( partition.getSuffix().toString() );
         root = new EntryNode( id, null, partition, suffix, nodes );
 
         /*



Mime
View raw message