directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1135601 - in /directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core: authz/ collective/ operational/
Date Tue, 14 Jun 2011 14:24:53 GMT
Author: elecharny
Date: Tue Jun 14 14:24:52 2011
New Revision: 1135601

URL: http://svn.apache.org/viewvc?rev=1135601&view=rev
Log:
o Added classes declaration for the search filters instead of anonymous classes, for clarity

Modified:
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationInterceptor.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributeInterceptor.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java?rev=1135601&r1=1135600&r2=1135601&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java
Tue Jun 14 14:24:52 2011
@@ -1406,6 +1406,7 @@ public class AciAuthorizationInterceptor
         return true;
     }
 
+    
     /**
      * WARNING: create one of these filters fresh every time for each new search.
      */

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationInterceptor.java?rev=1135601&r1=1135600&r2=1135601&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationInterceptor.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationInterceptor.java
Tue Jun 14 14:24:52 2011
@@ -50,8 +50,8 @@ import org.apache.directory.server.core.
 import org.apache.directory.server.core.partition.PartitionNexus;
 import org.apache.directory.server.i18n.I18n;
 import org.apache.directory.shared.ldap.model.constants.AuthenticationLevel;
-import org.apache.directory.shared.ldap.model.entry.Entry;
 import org.apache.directory.shared.ldap.model.entry.Attribute;
+import org.apache.directory.shared.ldap.model.entry.Entry;
 import org.apache.directory.shared.ldap.model.entry.Value;
 import org.apache.directory.shared.ldap.model.exception.LdapException;
 import org.apache.directory.shared.ldap.model.exception.LdapNoPermissionException;
@@ -87,6 +87,18 @@ public class DefaultAuthorizationInterce
     private PartitionNexus nexus;
 
     /**
+     * the search result filter to use for collective attribute injection
+     */
+    class DefaultAuthorizationSearchFilter implements EntryFilter
+    {
+        public boolean accept( SearchingOperationContext operation, ClonedServerEntry entry
) throws Exception
+        {
+            return DefaultAuthorizationInterceptor.this.isSearchable( operation, entry );
+        }
+    }
+
+    
+    /**
      * Creates a new instance.
      */
     public DefaultAuthorizationInterceptor()
@@ -448,13 +460,8 @@ public class DefaultAuthorizationInterce
             return cursor;
         }
 
-        cursor.addEntryFilter( new EntryFilter()
-        {
-            public boolean accept( SearchingOperationContext operation, ClonedServerEntry
result ) throws Exception
-            {
-                return DefaultAuthorizationInterceptor.this.isSearchable( operation, result
);
-            }
-        } );
+        cursor.addEntryFilter( new DefaultAuthorizationSearchFilter() );
+
         return cursor;
     }
 
@@ -469,13 +476,7 @@ public class DefaultAuthorizationInterce
             return cursor;
         }
 
-        cursor.addEntryFilter( new EntryFilter()
-        {
-            public boolean accept( SearchingOperationContext operation, ClonedServerEntry
entry ) throws Exception
-            {
-                return DefaultAuthorizationInterceptor.this.isSearchable( operation, entry
);
-            }
-        } );
+        cursor.addEntryFilter( new DefaultAuthorizationSearchFilter() );
         return cursor;
     }
 

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributeInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributeInterceptor.java?rev=1135601&r1=1135600&r2=1135601&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributeInterceptor.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributeInterceptor.java
Tue Jun 14 14:24:52 2011
@@ -74,7 +74,7 @@ public class CollectiveAttributeIntercep
     /**
      * the search result filter to use for collective attribute injection
      */
-    private final EntryFilter SEARCH_FILTER = new EntryFilter()
+    class CollectiveAttributeFilter implements EntryFilter
     {
         public boolean accept( SearchingOperationContext operation, ClonedServerEntry result
) throws Exception
         {
@@ -83,7 +83,12 @@ public class CollectiveAttributeIntercep
             
             return true;
         }
-    };
+    }
+    
+    /** The CollectiveAttribute search filter */
+    private final EntryFilter SEARCH_FILTER = new CollectiveAttributeFilter();
+
+    
     //-------------------------------------------------------------------------------------
     // Initialization
     //-------------------------------------------------------------------------------------

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java?rev=1135601&r1=1135600&r2=1135601&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java
Tue Jun 14 14:24:52 2011
@@ -46,10 +46,10 @@ import org.apache.directory.server.core.
 import org.apache.directory.server.core.interceptor.context.SearchingOperationContext;
 import org.apache.directory.server.i18n.I18n;
 import org.apache.directory.shared.ldap.model.constants.SchemaConstants;
+import org.apache.directory.shared.ldap.model.entry.Attribute;
 import org.apache.directory.shared.ldap.model.entry.DefaultAttribute;
 import org.apache.directory.shared.ldap.model.entry.DefaultModification;
 import org.apache.directory.shared.ldap.model.entry.Entry;
-import org.apache.directory.shared.ldap.model.entry.Attribute;
 import org.apache.directory.shared.ldap.model.entry.Modification;
 import org.apache.directory.shared.ldap.model.entry.ModificationOperation;
 import org.apache.directory.shared.ldap.model.entry.Value;
@@ -80,30 +80,37 @@ public class OperationalAttributeInterce
     /** The LoggerFactory used by this Interceptor */
     private static Logger LOG = LoggerFactory.getLogger( OperationalAttributeInterceptor.class
);
 
-    private final EntryFilter DENORMALIZING_SEARCH_FILTER = new EntryFilter()
+    /**
+     * the search result filter to use for collective attribute injection
+     */
+    class OperationalAttributeDenormalizingSearchFilter implements EntryFilter
     {
-        public boolean accept( SearchingOperationContext operation, ClonedServerEntry serverEntry
) throws Exception
+        public boolean accept( SearchingOperationContext operation, ClonedServerEntry entry
) throws Exception
         {
             if ( operation.getSearchControls().getReturningAttributes() == null )
             {
                 return true;
             }
 
-            return filterDenormalized( serverEntry );
+            return filterDenormalized( entry );
         }
-    };
+    }
+
+    private final EntryFilter DENORMALIZING_SEARCH_FILTER = new OperationalAttributeDenormalizingSearchFilter();
 
     /**
      * the database search result filter to register with filter service
      */
-    private final EntryFilter SEARCH_FILTER = new EntryFilter()
+    class OperationalAttributeSearchFilter implements EntryFilter
     {
         public boolean accept( SearchingOperationContext operation, ClonedServerEntry entry
) throws Exception
         {
             return operation.getSearchControls().getReturningAttributes() != null
-                || filterOperationalAttributes( entry );
+            || filterOperationalAttributes( entry );
         }
-    };
+    }
+    
+    private final EntryFilter SEARCH_FILTER = new OperationalAttributeSearchFilter();
 
     /** The subschemasubentry Dn */
     private Dn subschemaSubentryDn;



Mime
View raw message