directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seelm...@apache.org
Subject svn commit: r937714 - in /directory/apacheds/trunk: core-api/src/main/java/org/apache/directory/server/core/event/ core/src/main/java/org/apache/directory/server/core/authz/support/ core/src/main/java/org/apache/directory/server/core/event/ core/src/ma...
Date Sat, 24 Apr 2010 22:47:24 GMT
Author: seelmann
Date: Sat Apr 24 22:47:24 2010
New Revision: 937714

URL: http://svn.apache.org/viewvc?rev=937714&view=rev
Log:
Changed Evaluator.evaluate() parameter from String to DN

Modified:
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/event/Evaluator.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/RelatedProtectedItemFilter.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/event/EventInterceptor.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/event/ExpressionEvaluator.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/event/LeafEvaluator.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/event/ScopeEvaluator.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/event/SubstringEvaluator.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/subtree/SubtreeEvaluator.java

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/event/Evaluator.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/event/Evaluator.java?rev=937714&r1=937713&r2=937714&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/event/Evaluator.java
(original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/event/Evaluator.java
Sat Apr 24 22:47:24 2010
@@ -23,6 +23,7 @@ package org.apache.directory.server.core
 import org.apache.directory.shared.ldap.entry.ServerEntry;
 import org.apache.directory.shared.ldap.exception.LdapException;
 import org.apache.directory.shared.ldap.filter.ExprNode;
+import org.apache.directory.shared.ldap.name.DN;
 
 
 /**
@@ -44,5 +45,5 @@ public interface Evaluator
      * @return true if the filter selects the candidate false otherwise
      * @throws LdapException if there is a database fault during evaluation
      */
-    boolean evaluate( ExprNode node, String dn, ServerEntry entry ) throws LdapException;
+    boolean evaluate( ExprNode node, DN dn, ServerEntry entry ) throws LdapException;
 }

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/RelatedProtectedItemFilter.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/RelatedProtectedItemFilter.java?rev=937714&r1=937713&r2=937714&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/RelatedProtectedItemFilter.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/RelatedProtectedItemFilter.java
Sat Apr 24 22:47:24 2010
@@ -232,7 +232,7 @@ public class RelatedProtectedItemFilter 
             {
                 ProtectedItem.RangeOfValues rov = ( ProtectedItem.RangeOfValues ) item;
                 
-                if ( entryEvaluator.evaluate( rov.getFilter(), entryName.getNormName(), entry
) )
+                if ( entryEvaluator.evaluate( rov.getFilter(), entryName, entry ) )
                 {
                     return true;
                 }

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/event/EventInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/event/EventInterceptor.java?rev=937714&r1=937713&r2=937714&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/event/EventInterceptor.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/event/EventInterceptor.java
Sat Apr 24 22:47:24 2010
@@ -303,7 +303,7 @@ public class EventInterceptor extends Ba
         {
             NotificationCriteria criteria = registration.getCriteria();
             
-            if ( evaluator.evaluate( criteria.getFilter(), criteria.getBase().getNormName(),
entry ) )
+            if ( evaluator.evaluate( criteria.getFilter(), criteria.getBase(), entry ) )
             {
                 selecting.add( registration );
             }

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/event/ExpressionEvaluator.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/event/ExpressionEvaluator.java?rev=937714&r1=937713&r2=937714&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/event/ExpressionEvaluator.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/event/ExpressionEvaluator.java
Sat Apr 24 22:47:24 2010
@@ -29,6 +29,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.filter.ExprNode;
 import org.apache.directory.shared.ldap.filter.NotNode;
 import org.apache.directory.shared.ldap.filter.OrNode;
+import org.apache.directory.shared.ldap.name.DN;
 import org.apache.directory.shared.ldap.schema.SchemaManager;
 import org.apache.directory.shared.ldap.schema.registries.OidRegistry;
 
@@ -95,7 +96,7 @@ public class ExpressionEvaluator impleme
     /**
      * @see Evaluator#evaluate(ExprNode, String, ServerEntry)
      */
-    public boolean evaluate( ExprNode node, String dn, ServerEntry entry ) throws LdapException
+    public boolean evaluate( ExprNode node, DN dn, ServerEntry entry ) throws LdapException
     {
         if ( node.isLeaf() )
         {

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/event/LeafEvaluator.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/event/LeafEvaluator.java?rev=937714&r1=937713&r2=937714&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/event/LeafEvaluator.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/event/LeafEvaluator.java
Sat Apr 24 22:47:24 2010
@@ -40,6 +40,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.filter.ScopeNode;
 import org.apache.directory.shared.ldap.filter.SimpleNode;
 import org.apache.directory.shared.ldap.filter.SubstringNode;
+import org.apache.directory.shared.ldap.name.DN;
 import org.apache.directory.shared.ldap.schema.AttributeType;
 import org.apache.directory.shared.ldap.schema.LdapComparator;
 import org.apache.directory.shared.ldap.schema.MatchingRule;
@@ -107,7 +108,7 @@ public class LeafEvaluator implements Ev
     /**
      * @see Evaluator#evaluate(ExprNode, String, ServerEntry)
      */
-    public boolean evaluate( ExprNode node, String dn, ServerEntry entry ) throws LdapException
+    public boolean evaluate( ExprNode node, DN dn, ServerEntry entry ) throws LdapException
     {
         if ( node instanceof ScopeNode )
         {

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/event/ScopeEvaluator.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/event/ScopeEvaluator.java?rev=937714&r1=937713&r2=937714&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/event/ScopeEvaluator.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/event/ScopeEvaluator.java
Sat Apr 24 22:47:24 2010
@@ -45,7 +45,7 @@ public class ScopeEvaluator implements E
     /**
      * @see Evaluator#evaluate(ExprNode , String, ServerEntry)
      */
-    public boolean evaluate( ExprNode node, String dn, ServerEntry record ) throws LdapException
+    public boolean evaluate( ExprNode node, DN dn, ServerEntry record ) throws LdapException
     {
         ScopeNode snode = ( ScopeNode ) node;
 
@@ -55,15 +55,13 @@ public class ScopeEvaluator implements E
                 return dn.equals( snode.getBaseDn() );
             
             case ONELEVEL:
-                if ( dn.endsWith( snode.getBaseDn().getNormName() ) )
+                if ( dn.isChildOf( snode.getBaseDn() ) )
                 {
-                    DN candidateDn = new DN( dn );
-                    DN scopeDn = new DN( snode.getBaseDn() );
-                    return ( scopeDn.size() + 1 ) == candidateDn.size();
+                    return ( snode.getBaseDn().size() + 1 ) == dn.size();
                 }
             
             case SUBTREE:
-                return dn.endsWith( snode.getBaseDn().getNormName() );
+                return dn.isChildOf( snode.getBaseDn() );
             
             default:
                 throw new LdapInvalidSearchFilterException( I18n.err( I18n.ERR_247 ) );

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/event/SubstringEvaluator.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/event/SubstringEvaluator.java?rev=937714&r1=937713&r2=937714&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/event/SubstringEvaluator.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/event/SubstringEvaluator.java
Sat Apr 24 22:47:24 2010
@@ -31,6 +31,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.exception.LdapInvalidSearchFilterException;
 import org.apache.directory.shared.ldap.filter.ExprNode;
 import org.apache.directory.shared.ldap.filter.SubstringNode;
+import org.apache.directory.shared.ldap.name.DN;
 import org.apache.directory.shared.ldap.schema.AttributeType;
 import org.apache.directory.shared.ldap.schema.MatchingRule;
 import org.apache.directory.shared.ldap.schema.Normalizer;
@@ -64,7 +65,7 @@ public class SubstringEvaluator implemen
     /**
      * @see Evaluator#evaluate( ExprNode, String, ServerEntry )
      */
-    public boolean evaluate( ExprNode node, String dn, ServerEntry entry ) throws LdapException
+    public boolean evaluate( ExprNode node, DN dn, ServerEntry entry ) throws LdapException
     {
         Pattern regex = null;
         SubstringNode snode = (SubstringNode)node;

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/subtree/SubtreeEvaluator.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/subtree/SubtreeEvaluator.java?rev=937714&r1=937713&r2=937714&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/subtree/SubtreeEvaluator.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/subtree/SubtreeEvaluator.java
Sat Apr 24 22:47:24 2010
@@ -192,7 +192,7 @@ public class SubtreeEvaluator
          */
         if ( subtree.getRefinement() != null )
         {
-            return evaluator.evaluate( subtree.getRefinement(), dnEntryDn.getNormName(),
entry );
+            return evaluator.evaluate( subtree.getRefinement(), dnEntryDn, entry );
         }
 
         /*



Mime
View raw message