directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r528797 - in /directory/apacheds/trunk/core/src: main/java/org/apache/directory/server/core/authn/ main/java/org/apache/directory/server/core/authz/ main/java/org/apache/directory/server/core/interceptor/ main/java/org/apache/directory/serv...
Date Sat, 14 Apr 2007 12:22:33 GMT
Author: elecharny
Date: Sat Apr 14 05:22:32 2007
New Revision: 528797

URL: http://svn.apache.org/viewvc?view=rev&rev=528797
Log:
Added the EmptyServiceContext and used it for listSuffixes methods

Added:
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/interceptor/context/EmptyServiceContext.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/authz/GroupCache.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/TupleCache.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/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/main/java/org/apache/directory/server/core/referral/ReferralService.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/subtree/SubentryService.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/TriggerSpecCache.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=528797&r1=528796&r2=528797
==============================================================================
--- 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 05:22:32 2007
@@ -290,7 +290,7 @@
     }
 
 
-    public Iterator listSuffixes ( NextInterceptor next ) throws NamingException
+    public Iterator listSuffixes ( NextInterceptor next, ServiceContext emptyContext ) throws
NamingException
     {
         if ( IS_DEBUG )
         {
@@ -298,7 +298,7 @@
         }
 
         checkAuthenticated();
-        return next.listSuffixes();
+        return next.listSuffixes( emptyContext );
     }
 
 

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/GroupCache.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/GroupCache.java?view=diff&rev=528797&r1=528796&r2=528797
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/GroupCache.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/GroupCache.java
Sat Apr 14 05:22:32 2007
@@ -124,7 +124,8 @@
         filter.addNode( new SimpleNode( SchemaConstants.OBJECT_CLASS_AT, GROUPOFNAMES_OC,
AssertionEnum.EQUALITY ) );
         filter.addNode( new SimpleNode( SchemaConstants.OBJECT_CLASS_AT, GROUPOFUNIQUENAMES_OC,
AssertionEnum.EQUALITY ) );
 
-        Iterator suffixes = nexus.listSuffixes();
+        Iterator suffixes = nexus.listSuffixes( null );
+        
         while ( suffixes.hasNext() )
         {
             String suffix = ( String ) suffixes.next();

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/TupleCache.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/TupleCache.java?view=diff&rev=528797&r1=528796&r2=528797
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/TupleCache.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/TupleCache.java
Sat Apr 14 05:22:32 2007
@@ -123,7 +123,8 @@
         // search all naming contexts for access control subentenries
         // generate ACITuple Arrays for each subentry
         // add that subentry to the hash
-        Iterator suffixes = nexus.listSuffixes();
+        Iterator suffixes = nexus.listSuffixes( null );
+        
         while ( suffixes.hasNext() )
         {
             String suffix = ( String ) suffixes.next();

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=528797&r1=528796&r2=528797
==============================================================================
--- 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 05:22:32 2007
@@ -141,9 +141,9 @@
     }
 
 
-    public Iterator listSuffixes ( NextInterceptor next ) throws NamingException
+    public Iterator listSuffixes ( NextInterceptor next, ServiceContext emptyContext ) throws
NamingException
     {
-        return next.listSuffixes();
+        return next.listSuffixes( emptyContext );
     }
 
 

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=528797&r1=528796&r2=528797
==============================================================================
--- 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 05:22:32 2007
@@ -137,9 +137,9 @@
 
 
     /**
-     * Filters {@link PartitionNexus#listSuffixes()} call.
+     * Filters {@link PartitionNexus#listSuffixes( ServiceContext )} call.
      */
-    Iterator listSuffixes ( NextInterceptor next ) throws NamingException;
+    Iterator listSuffixes( NextInterceptor next, ServiceContext emptyContext ) 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=528797&r1=528796&r2=528797
==============================================================================
--- 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 05:22:32 2007
@@ -103,9 +103,9 @@
         }
 
 
-        public Iterator listSuffixes ( NextInterceptor next ) throws NamingException
+        public Iterator listSuffixes ( NextInterceptor next, ServiceContext emptyContext
) throws NamingException
         {
-            return nexus.listSuffixes();
+            return nexus.listSuffixes( emptyContext );
         }
 
 
@@ -608,14 +608,14 @@
     }
 
 
-    public Iterator listSuffixes() throws NamingException
+    public Iterator listSuffixes( ServiceContext emptyContext ) throws NamingException
     {
         Entry entry = getStartingEntry();
         Interceptor head = entry.configuration.getInterceptor();
         NextInterceptor next = entry.nextInterceptor;
         try
         {
-            return head.listSuffixes( next );
+            return head.listSuffixes( next, emptyContext );
         }
         catch ( NamingException ne )
         {
@@ -1042,7 +1042,7 @@
                 }
 
 
-                public LdapDN getMatchedName ( ServiceContext getMatchedNameContext ) throws
NamingException
+                public LdapDN getMatchedName( ServiceContext getMatchedNameContext ) throws
NamingException
                 {
                     Entry next = getNextEntry();
                     Interceptor interceptor = next.configuration.getInterceptor();
@@ -1063,7 +1063,7 @@
                 }
 
 
-                public LdapDN getSuffix ( ServiceContext getSuffixContext ) throws NamingException
+                public LdapDN getSuffix( ServiceContext getSuffixContext ) throws NamingException
                 {
                     Entry next = getNextEntry();
                     Interceptor interceptor = next.configuration.getInterceptor();
@@ -1084,14 +1084,14 @@
                 }
 
 
-                public Iterator listSuffixes () throws NamingException
+                public Iterator listSuffixes( ServiceContext emptyContext ) throws NamingException
                 {
                     Entry next = getNextEntry();
                     Interceptor interceptor = next.configuration.getInterceptor();
 
                     try
                     {
-                        return interceptor.listSuffixes( next.nextInterceptor );
+                        return interceptor.listSuffixes( next.nextInterceptor, emptyContext
);
                     }
                     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=528797&r1=528796&r2=528797
==============================================================================
--- 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 05:22:32 2007
@@ -70,9 +70,9 @@
 
 
     /**
-     * Calls the next interceptor's {@link Interceptor#listSuffixes(NextInterceptor)}.
+     * Calls the next interceptor's {@link Interceptor#listSuffixes( NextInterceptor), ServiceContext
)}.
      */
-    Iterator listSuffixes() throws NamingException;
+    Iterator listSuffixes( ServiceContext emptyContext ) throws NamingException;
 
 
     /**

Added: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/interceptor/context/EmptyServiceContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/interceptor/context/EmptyServiceContext.java?view=auto&rev=528797
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/interceptor/context/EmptyServiceContext.java
(added)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/interceptor/context/EmptyServiceContext.java
Sat Apr 14 05:22:32 2007
@@ -0,0 +1,46 @@
+/*
+ *  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;
+
+/**
+ * An EmptySuffix context used for Interceptors. It contains no data, and mask
+ * the DN in AbstractServiceContext
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
+public class EmptyServiceContext  extends AbstractServiceContext
+{
+    /**
+     * Creates a new instance of EmptyServiceContext.
+     */
+    public EmptyServiceContext()
+    {
+        super();
+    }
+    
+    /**
+     * @see Object#toString()
+     */
+    public String toString()
+    {
+        return "EmptyServiceContext";
+    }
+}

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=528797&r1=528796&r2=528797
==============================================================================
--- 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 05:22:32 2007
@@ -631,9 +631,9 @@
 
 
     /**
-     * @see PartitionNexus#listSuffixes()
+     * @see PartitionNexus#listSuffixes( ServiceContext )
      */
-    public Iterator listSuffixes () throws NamingException
+    public Iterator listSuffixes ( ServiceContext emptyContext ) throws NamingException
     {
         return Collections.unmodifiableSet( partitions.keySet() ).iterator();
     }

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=528797&r1=528796&r2=528797
==============================================================================
--- 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 05:22:32 2007
@@ -252,7 +252,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( ServiceContext emptyContext ) 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=528797&r1=528796&r2=528797
==============================================================================
--- 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 05:22:32 2007
@@ -255,13 +255,13 @@
     }
 
 
-    public Iterator listSuffixes () throws NamingException
+    public Iterator listSuffixes( ServiceContext emptyContext ) throws NamingException
     {
-        return listSuffixes( null );
+        return listSuffixes( emptyContext );
     }
 
 
-    public Iterator listSuffixes( Collection bypass ) throws NamingException
+    public Iterator listSuffixes( ServiceContext emptyContext, Collection bypass ) throws
NamingException
     {
         ensureStarted();
         InvocationStack stack = InvocationStack.getInstance();
@@ -269,7 +269,7 @@
         stack.push( new Invocation( this, caller, "listSuffixes", args, bypass ) );
         try
         {
-            return this.configuration.getInterceptorChain().listSuffixes();
+            return this.configuration.getInterceptorChain().listSuffixes( emptyContext );
         }
         finally
         {

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/referral/ReferralService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/referral/ReferralService.java?view=diff&rev=528797&r1=528796&r2=528797
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/referral/ReferralService.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/referral/ReferralService.java
Sat Apr 14 05:22:32 2007
@@ -176,7 +176,8 @@
         oidRegistry = dsConfig.getRegistries().getOidRegistry();
         env = dsConfig.getEnvironment();
 
-        Iterator suffixes = nexus.listSuffixes();
+        Iterator suffixes = nexus.listSuffixes( null );
+        
         while ( suffixes.hasNext() )
         {
             LdapDN suffix = new LdapDN( ( String ) suffixes.next() );

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/subtree/SubentryService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/subtree/SubentryService.java?view=diff&rev=528797&r1=528796&r2=528797
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/subtree/SubentryService.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/subtree/SubentryService.java
Sat Apr 14 05:22:32 2007
@@ -145,7 +145,7 @@
         evaluator = new SubtreeEvaluator( factoryCfg.getRegistries().getOidRegistry(), factoryCfg.getRegistries().getAttributeTypeRegistry()
);
 
         // prepare to find all subentries in all namingContexts
-        Iterator suffixes = this.nexus.listSuffixes();
+        Iterator suffixes = this.nexus.listSuffixes( null );
         ExprNode filter = new SimpleNode( SchemaConstants.OBJECT_CLASS_AT, SchemaConstants.SUBENTRY_OC,
AssertionEnum.EQUALITY );
         SearchControls controls = new SearchControls();
         controls.setSearchScope( SearchControls.SUBTREE_SCOPE );

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/TriggerSpecCache.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/TriggerSpecCache.java?view=diff&rev=528797&r1=528796&r2=528797
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/TriggerSpecCache.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/TriggerSpecCache.java
Sat Apr 14 05:22:32 2007
@@ -112,7 +112,8 @@
         // search all naming contexts for trigger subentenries
         // generate TriggerSpecification arrays for each subentry
         // add that subentry to the hash
-        Iterator suffixes = nexus.listSuffixes();
+        Iterator suffixes = nexus.listSuffixes( null );
+        
         while ( suffixes.hasNext() )
         {
             String suffix = ( String ) suffixes.next();
@@ -121,11 +122,13 @@
             SearchControls ctls = new SearchControls();
             ctls.setSearchScope( SearchControls.SUBTREE_SCOPE );
             NamingEnumeration results = nexus.search( baseDn, env, filter, ctls );
+            
             while ( results.hasMore() )
             {
                 SearchResult result = ( SearchResult ) results.next();
                 String subentryDn = result.getName();
                 Attribute triggerSpec = result.getAttributes().get( PRESCRIPTIVE_TRIGGER_ATTR
);
+                
                 if ( triggerSpec == null )
                 {
                     log.warn( "Found triggerExecutionSubentry '" + subentryDn + "' without
any " + PRESCRIPTIVE_TRIGGER_ATTR );
@@ -136,6 +139,7 @@
                 normSubentryName.normalize( attrRegistry.getNormalizerMapping() );
                 subentryAdded( normSubentryName, result.getAttributes() );
             }
+            
             results.close();
         }
     }

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=528797&r1=528796&r2=528797
==============================================================================
--- 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 05:22:32 2007
@@ -310,10 +310,10 @@
         }
 
 
-        public Iterator listSuffixes ( NextInterceptor next ) throws NamingException
+        public Iterator listSuffixes ( NextInterceptor next, ServiceContext emptyContext
) throws NamingException
         {
             interceptors.add( this );
-            return next.listSuffixes();
+            return next.listSuffixes( emptyContext );
         }
 
 



Mime
View raw message