directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r526226 - in /directory/apacheds/trunk/core/src: main/java/org/apache/directory/server/core/ main/java/org/apache/directory/server/core/authn/ main/java/org/apache/directory/server/core/authz/ main/java/org/apache/directory/server/core/exce...
Date Fri, 06 Apr 2007 16:53:34 GMT
Author: elecharny
Date: Fri Apr  6 09:53:32 2007
New Revision: 526226

URL: http://svn.apache.org/viewvc?view=rev&rev=526226
Log:
Modified the hasEntry class to take an EntryServiceContext argument
Removed the useless SuffixServiceContext

Removed:
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/interceptor/context/SuffixServiceContext.java
Modified:
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/AuthenticationService.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/AuthorizationService.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationService.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/exception/ExceptionService.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/interceptor/BaseInterceptor.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/interceptor/Interceptor.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/interceptor/InterceptorChain.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/interceptor/NextInterceptor.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/jndi/ServerContext.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/jndi/ServerDirContext.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/normalization/NormalizationService.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/AbstractPartition.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/Partition.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/PartitionNexusProxy.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreePartition.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/PartitionSchemaLoader.java
    directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/interceptor/InterceptorChainTest.java

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java?view=diff&rev=526226&r1=526225&r2=526226
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java
Fri Apr  6 09:53:32 2007
@@ -41,6 +41,7 @@
 import org.apache.directory.server.core.configuration.StartupConfiguration;
 import org.apache.directory.server.core.interceptor.Interceptor;
 import org.apache.directory.server.core.interceptor.InterceptorChain;
+import org.apache.directory.server.core.interceptor.context.EntryServiceContext;
 import org.apache.directory.server.core.interceptor.context.LookupServiceContext;
 import org.apache.directory.server.core.jndi.AbstractContextFactory;
 import org.apache.directory.server.core.jndi.DeadContext;
@@ -455,7 +456,7 @@
         /*
          * If the admin entry is there, then the database was already created
          */
-        if ( !partitionNexus.hasEntry( PartitionNexus.getAdminName() ) )
+        if ( !partitionNexus.hasEntry( new EntryServiceContext( PartitionNexus.getAdminName()
) ) )
         {
             firstStart = true;
 
@@ -488,7 +489,7 @@
         LdapDN userDn = new LdapDN( "ou=users,ou=system" );
         userDn.normalize( oidsMap );
         
-        if ( !partitionNexus.hasEntry( userDn ) )
+        if ( !partitionNexus.hasEntry( new EntryServiceContext( userDn ) ) )
         {
             firstStart = true;
 
@@ -512,7 +513,7 @@
         LdapDN groupDn = new LdapDN( "ou=groups,ou=system" );
         groupDn.normalize( oidsMap );
         
-        if ( !partitionNexus.hasEntry( groupDn ) )
+        if ( !partitionNexus.hasEntry( new EntryServiceContext( groupDn ) ) )
         {
             firstStart = true;
 
@@ -537,7 +538,7 @@
         LdapDN normName = new LdapDN( "cn=administrators,ou=groups,ou=system" );
         normName.normalize( oidsMap );
         
-        if ( !partitionNexus.hasEntry( normName ) )
+        if ( !partitionNexus.hasEntry( new EntryServiceContext( normName ) ) )
         {
             firstStart = true;
 
@@ -581,7 +582,7 @@
         LdapDN configurationDn = new LdapDN( "ou=configuration,ou=system" );
         configurationDn.normalize( oidsMap );
         
-        if ( !partitionNexus.hasEntry( configurationDn ) )
+        if ( !partitionNexus.hasEntry( new EntryServiceContext( configurationDn ) ) )
         {
             firstStart = true;
 
@@ -605,7 +606,7 @@
         LdapDN partitionsDn = new LdapDN( "ou=partitions,ou=configuration,ou=system" );
         partitionsDn.normalize( oidsMap );
         
-        if ( !partitionNexus.hasEntry( partitionsDn ) ) 
+        if ( !partitionNexus.hasEntry( new EntryServiceContext( partitionsDn ) ) )
         {
             firstStart = true;
 
@@ -629,7 +630,7 @@
         LdapDN servicesDn = new LdapDN( "ou=services,ou=configuration,ou=system" );
         servicesDn.normalize( oidsMap );
         
-        if ( !partitionNexus.hasEntry( servicesDn ) )
+        if ( !partitionNexus.hasEntry( new EntryServiceContext( servicesDn ) ) )
         {
             firstStart = true;
 
@@ -653,7 +654,7 @@
         LdapDN interceptorsDn = new LdapDN( "ou=interceptors,ou=configuration,ou=system"
);
         interceptorsDn.normalize( oidsMap );
         
-        if ( !partitionNexus.hasEntry( interceptorsDn ) )
+        if ( !partitionNexus.hasEntry( new EntryServiceContext( interceptorsDn ) ) )
         {
             firstStart = true;
 
@@ -677,7 +678,7 @@
         LdapDN sysPrefRootDn = new LdapDN( "prefNodeName=sysPrefRoot,ou=system");
         sysPrefRootDn.normalize( oidsMap );
         
-        if ( !partitionNexus.hasEntry( sysPrefRootDn ) )
+        if ( !partitionNexus.hasEntry( new EntryServiceContext( sysPrefRootDn ) ) )
         {
             firstStart = true;
 

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/AuthenticationService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/AuthenticationService.java?view=diff&rev=526226&r1=526225&r2=526226
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/AuthenticationService.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/AuthenticationService.java
Fri Apr  6 09:53:32 2007
@@ -42,6 +42,7 @@
 import org.apache.directory.server.core.interceptor.Interceptor;
 import org.apache.directory.server.core.interceptor.NextInterceptor;
 import org.apache.directory.server.core.interceptor.context.BindServiceContext;
+import org.apache.directory.server.core.interceptor.context.EntryServiceContext;
 import org.apache.directory.server.core.interceptor.context.LookupServiceContext;
 import org.apache.directory.server.core.interceptor.context.ServiceContext;
 import org.apache.directory.server.core.invocation.InvocationStack;
@@ -260,15 +261,15 @@
     }
 
 
-    public boolean hasEntry( NextInterceptor next, LdapDN name ) throws NamingException
+    public boolean hasEntry( NextInterceptor next, ServiceContext entryContext ) throws NamingException
     {
         if ( IS_DEBUG )
         {
-            log.debug( "Testing if entry name = '" + name.toString() + "' exists" );
+            log.debug( "Testing if entry name = '" + ((EntryServiceContext)entryContext).getEntryDn().getUpName()
+ "' exists" );
         }
 
         checkAuthenticated();
-        return next.hasEntry( name );
+        return next.hasEntry( entryContext );
     }
 
 

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/AuthorizationService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/AuthorizationService.java?view=diff&rev=526226&r1=526225&r2=526226
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/AuthorizationService.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/AuthorizationService.java
Fri Apr  6 09:53:32 2007
@@ -30,6 +30,7 @@
 import org.apache.directory.server.core.interceptor.BaseInterceptor;
 import org.apache.directory.server.core.interceptor.InterceptorChain;
 import org.apache.directory.server.core.interceptor.NextInterceptor;
+import org.apache.directory.server.core.interceptor.context.EntryServiceContext;
 import org.apache.directory.server.core.interceptor.context.LookupServiceContext;
 import org.apache.directory.server.core.interceptor.context.ServiceContext;
 import org.apache.directory.server.core.invocation.Invocation;
@@ -607,8 +608,9 @@
     }
 
 
-    public boolean hasEntry( NextInterceptor next, LdapDN name ) throws NamingException
+    public boolean hasEntry( NextInterceptor next, ServiceContext entryContext ) throws NamingException
     {
+        LdapDN name = ((EntryServiceContext)entryContext).getEntryDn();
         Invocation invocation = InvocationStack.getInstance().peek();
         PartitionNexusProxy proxy = invocation.getProxy();
         Attributes entry = proxy.lookup( new LookupServiceContext( name ), PartitionNexusProxy.LOOKUP_BYPASS
);
@@ -624,7 +626,7 @@
             }
             else
             {
-                return next.hasEntry( name );
+                return next.hasEntry( entryContext );
             }
         }
 
@@ -638,7 +640,7 @@
         engine.checkPermission( proxy, userGroups, principalDn, principal.getAuthenticationLevel(),
name, null, null,
             BROWSE_PERMS, tuples, entry );
 
-        return next.hasEntry( name );
+        return next.hasEntry( entryContext );
     }
 
 

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationService.java?view=diff&rev=526226&r1=526225&r2=526226
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationService.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationService.java
Fri Apr  6 09:53:32 2007
@@ -218,18 +218,6 @@
     }
     
 
-    /**
-     * Note that we do nothing here. First because this is not an externally
-     * exposed function via the JNDI interfaces.  It is used internally by
-     * the provider for optimization purposes so there is no reason for us to
-     * start to constrain it.
-     */
-    public boolean hasEntry( NextInterceptor nextInterceptor, LdapDN name ) throws NamingException
-    {
-        return super.hasEntry( nextInterceptor, name );
-    }
-
-
     // ------------------------------------------------------------------------
     // Entry Modification Operations
     // ------------------------------------------------------------------------

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/exception/ExceptionService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/exception/ExceptionService.java?view=diff&rev=526226&r1=526225&r2=526226
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/exception/ExceptionService.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/exception/ExceptionService.java
Fri Apr  6 09:53:32 2007
@@ -33,6 +33,7 @@
 import org.apache.directory.server.core.configuration.InterceptorConfiguration;
 import org.apache.directory.server.core.interceptor.BaseInterceptor;
 import org.apache.directory.server.core.interceptor.NextInterceptor;
+import org.apache.directory.server.core.interceptor.context.EntryServiceContext;
 import org.apache.directory.server.core.interceptor.context.LookupServiceContext;
 import org.apache.directory.server.core.interceptor.context.ServiceContext;
 import org.apache.directory.server.core.invocation.Invocation;
@@ -111,7 +112,7 @@
         }
         
         // check if the entry already exists
-        if ( nextInterceptor.hasEntry( normName ) )
+        if ( nextInterceptor.hasEntry( new EntryServiceContext( normName ) ) )
         {
             NamingException ne = new LdapNameAlreadyBoundException( normName.toString() +
" already exists!" );
             ne.setResolvedName( new LdapDN( normName.getUpName() ) );
@@ -339,7 +340,7 @@
         newDn.remove( dn.size() - 1 );
         newDn.add( newRn );
         newDn.normalize( normalizerMap );
-        if ( nextInterceptor.hasEntry( newDn ) )
+        if ( nextInterceptor.hasEntry( new EntryServiceContext( newDn ) ) )
         {
             LdapNameAlreadyBoundException e;
             e = new LdapNameAlreadyBoundException( "target entry " + newDn.getUpName() +
" already exists!" );
@@ -377,7 +378,7 @@
         String rdn = oriChildName.get( oriChildName.size() - 1 );
         LdapDN target = ( LdapDN ) newParentName.clone();
         target.add( rdn );
-        if ( nextInterceptor.hasEntry( target ) )
+        if ( nextInterceptor.hasEntry( new EntryServiceContext( target ) ) )
         {
             // we must calculate the resolved name using the user provided Rdn value
             String upRdn = new LdapDN( oriChildName.getUpName() ).get( oriChildName.size()
- 1 );
@@ -421,7 +422,7 @@
         LdapDN target = ( LdapDN ) newParentName.clone();
         target.add( newRn );
         target.normalize( normalizerMap );
-        if ( nextInterceptor.hasEntry( target ) )
+        if ( nextInterceptor.hasEntry( new EntryServiceContext( target ) ) )
         {
             // we must calculate the resolved name using the user provided Rdn value
             LdapDN upTarget = ( LdapDN ) newParentName.clone();
@@ -478,7 +479,7 @@
         
         Invocation invocation = InvocationStack.getInstance().peek();
         PartitionNexusProxy proxy = invocation.getProxy();
-        if ( !nextInterceptor.hasEntry( dn ) )
+        if ( !nextInterceptor.hasEntry( new EntryServiceContext( dn ) ) )
         {
             LdapNameNotFoundException e;
 

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/interceptor/BaseInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/interceptor/BaseInterceptor.java?view=diff&rev=526226&r1=526225&r2=526226
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/interceptor/BaseInterceptor.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/interceptor/BaseInterceptor.java
Fri Apr  6 09:53:32 2007
@@ -129,9 +129,9 @@
     }
 
 
-    public boolean hasEntry( NextInterceptor next, LdapDN name ) throws NamingException
+    public boolean hasEntry( NextInterceptor next, ServiceContext entryContext ) throws NamingException
     {
-        return next.hasEntry( name );
+        return next.hasEntry( entryContext );
     }
 
 

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/interceptor/Interceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/interceptor/Interceptor.java?view=diff&rev=526226&r1=526225&r2=526226
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/interceptor/Interceptor.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/interceptor/Interceptor.java
Fri Apr  6 09:53:32 2007
@@ -204,9 +204,9 @@
 
 
     /**
-     * Filters {@link Partition#lookup(org.apache.directory.shared.ldap.name.LdapDN,String[])}
call.
+     * Filters {@link Partition#hasEntry(ServiceContext)} call.
      */
-    boolean hasEntry( NextInterceptor next, LdapDN name ) throws NamingException;
+    boolean hasEntry( NextInterceptor next, ServiceContext entryContext ) throws NamingException;
 
 
     /**

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/interceptor/InterceptorChain.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/interceptor/InterceptorChain.java?view=diff&rev=526226&r1=526225&r2=526226
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/interceptor/InterceptorChain.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/interceptor/InterceptorChain.java
Fri Apr  6 09:53:32 2007
@@ -152,9 +152,9 @@
         }
 
 
-        public boolean hasEntry( NextInterceptor next, LdapDN name ) throws NamingException
+        public boolean hasEntry( NextInterceptor next, ServiceContext entryContext ) throws
NamingException
         {
-            return nexus.hasEntry( name );
+            return nexus.hasEntry( entryContext );
         }
 
 
@@ -854,14 +854,14 @@
     }
 
 
-    public boolean hasEntry( LdapDN name ) throws NamingException
+    public boolean hasEntry( ServiceContext entryContext ) throws NamingException
     {
         Entry entry = getStartingEntry();
         Interceptor head = entry.configuration.getInterceptor();
         NextInterceptor next = entry.nextInterceptor;
         try
         {
-            return head.hasEntry( next, name );
+            return head.hasEntry( next, entryContext );
         }
         catch ( NamingException ne )
         {
@@ -1247,14 +1247,14 @@
                 }
 
 
-                public boolean hasEntry( LdapDN name ) throws NamingException
+                public boolean hasEntry( ServiceContext entryContext ) throws NamingException
                 {
                     Entry next = getNextEntry();
                     Interceptor interceptor = next.configuration.getInterceptor();
 
                     try
                     {
-                        return interceptor.hasEntry( next.nextInterceptor, name );
+                        return interceptor.hasEntry( next.nextInterceptor, entryContext );
                     }
                     catch ( NamingException ne )
                     {

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/interceptor/NextInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/interceptor/NextInterceptor.java?view=diff&rev=526226&r1=526225&r2=526226
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/interceptor/NextInterceptor.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/interceptor/NextInterceptor.java
Fri Apr  6 09:53:32 2007
@@ -131,9 +131,9 @@
 
 
     /**
-     * Calls the next interceptor's {@link Interceptor#hasEntry(NextInterceptor,org.apache.directory.shared.ldap.name.LdapDN)}.
+     * Calls the next interceptor's {@link Interceptor#hasEntry(NextInterceptor,ServiceContext)}.
      */
-    boolean hasEntry( LdapDN name ) throws NamingException;
+    boolean hasEntry( ServiceContext entryContext ) throws NamingException;
 
 
     /**

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/jndi/ServerContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/jndi/ServerContext.java?view=diff&rev=526226&r1=526225&r2=526226
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/jndi/ServerContext.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/jndi/ServerContext.java
Fri Apr  6 09:53:32 2007
@@ -50,6 +50,7 @@
 import org.apache.directory.server.core.authn.AuthenticationService;
 import org.apache.directory.server.core.authn.LdapPrincipal;
 import org.apache.directory.server.core.interceptor.context.BindServiceContext;
+import org.apache.directory.server.core.interceptor.context.EntryServiceContext;
 import org.apache.directory.server.core.interceptor.context.LookupServiceContext;
 import org.apache.directory.server.core.partition.PartitionNexus;
 import org.apache.directory.server.core.partition.PartitionNexusProxy;
@@ -134,7 +135,7 @@
         // need to issue a bind operation here
         this.nexusProxy.bind( bindContext ); 
 
-        if ( ! nexusProxy.hasEntry( dn ) )
+        if ( ! nexusProxy.hasEntry( new EntryServiceContext( dn ) ) )
         {
             throw new NameNotFoundException( dn + " does not exist" );
         }
@@ -530,10 +531,12 @@
     public void rebind( Name name, Object obj ) throws NamingException
     {
         LdapDN target = buildTarget( name );
-        if ( nexusProxy.hasEntry( target ) )
+        
+        if ( nexusProxy.hasEntry( new EntryServiceContext( target ) ) )
         {
             nexusProxy.delete( target );
         }
+        
         bind( name, obj );
     }
 

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/jndi/ServerDirContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/jndi/ServerDirContext.java?view=diff&rev=526226&r1=526225&r2=526226
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/jndi/ServerDirContext.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/jndi/ServerDirContext.java
Fri Apr  6 09:53:32 2007
@@ -44,6 +44,7 @@
 
 import org.apache.directory.server.core.DirectoryService;
 import org.apache.directory.server.core.authn.LdapPrincipal;
+import org.apache.directory.server.core.interceptor.context.EntryServiceContext;
 import org.apache.directory.server.core.interceptor.context.LookupServiceContext;
 import org.apache.directory.server.core.partition.PartitionNexusProxy;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
@@ -346,7 +347,7 @@
     public void rebind( Name name, Object obj, Attributes attrs ) throws NamingException
     {
         LdapDN target = buildTarget( name );
-        if ( getNexusProxy().hasEntry( target ) )
+        if ( getNexusProxy().hasEntry( new EntryServiceContext( target ) ) )
         {
             getNexusProxy().delete( target );
         }

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/normalization/NormalizationService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/normalization/NormalizationService.java?view=diff&rev=526226&r1=526225&r2=526226
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/normalization/NormalizationService.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/normalization/NormalizationService.java
Fri Apr  6 09:53:32 2007
@@ -34,6 +34,7 @@
 import org.apache.directory.server.core.interceptor.BaseInterceptor;
 import org.apache.directory.server.core.interceptor.NextInterceptor;
 import org.apache.directory.server.core.interceptor.context.BindServiceContext;
+import org.apache.directory.server.core.interceptor.context.EntryServiceContext;
 import org.apache.directory.server.core.interceptor.context.LookupServiceContext;
 import org.apache.directory.server.core.interceptor.context.ServiceContext;
 import org.apache.directory.server.core.partition.PartitionNexus;
@@ -344,10 +345,10 @@
     }
 
 
-    public boolean hasEntry( NextInterceptor nextInterceptor, LdapDN name ) throws NamingException
+    public boolean hasEntry( NextInterceptor nextInterceptor, ServiceContext entryContext
) throws NamingException
     {
-        name = LdapDN.normalize( name, attrNormalizers );
-        return nextInterceptor.hasEntry( name );
+        LdapDN.normalize( ((EntryServiceContext)entryContext).getEntryDn(), attrNormalizers
);
+        return nextInterceptor.hasEntry( entryContext );
     }
 
 

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/AbstractPartition.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/AbstractPartition.java?view=diff&rev=526226&r1=526225&r2=526226
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/AbstractPartition.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/AbstractPartition.java
Fri Apr  6 09:53:32 2007
@@ -32,12 +32,12 @@
 
 import org.apache.directory.server.core.DirectoryServiceConfiguration;
 import org.apache.directory.server.core.configuration.PartitionConfiguration;
+import org.apache.directory.server.core.interceptor.context.EntryServiceContext;
 import org.apache.directory.server.core.interceptor.context.LookupServiceContext;
 import org.apache.directory.server.core.interceptor.context.ServiceContext;
 import org.apache.directory.shared.ldap.message.ModificationItemImpl;
 import org.apache.directory.shared.ldap.name.LdapDN;
 
-
 /**
  * A {@link Partition} that helps users to implement their own partition.
  * Most methods are implemented by default.  Please look at the description of
@@ -188,15 +188,15 @@
 
 
     /**
-     * This method calls {@link Partition#lookup(org.apache.directory.shared.ldap.name.LdapDN)}
and return <tt>true</tt>
+     * This method calls {@link Partition#lookup(ServiceContext)} and return <tt>true</tt>
      * if it returns an entry by default.  Please override this method if
      * there is more effective way for your implementation.
      */
-    public boolean hasEntry( LdapDN name ) throws NamingException
+    public boolean hasEntry( ServiceContext entryContext ) throws NamingException
     {
         try
         {
-            return lookup( new LookupServiceContext( name ) ) != null;
+            return lookup( new LookupServiceContext( ((EntryServiceContext)entryContext).getEntryDn()
) ) != null;
         }
         catch ( NameNotFoundException e )
         {

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java?view=diff&rev=526226&r1=526225&r2=526226
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java
Fri Apr  6 09:53:32 2007
@@ -45,6 +45,7 @@
 import org.apache.directory.server.core.DirectoryServiceConfiguration;
 import org.apache.directory.server.core.configuration.PartitionConfiguration;
 import org.apache.directory.server.core.interceptor.context.BindServiceContext;
+import org.apache.directory.server.core.interceptor.context.EntryServiceContext;
 import org.apache.directory.server.core.interceptor.context.LookupServiceContext;
 import org.apache.directory.server.core.interceptor.context.ServiceContext;
 import org.apache.directory.server.core.interceptor.context.UnbindServiceContext;
@@ -593,7 +594,7 @@
         dn = ( LdapDN ) dn.clone();
         while ( dn.size() > 0 )
         {
-            if ( hasEntry( dn ) )
+            if ( hasEntry( new EntryServiceContext( dn ) ) )
             {
                 return dn;
             }
@@ -925,10 +926,12 @@
 
 
     /**
-     * @see Partition#hasEntry(org.apache.directory.shared.ldap.name.LdapDN)
+     * @see Partition#hasEntry(ServiceContext)
      */
-    public boolean hasEntry( LdapDN dn ) throws NamingException
+    public boolean hasEntry( ServiceContext entryContext ) throws NamingException
     {
+        LdapDN dn = ((EntryServiceContext)entryContext).getEntryDn();
+        
         if ( IS_DEBUG )
         {
             log.debug( "Check if DN '" + dn + "' exists." );
@@ -940,7 +943,7 @@
         }
 
         Partition backend = getBackend( dn );
-        return backend.hasEntry( dn );
+        return backend.hasEntry( entryContext );
     }
 
 

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/Partition.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/Partition.java?view=diff&rev=526226&r1=526225&r2=526226
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/Partition.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/Partition.java
Fri Apr  6 09:53:32 2007
@@ -205,12 +205,11 @@
     /**
      * Fast operation to check and see if a particular entry exists.
      *
-     * @param name the normalized distinguished/absolute name of the object to
-     * check for existance
+     * @param ntry The entryContext used to pass informations
      * @return true if the entry exists, false if it does not
      * @throws NamingException if there are any problems
      */
-    boolean hasEntry( LdapDN name ) throws NamingException;
+    boolean hasEntry( ServiceContext entryContext ) throws NamingException;
 
     /**
      * Modifies an entry by changing its relative name. Optionally attributes

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/PartitionNexusProxy.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/PartitionNexusProxy.java?view=diff&rev=526226&r1=526225&r2=526226
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/PartitionNexusProxy.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/PartitionNexusProxy.java
Fri Apr  6 09:53:32 2007
@@ -520,21 +520,21 @@
         }
     }
 
-    public boolean hasEntry( LdapDN name ) throws NamingException
+    public boolean hasEntry( ServiceContext entryContext ) throws NamingException
     {
-        return hasEntry( name, null );
+        return hasEntry( entryContext, null );
     }
 
 
-    public boolean hasEntry( LdapDN name, Collection bypass ) throws NamingException
+    public boolean hasEntry( ServiceContext entryContext, Collection bypass ) throws NamingException
     {
         ensureStarted();
         InvocationStack stack = InvocationStack.getInstance();
         stack.push( new Invocation( this, caller, "hasEntry", new Object[]
-            { name }, bypass ) );
+            { entryContext }, bypass ) );
         try
         {
-            return this.configuration.getInterceptorChain().hasEntry( name );
+            return this.configuration.getInterceptorChain().hasEntry( entryContext );
         }
         finally
         {

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreePartition.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreePartition.java?view=diff&rev=526226&r1=526225&r2=526226
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreePartition.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreePartition.java
Fri Apr  6 09:53:32 2007
@@ -34,6 +34,7 @@
 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.interceptor.context.EntryServiceContext;
 import org.apache.directory.server.core.interceptor.context.LookupServiceContext;
 import org.apache.directory.server.core.interceptor.context.ServiceContext;
 import org.apache.directory.server.core.partition.Partition;
@@ -461,9 +462,9 @@
     }
 
 
-    public boolean hasEntry( LdapDN dn ) throws NamingException
+    public boolean hasEntry( ServiceContext entryContext ) throws NamingException
     {
-        return null != getEntryId( dn.toString() );
+        return null != getEntryId( ((EntryServiceContext)entryContext).getEntryDn().getNormName()
);
     }
 
 

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/PartitionSchemaLoader.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/PartitionSchemaLoader.java?view=diff&rev=526226&r1=526225&r2=526226
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/PartitionSchemaLoader.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/PartitionSchemaLoader.java
Fri Apr  6 09:53:32 2007
@@ -40,6 +40,7 @@
 import javax.naming.directory.SearchResult;
 
 import org.apache.directory.server.constants.MetaSchemaConstants;
+import org.apache.directory.server.core.interceptor.context.EntryServiceContext;
 import org.apache.directory.server.core.interceptor.context.LookupServiceContext;
 import org.apache.directory.server.core.partition.Partition;
 import org.apache.directory.server.schema.bootstrap.Schema;
@@ -408,7 +409,7 @@
             staticObjectClassesDNs.put( schema.getSchemaName(), dn );
         }
         
-        if ( ! partition.hasEntry( dn ) )
+        if ( ! partition.hasEntry( new EntryServiceContext( dn ) ) )
         {
             return;
         }
@@ -508,7 +509,7 @@
             staticAttributeTypeDNs.put( schema.getSchemaName(), dn );
         }
         
-        if ( ! partition.hasEntry( dn ) )
+        if ( ! partition.hasEntry( new EntryServiceContext( dn ) ) )
         {
             return;
         }
@@ -605,7 +606,7 @@
             staticMatchingRulesDNs.put( schema.getSchemaName(), dn );
         }
         
-        if ( ! partition.hasEntry( dn ) )
+        if ( ! partition.hasEntry( new EntryServiceContext( dn ) ) )
         {
             return;
         }
@@ -637,7 +638,7 @@
             staticSyntaxesDNs.put( schema.getSchemaName(), dn );
         }
         
-        if ( ! partition.hasEntry( dn ) )
+        if ( ! partition.hasEntry( new EntryServiceContext( dn ) ) )
         {
             return;
         }
@@ -668,7 +669,7 @@
             staticSyntaxCheckersDNs.put( schema.getSchemaName(), dn );
         }
         
-        if ( ! partition.hasEntry( dn ) )
+        if ( ! partition.hasEntry( new EntryServiceContext( dn ) ) )
         {
             return;
         }
@@ -701,7 +702,7 @@
             staticNormalizersDNs.put( schema.getSchemaName(), dn );
         }
         
-        if ( ! partition.hasEntry( dn ) )
+        if ( ! partition.hasEntry( new EntryServiceContext( dn ) ) )
         {
             return;
         }
@@ -770,7 +771,7 @@
             staticComparatorsDNs.put( schema.getSchemaName(), dn );
         }
 
-        if ( ! partition.hasEntry( dn ) )
+        if ( ! partition.hasEntry( new EntryServiceContext( dn ) ) )
         {
             return;
         }

Modified: directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/interceptor/InterceptorChainTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/interceptor/InterceptorChainTest.java?view=diff&rev=526226&r1=526225&r2=526226
==============================================================================
--- directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/interceptor/InterceptorChainTest.java
(original)
+++ directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/interceptor/InterceptorChainTest.java
Fri Apr  6 09:53:32 2007
@@ -390,10 +390,10 @@
         }
 
 
-        public boolean hasEntry( NextInterceptor next, LdapDN name ) throws NamingException
+        public boolean hasEntry( NextInterceptor next, ServiceContext entryContext ) throws
NamingException
         {
             interceptors.add( this );
-            return next.hasEntry( name );
+            return next.hasEntry( entryContext );
         }
 
 



Mime
View raw message