directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r528795 - in /directory/apacheds/trunk/core/src: main/java/org/apache/directory/server/core/authn/ main/java/org/apache/directory/server/core/interceptor/ main/java/org/apache/directory/server/core/interceptor/context/ main/java/org/apache/...
Date Sat, 14 Apr 2007 10:53:41 GMT
Author: elecharny
Date: Sat Apr 14 03:53:40 2007
New Revision: 528795

URL: http://svn.apache.org/viewvc?view=rev&rev=528795
Log:
Modified the getSuffix method, using a GetSuffixServiceContext everywhere

Added:
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/interceptor/context/GetSuffixServiceContext.java
Modified:
    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/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/normalization/NormalizationService.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/PartitionNexus.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/PartitionNexusProxy.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/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=528795&r1=528794&r2=528795
==============================================================================
--- 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
Sat Apr 14 03:53:40 2007
@@ -254,15 +254,15 @@
     }
 
 
-    public LdapDN getSuffix ( NextInterceptor next, LdapDN dn ) throws NamingException
+    public LdapDN getSuffix ( NextInterceptor next, ServiceContext getSuffixContext ) throws
NamingException
     {
         if ( IS_DEBUG )
         {
-            log.debug( "Getting suffix for name = '" + dn.toString() + "'" );
+            log.debug( "Getting suffix for name = '" + getSuffixContext.getDn().getUpName()
+ "'" );
         }
 
         checkAuthenticated();
-        return next.getSuffix( dn );
+        return next.getSuffix( getSuffixContext );
     }
 
 

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=528795&r1=528794&r2=528795
==============================================================================
--- 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
Sat Apr 14 03:53:40 2007
@@ -123,9 +123,9 @@
     }
 
 
-    public LdapDN getSuffix ( NextInterceptor next, LdapDN dn ) throws NamingException
+    public LdapDN getSuffix( NextInterceptor next, ServiceContext getSuffixContext ) throws
NamingException
     {
-        return next.getSuffix( dn );
+        return next.getSuffix( getSuffixContext );
     }
 
 

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=528795&r1=528794&r2=528795
==============================================================================
--- 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
Sat Apr 14 03:53:40 2007
@@ -131,9 +131,9 @@
 
 
     /**
-     * Filters {@link PartitionNexus#getSuffix(org.apache.directory.shared.ldap.name.LdapDN)}
call.
+     * Filters {@link PartitionNexus#getSuffix( ServiceContext )} call.
      */
-    LdapDN getSuffix ( NextInterceptor next, LdapDN name ) throws NamingException;
+    LdapDN getSuffix ( NextInterceptor next, ServiceContext getSuffixContext ) 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=528795&r1=528794&r2=528795
==============================================================================
--- 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
Sat Apr 14 03:53:40 2007
@@ -97,9 +97,9 @@
         }
 
 
-        public LdapDN getSuffix ( NextInterceptor next, LdapDN dn ) throws NamingException
+        public LdapDN getSuffix ( NextInterceptor next, ServiceContext getSuffixContext )
throws NamingException
         {
-            return ( LdapDN ) nexus.getSuffix( dn ).clone();
+            return ( LdapDN ) nexus.getSuffix( getSuffixContext ).clone();
         }
 
 
@@ -565,14 +565,15 @@
     }
 
 
-    public LdapDN getSuffix ( LdapDN name ) throws NamingException
+    public LdapDN getSuffix ( ServiceContext getSuffixContext ) throws NamingException
     {
         Entry entry = getStartingEntry();
         Interceptor head = entry.configuration.getInterceptor();
         NextInterceptor next = entry.nextInterceptor;
+        
         try
         {
-            return head.getSuffix( next, name );
+            return head.getSuffix( next, getSuffixContext );
         }
         catch ( NamingException ne )
         {
@@ -1062,14 +1063,14 @@
                 }
 
 
-                public LdapDN getSuffix ( LdapDN dn ) throws NamingException
+                public LdapDN getSuffix ( ServiceContext getSuffixContext ) throws NamingException
                 {
                     Entry next = getNextEntry();
                     Interceptor interceptor = next.configuration.getInterceptor();
 
                     try
                     {
-                        return interceptor.getSuffix( next.nextInterceptor, dn );
+                        return interceptor.getSuffix( next.nextInterceptor, getSuffixContext
);
                     }
                     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=528795&r1=528794&r2=528795
==============================================================================
--- 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
Sat Apr 14 03:53:40 2007
@@ -60,19 +60,19 @@
     /**
      * Calls the next interceptor's {@link Interceptor#getMatchedName( NextInterceptor, ServiceContext
)}.
      */
-    LdapDN getMatchedName ( ServiceContext getMatchedNameContext ) throws NamingException;
+    LdapDN getMatchedName( ServiceContext getMatchedNameContext ) throws NamingException;
 
 
     /**
-     * Calls the next interceptor's {@link Interceptor#getSuffix(NextInterceptor,org.apache.directory.shared.ldap.name.LdapDN)}.
+     * Calls the next interceptor's {@link Interceptor#getSuffix( NextInterceptor, ServiceContext
getSuffixContext )}.
      */
-    LdapDN getSuffix ( LdapDN name ) throws NamingException;
+    LdapDN getSuffix( ServiceContext getSuffixContext ) throws NamingException;
 
 
     /**
      * Calls the next interceptor's {@link Interceptor#listSuffixes(NextInterceptor)}.
      */
-    Iterator listSuffixes () throws NamingException;
+    Iterator listSuffixes() throws NamingException;
 
 
     /**

Added: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/interceptor/context/GetSuffixServiceContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/interceptor/context/GetSuffixServiceContext.java?view=auto&rev=528795
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/interceptor/context/GetSuffixServiceContext.java
(added)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/interceptor/context/GetSuffixServiceContext.java
Sat Apr 14 03:53:40 2007
@@ -0,0 +1,58 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *  
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *  
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License. 
+ *  
+ */
+package org.apache.directory.server.core.interceptor.context;
+
+import org.apache.directory.shared.ldap.name.LdapDN;
+
+/**
+ * A GetSuffix context used for Interceptors. It contains all the informations
+ * needed for the GetSuffix operation, and used by all the interceptors
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
+public class GetSuffixServiceContext  extends AbstractServiceContext
+{
+    /**
+     * Creates a new instance of GetSuffixServiceContext.
+     */
+    public GetSuffixServiceContext()
+    {
+        super();
+    }
+    
+    /**
+     * Creates a new instance of GetSuffixServiceContext.
+     *
+     * @param dn The DN to get the suffix from
+     */
+    public GetSuffixServiceContext( LdapDN dn )
+    {
+        super( dn );
+    }
+    
+    /**
+     * @see Object#toString()
+     */
+    public String toString()
+    {
+        return "GetSuffixServiceContext with DN '" + getDn().getUpName() + "'";
+    }
+}

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=528795&r1=528794&r2=528795
==============================================================================
--- 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
Sat Apr 14 03:53:40 2007
@@ -377,10 +377,10 @@
     }
 
 
-    public LdapDN getSuffix ( NextInterceptor nextInterceptor, LdapDN name ) throws NamingException
+    public LdapDN getSuffix ( NextInterceptor nextInterceptor, ServiceContext getSuffixContext
) throws NamingException
     {
-        name = LdapDN.normalize( name, attrNormalizers );
-        return nextInterceptor.getSuffix( name );
+        LdapDN.normalize( getSuffixContext.getDn(), attrNormalizers );
+        return nextInterceptor.getSuffix( getSuffixContext );
     }
 
 

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=528795&r1=528794&r2=528795
==============================================================================
--- 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
Sat Apr 14 03:53:40 2007
@@ -621,11 +621,11 @@
 
 
     /**
-     * @see PartitionNexus#getSuffix(org.apache.directory.shared.ldap.name.LdapDN)
+     * @see PartitionNexus#getSuffix( ServiceContext )
      */
-    public LdapDN getSuffix ( LdapDN dn ) throws NamingException
+    public LdapDN getSuffix ( ServiceContext getSuffixContext ) throws NamingException
     {
-        Partition backend = getBackend( dn );
+        Partition backend = getBackend( getSuffixContext.getDn() );
         return backend.getSuffix();
     }
 

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/PartitionNexus.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/PartitionNexus.java?view=diff&rev=528795&r1=528794&r2=528795
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/PartitionNexus.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/PartitionNexus.java
Sat Apr 14 03:53:40 2007
@@ -236,12 +236,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 ( ServiceContext getSuffixContext ) throws NamingException;
 
 
     /**

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=528795&r1=528794&r2=528795
==============================================================================
--- 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
Sat Apr 14 03:53:40 2007
@@ -232,21 +232,21 @@
     }
 
 
-    public LdapDN getSuffix ( LdapDN dn ) throws NamingException
+    public LdapDN getSuffix ( ServiceContext getSuffixContext ) throws NamingException
     {
-        return getSuffix( dn, null );
+        return getSuffix( getSuffixContext, null );
     }
 
 
-    public LdapDN getSuffix( LdapDN dn, Collection bypass ) throws NamingException
+    public LdapDN getSuffix( ServiceContext getSuffixContext, Collection bypass ) throws
NamingException
     {
         ensureStarted();
         InvocationStack stack = InvocationStack.getInstance();
-        Object[] args = new Object[] { dn };
+        Object[] args = new Object[] { getSuffixContext };
         stack.push( new Invocation( this, caller, "getSuffix", args, bypass ) );
         try
         {
-            return this.configuration.getInterceptorChain().getSuffix( dn );
+            return this.configuration.getInterceptorChain().getSuffix( getSuffixContext );
         }
         finally
         {

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=528795&r1=528794&r2=528795
==============================================================================
--- 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
Sat Apr 14 03:53:40 2007
@@ -296,17 +296,17 @@
         }
 
 
-        public LdapDN getMatchedName ( NextInterceptor next, ServiceContext getMatchedDNContext
) throws NamingException
+        public LdapDN getMatchedName ( NextInterceptor next, ServiceContext getMatchedNameContext
) throws NamingException
         {
             interceptors.add( this );
-            return next.getMatchedName( getMatchedDNContext );
+            return next.getMatchedName( getMatchedNameContext );
         }
 
 
-        public LdapDN getSuffix ( NextInterceptor next, LdapDN name ) throws NamingException
+        public LdapDN getSuffix ( NextInterceptor next, ServiceContext getSuffixContext )
throws NamingException
         {
             interceptors.add( this );
-            return next.getSuffix( name );
+            return next.getSuffix( getSuffixContext );
         }
 
 



Mime
View raw message