directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r109487 - in incubator/directory/eve/trunk/jndi-provider/src/java/org/apache/eve: db jndi
Date Thu, 02 Dec 2004 09:55:45 GMT
Author: akarasulu
Date: Thu Dec  2 01:55:44 2004
New Revision: 109487

URL: http://svn.apache.org/viewcvs?view=rev&rev=109487
Log:
Changes ...

 o adjusted for new SubstringNode function changes where regex generation 
   requires the substring matching rule's normalizer to build
 o changes now required the attributeTypeRegistry in certain places

Notes ...

 o might want to remove OID checks which happen automatically using oid registry


Modified:
   incubator/directory/eve/trunk/jndi-provider/src/java/org/apache/eve/db/ExpressionEnumerator.java
   incubator/directory/eve/trunk/jndi-provider/src/java/org/apache/eve/db/SubstringEnumerator.java
   incubator/directory/eve/trunk/jndi-provider/src/java/org/apache/eve/db/SubstringEvaluator.java
   incubator/directory/eve/trunk/jndi-provider/src/java/org/apache/eve/jndi/EveContextFactory.java

Modified: incubator/directory/eve/trunk/jndi-provider/src/java/org/apache/eve/db/ExpressionEnumerator.java
Url: http://svn.apache.org/viewcvs/incubator/directory/eve/trunk/jndi-provider/src/java/org/apache/eve/db/ExpressionEnumerator.java?view=diff&rev=109487&p1=incubator/directory/eve/trunk/jndi-provider/src/java/org/apache/eve/db/ExpressionEnumerator.java&r1=109486&p2=incubator/directory/eve/trunk/jndi-provider/src/java/org/apache/eve/db/ExpressionEnumerator.java&r2=109487
==============================================================================
--- incubator/directory/eve/trunk/jndi-provider/src/java/org/apache/eve/db/ExpressionEnumerator.java
(original)
+++ incubator/directory/eve/trunk/jndi-provider/src/java/org/apache/eve/db/ExpressionEnumerator.java
Thu Dec  2 01:55:44 2004
@@ -29,6 +29,7 @@
 import org.apache.ldap.common.filter.AssertionNode;
 import org.apache.ldap.common.filter.SubstringNode;
 import org.apache.ldap.common.NotImplementedException;
+import org.apache.eve.schema.AttributeTypeRegistry;
 
 import java.util.ArrayList;
 import java.math.BigInteger;
@@ -58,14 +59,17 @@
      * @param db database used by this enumerator
      * @param evaluator
      */
-    public ExpressionEnumerator( Database db, ExpressionEvaluator evaluator )
+    public ExpressionEnumerator( Database db,
+                                 AttributeTypeRegistry attributeTypeRegistry,
+                                 ExpressionEvaluator evaluator )
     {
         this.db = db;
         this.evaluator = evaluator;
 
         LeafEvaluator leafEvaluator = evaluator.getLeafEvaluator();
         scopeEnumerator = new ScopeEnumerator( db, leafEvaluator.getScopeEvaluator() );
-        substringEnumerator = new SubstringEnumerator( db, leafEvaluator.getSubstringEvaluator()
);
+        substringEnumerator = new SubstringEnumerator( db, attributeTypeRegistry,
+                leafEvaluator.getSubstringEvaluator() );
     }
 
 

Modified: incubator/directory/eve/trunk/jndi-provider/src/java/org/apache/eve/db/SubstringEnumerator.java
Url: http://svn.apache.org/viewcvs/incubator/directory/eve/trunk/jndi-provider/src/java/org/apache/eve/db/SubstringEnumerator.java?view=diff&rev=109487&p1=incubator/directory/eve/trunk/jndi-provider/src/java/org/apache/eve/db/SubstringEnumerator.java&r1=109486&p2=incubator/directory/eve/trunk/jndi-provider/src/java/org/apache/eve/db/SubstringEnumerator.java&r2=109487
==============================================================================
--- incubator/directory/eve/trunk/jndi-provider/src/java/org/apache/eve/db/SubstringEnumerator.java
(original)
+++ incubator/directory/eve/trunk/jndi-provider/src/java/org/apache/eve/db/SubstringEnumerator.java
Thu Dec  2 01:55:44 2004
@@ -223,6 +223,9 @@
 
 import org.apache.ldap.common.filter.ExprNode;
 import org.apache.ldap.common.filter.SubstringNode;
+import org.apache.ldap.common.schema.Normalizer;
+import org.apache.ldap.common.schema.AttributeType;
+import org.apache.eve.schema.AttributeTypeRegistry;
 
 
 /**
@@ -235,9 +238,11 @@
 public class SubstringEnumerator implements Enumerator
 {
     /** Database used */
-    private Database db = null;
+    private final Database db;
     /** Evaluator used is an Avalon dependent object */
-    private SubstringEvaluator evaluator = null;
+    private final SubstringEvaluator evaluator;
+    /** the attribute type registry */
+    private final AttributeTypeRegistry attributeTypeRegistry;
 
 
     /**
@@ -246,10 +251,13 @@
      * @param db the database
      * @param evaluator a substring evaluator
      */
-    public SubstringEnumerator( Database db, SubstringEvaluator evaluator )
+    public SubstringEnumerator( Database db,
+                                AttributeTypeRegistry attributeTypeRegistry,
+                                SubstringEvaluator evaluator )
     {
         this.db = db;
         this.evaluator = evaluator;
+        this.attributeTypeRegistry = attributeTypeRegistry;
     }
 
 
@@ -268,7 +276,9 @@
         RE regex = null;
         Index idx = null;
         final SubstringNode snode = ( SubstringNode ) node;
-    
+        AttributeType type = attributeTypeRegistry.lookup( snode.getAttribute() );
+        Normalizer normalizer = type.getSubstr().getNormalizer();
+
         if ( db.hasUserIndexOn( snode.getAttribute() ) )
         {
             /*
@@ -277,7 +287,7 @@
              */
             try 
             {
-                regex = snode.getRegex();
+                regex = snode.getRegex( normalizer );
             } 
             catch ( RESyntaxException e ) 
             {

Modified: incubator/directory/eve/trunk/jndi-provider/src/java/org/apache/eve/db/SubstringEvaluator.java
Url: http://svn.apache.org/viewcvs/incubator/directory/eve/trunk/jndi-provider/src/java/org/apache/eve/db/SubstringEvaluator.java?view=diff&rev=109487&p1=incubator/directory/eve/trunk/jndi-provider/src/java/org/apache/eve/db/SubstringEvaluator.java&r1=109486&p2=incubator/directory/eve/trunk/jndi-provider/src/java/org/apache/eve/db/SubstringEvaluator.java&r2=109487
==============================================================================
--- incubator/directory/eve/trunk/jndi-provider/src/java/org/apache/eve/db/SubstringEvaluator.java
(original)
+++ incubator/directory/eve/trunk/jndi-provider/src/java/org/apache/eve/db/SubstringEvaluator.java
Thu Dec  2 01:55:44 2004
@@ -74,6 +74,9 @@
     {
         RE regex = null; 
         SubstringNode snode = ( SubstringNode ) node;
+        String oid = oidRegistry.getOid( snode.getAttribute() );
+        AttributeType type = attributeTypeRegistry.lookup( oid );
+        Normalizer normalizer = type.getSubstr().getNormalizer();
 
         if ( db.hasUserIndexOn( snode.getAttribute() ) )
         {
@@ -91,7 +94,7 @@
             // compile the regular expression to search for a matching attribute
             try 
             {
-                regex = snode.getRegex();
+                regex = snode.getRegex( normalizer );
             } 
             catch ( RESyntaxException e ) 
             {
@@ -122,10 +125,6 @@
         // Index not defined beyond this point
         // --------------------------------------------------------------------
         
-        String oid = oidRegistry.getOid( snode.getAttribute() );
-        AttributeType type = attributeTypeRegistry.lookup( oid );
-        Normalizer normalizer = type.getSubstr().getNormalizer();
-
         // resusitate the entry if it has not been and set entry in IndexRecord
         if ( null == record.getAttributes() )
         {
@@ -145,7 +144,7 @@
         // compile the regular expression to search for a matching attribute
         try 
         {
-            regex = snode.getRegex();
+            regex = snode.getRegex( normalizer );
         } 
         catch ( RESyntaxException e ) 
         {

Modified: incubator/directory/eve/trunk/jndi-provider/src/java/org/apache/eve/jndi/EveContextFactory.java
Url: http://svn.apache.org/viewcvs/incubator/directory/eve/trunk/jndi-provider/src/java/org/apache/eve/jndi/EveContextFactory.java?view=diff&rev=109487&p1=incubator/directory/eve/trunk/jndi-provider/src/java/org/apache/eve/jndi/EveContextFactory.java&r1=109486&p2=incubator/directory/eve/trunk/jndi-provider/src/java/org/apache/eve/jndi/EveContextFactory.java&r2=109487
==============================================================================
--- incubator/directory/eve/trunk/jndi-provider/src/java/org/apache/eve/jndi/EveContextFactory.java
(original)
+++ incubator/directory/eve/trunk/jndi-provider/src/java/org/apache/eve/jndi/EveContextFactory.java
Thu Dec  2 01:55:44 2004
@@ -397,7 +397,7 @@
         evaluator = new ExpressionEvaluator( db, oidRegistry, attributeTypeRegistry );
 
         ExpressionEnumerator enumerator;
-        enumerator = new ExpressionEnumerator( db, evaluator );
+        enumerator = new ExpressionEnumerator( db, attributeTypeRegistry, evaluator );
 
         SearchEngine eng = new DefaultSearchEngine( db, evaluator, enumerator );
 
@@ -581,7 +581,7 @@
             ExpressionEvaluator evaluator;
             evaluator = new ExpressionEvaluator( db, oidRegistry, attributeTypeRegistry );
             ExpressionEnumerator enumerator;
-            enumerator = new ExpressionEnumerator( db, evaluator );
+            enumerator = new ExpressionEnumerator( db, attributeTypeRegistry, evaluator );
             SearchEngine eng = new DefaultSearchEngine( db, evaluator, enumerator );
 
             // ----------------------------------------------------------------

Mime
View raw message