directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1135617 - in /directory/apacheds/trunk: core-api/src/main/java/org/apache/directory/server/core/filtering/ core/src/main/java/org/apache/directory/server/core/authz/ core/src/main/java/org/apache/directory/server/core/collective/ core/src/...
Date Tue, 14 Jun 2011 14:48:21 GMT
Author: elecharny
Date: Tue Jun 14 14:48:20 2011
New Revision: 1135617

URL: http://svn.apache.org/viewvc?rev=1135617&view=rev
Log:
Some more cleanup : used Entry instead of ClonedServerEntry

Modified:
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/filtering/EntryFilter.java
    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
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java
    directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/SearchLimitsIT.java

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/filtering/EntryFilter.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/filtering/EntryFilter.java?rev=1135617&r1=1135616&r2=1135617&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/filtering/EntryFilter.java
(original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/filtering/EntryFilter.java
Tue Jun 14 14:48:20 2011
@@ -20,8 +20,8 @@
 package org.apache.directory.server.core.filtering;
 
 
-import org.apache.directory.server.core.entry.ClonedServerEntry;
 import org.apache.directory.server.core.interceptor.context.SearchingOperationContext;
+import org.apache.directory.shared.ldap.model.entry.Entry;
 
 
 /**
@@ -47,5 +47,5 @@ public interface EntryFilter
      * @return true if the entry is to be returned, false if it is rejected
      * @throws Exception if there are failures during evaluation
      */
-    boolean accept( SearchingOperationContext operation, ClonedServerEntry result ) throws
Exception;
+    boolean accept( SearchingOperationContext operation, Entry result ) throws Exception;
 }

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=1135617&r1=1135616&r2=1135617&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:48:20 2011
@@ -1410,12 +1410,13 @@ public class AciAuthorizationInterceptor
     /**
      * WARNING: create one of these filters fresh every time for each new search.
      */
-    class AuthorizationFilter implements EntryFilter
+    private class AuthorizationFilter implements EntryFilter
     {
-        public boolean accept( SearchingOperationContext searchContext, ClonedServerEntry
entry ) throws Exception
+        public boolean accept( SearchingOperationContext searchContext, Entry entry ) throws
Exception
         {
             Dn normName = entry.getDn().apply( schemaManager );
-            return filter( searchContext, normName, entry );
+            
+            return filter( searchContext, normName, (ClonedServerEntry)entry );
         }
     }
 }

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=1135617&r1=1135616&r2=1135617&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:48:20 2011
@@ -30,7 +30,6 @@ import org.apache.directory.server.core.
 import org.apache.directory.server.core.DefaultCoreSession;
 import org.apache.directory.server.core.DirectoryService;
 import org.apache.directory.server.core.LdapPrincipal;
-import org.apache.directory.server.core.entry.ClonedServerEntry;
 import org.apache.directory.server.core.filtering.EntryFilter;
 import org.apache.directory.server.core.filtering.EntryFilteringCursor;
 import org.apache.directory.server.core.interceptor.BaseInterceptor;
@@ -89,9 +88,9 @@ public class DefaultAuthorizationInterce
     /**
      * the search result filter to use for collective attribute injection
      */
-    class DefaultAuthorizationSearchFilter implements EntryFilter
+    private class DefaultAuthorizationSearchFilter implements EntryFilter
     {
-        public boolean accept( SearchingOperationContext operation, ClonedServerEntry entry
) throws Exception
+        public boolean accept( SearchingOperationContext operation, Entry entry ) throws
Exception
         {
             return DefaultAuthorizationInterceptor.this.isSearchable( operation, entry );
         }
@@ -483,10 +482,10 @@ public class DefaultAuthorizationInterce
 
     // False positive, we want to keep the comment
     @SuppressWarnings("PMD.CollapsibleIfStatements")
-    private boolean isSearchable( OperationContext opContext, ClonedServerEntry result )
throws Exception
+    private boolean isSearchable( OperationContext opContext, Entry entry ) throws Exception
     {
         Dn principalDn = opContext.getSession().getEffectivePrincipal().getDn();
-        Dn dn = result.getDn();
+        Dn dn = entry.getDn();
 
         if ( !dn.isSchemaAware() )
         {

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=1135617&r1=1135616&r2=1135617&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:48:20 2011
@@ -74,12 +74,12 @@ public class CollectiveAttributeIntercep
     /**
      * the search result filter to use for collective attribute injection
      */
-    class CollectiveAttributeFilter implements EntryFilter
+    private class CollectiveAttributeFilter implements EntryFilter
     {
-        public boolean accept( SearchingOperationContext operation, ClonedServerEntry result
) throws Exception
+        public boolean accept( SearchingOperationContext operation, Entry entry ) throws
Exception
         {
             String[] retAttrs = operation.getSearchControls().getReturningAttributes();
-            addCollectiveAttributes( operation, result, retAttrs );
+            addCollectiveAttributes( operation, entry, retAttrs );
             
             return true;
         }

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=1135617&r1=1135616&r2=1135617&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:48:20 2011
@@ -83,9 +83,9 @@ public class OperationalAttributeInterce
     /**
      * the search result filter to use for collective attribute injection
      */
-    class OperationalAttributeDenormalizingSearchFilter implements EntryFilter
+    private class OperationalAttributeDenormalizingSearchFilter implements EntryFilter
     {
-        public boolean accept( SearchingOperationContext operation, ClonedServerEntry entry
) throws Exception
+        public boolean accept( SearchingOperationContext operation, Entry entry ) throws
Exception
         {
             if ( operation.getSearchControls().getReturningAttributes() == null )
             {
@@ -101,9 +101,9 @@ public class OperationalAttributeInterce
     /**
      * the database search result filter to register with filter service
      */
-    class OperationalAttributeSearchFilter implements EntryFilter
+    private class OperationalAttributeSearchFilter implements EntryFilter
     {
-        public boolean accept( SearchingOperationContext operation, ClonedServerEntry entry
) throws Exception
+        public boolean accept( SearchingOperationContext operation, Entry entry ) throws
Exception
         {
             return operation.getSearchControls().getReturningAttributes() != null
             || filterOperationalAttributes( entry );

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java?rev=1135617&r1=1135616&r2=1135617&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java
Tue Jun 14 14:48:20 2011
@@ -34,7 +34,6 @@ import javax.naming.directory.SearchCont
 
 import org.apache.directory.server.constants.ServerDNConstants;
 import org.apache.directory.server.core.DirectoryService;
-import org.apache.directory.server.core.entry.ClonedServerEntry;
 import org.apache.directory.server.core.filtering.BaseEntryFilteringCursor;
 import org.apache.directory.server.core.filtering.EntryFilter;
 import org.apache.directory.server.core.filtering.EntryFilteringCursor;
@@ -1246,7 +1245,7 @@ public class SchemaInterceptor extends B
      */
     // This will suppress PMD.EmptyCatchBlock warnings in this method
     @SuppressWarnings("PMD.EmptyCatchBlock")
-    private void filterAttributeTypes( SearchingOperationContext operation, ClonedServerEntry
result )
+    private void filterAttributeTypes( SearchingOperationContext operation, Entry result
)
     {
         if ( operation.getReturningAttributes() == null )
         {
@@ -1324,9 +1323,10 @@ public class SchemaInterceptor extends B
      */
     private class BinaryAttributeFilter implements EntryFilter
     {
-        public boolean accept( SearchingOperationContext operation, ClonedServerEntry result
) throws Exception
+        public boolean accept( SearchingOperationContext operation, Entry entry ) throws
Exception
         {
-            filterBinaryAttributes( result );
+            filterBinaryAttributes( entry );
+            
             return true;
         }
     }
@@ -1337,9 +1337,10 @@ public class SchemaInterceptor extends B
      */
     private class TopFilter implements EntryFilter
     {
-        public boolean accept( SearchingOperationContext operation, ClonedServerEntry result
) throws Exception
+        public boolean accept( SearchingOperationContext operation, Entry entry ) throws
Exception
         {
-            filterAttributeTypes( operation, result );
+            filterAttributeTypes( operation, entry );
+            
             return true;
         }
     }

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java?rev=1135617&r1=1135616&r2=1135617&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java
Tue Jun 14 14:48:20 2011
@@ -130,9 +130,9 @@ public class SubentryInterceptor extends
     /**
      * SearchResultFilter used to filter out subentries based on objectClass values.
      */
-    public class HideSubentriesFilter implements EntryFilter
+    private class HideSubentriesFilter implements EntryFilter
     {
-        public boolean accept( SearchingOperationContext searchContext, ClonedServerEntry
entry ) throws Exception
+        public boolean accept( SearchingOperationContext searchContext, Entry entry ) throws
Exception
         {
             // See if the requested entry is a subentry
             if ( subentryCache.hasSubentry( entry.getDn() ) )
@@ -150,9 +150,9 @@ public class SubentryInterceptor extends
      * SearchResultFilter used to filter out normal entries but shows subentries based on
      * objectClass values.
      */
-    public class HideEntriesFilter implements EntryFilter
+    private class HideEntriesFilter implements EntryFilter
     {
-        public boolean accept( SearchingOperationContext searchContext, ClonedServerEntry
entry ) throws Exception
+        public boolean accept( SearchingOperationContext searchContext, Entry entry ) throws
Exception
         {
             // See if the requested entry is a subentry
             if ( subentryCache.hasSubentry( entry.getDn() ) )

Modified: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/SearchLimitsIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/SearchLimitsIT.java?rev=1135617&r1=1135616&r2=1135617&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/SearchLimitsIT.java
(original)
+++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/SearchLimitsIT.java
Tue Jun 14 14:48:20 2011
@@ -38,7 +38,6 @@ import javax.naming.directory.SearchResu
 import org.apache.directory.server.annotations.CreateLdapServer;
 import org.apache.directory.server.annotations.CreateTransport;
 import org.apache.directory.server.core.annotations.ApplyLdifs;
-import org.apache.directory.server.core.entry.ClonedServerEntry;
 import org.apache.directory.server.core.filtering.EntryFilter;
 import org.apache.directory.server.core.filtering.EntryFilteringCursor;
 import org.apache.directory.server.core.integ.AbstractLdapTestUnit;
@@ -49,6 +48,7 @@ import org.apache.directory.server.core.
 import org.apache.directory.server.core.interceptor.context.SearchOperationContext;
 import org.apache.directory.server.core.interceptor.context.SearchingOperationContext;
 import org.apache.directory.server.ldap.LdapServer;
+import org.apache.directory.shared.ldap.model.entry.Entry;
 import org.apache.directory.shared.ldap.model.exception.LdapException;
 import org.junit.After;
 import org.junit.Before;
@@ -138,7 +138,7 @@ public class SearchLimitsIT extends Abst
         {
             EntryFilteringCursor cursor = next.search( searchContext );
             cursor.addEntryFilter( new EntryFilter() {
-                public boolean accept( SearchingOperationContext operation, ClonedServerEntry
result ) throws Exception
+                public boolean accept( SearchingOperationContext operation, Entry result
) throws Exception
                 {
                     if ( delayMillis != null )
                     {



Mime
View raw message