directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r487713 [1/2] - in /directory/trunks: apacheds/core/src/main/java/org/apache/directory/server/core/authz/ apacheds/core/src/main/java/org/apache/directory/server/core/event/ apacheds/core/src/main/java/org/apache/directory/server/core/jndi/...
Date Fri, 15 Dec 2006 23:25:46 GMT
Author: elecharny
Date: Fri Dec 15 15:25:43 2006
New Revision: 487713

URL: http://svn.apache.org/viewvc?view=rev&rev=487713
Log:
Created AssertionEnum and removed the int declaration in ExprNode for the replaced values. Modified the classes which were using those values

Modified:
    directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/authz/GroupCache.java
    directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/authz/TupleCache.java
    directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/event/EventService.java
    directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/event/ExpressionEvaluator.java
    directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/event/LeafEvaluator.java
    directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/jndi/ServerDirContext.java
    directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/normalization/ExpandingVisitor.java
    directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/normalization/NormalizationService.java
    directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/normalization/NormalizingVisitor.java
    directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/DefaultOptimizer.java
    directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/DefaultSearchEngine.java
    directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/ExpressionEnumerator.java
    directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/ExpressionEvaluator.java
    directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/LeafEvaluator.java
    directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/ASTNode.java
    directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/referral/ReferralService.java
    directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/schema/SchemaService.java
    directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/sp/LdapClassLoader.java
    directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/subtree/RefinementEvaluator.java
    directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/subtree/RefinementLeafEvaluator.java
    directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/subtree/SubentryService.java
    directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/trigger/TriggerSpecCache.java
    directory/trunks/apacheds/core/src/test/java/org/apache/directory/server/core/subtree/RefinementEvaluatorTest.java
    directory/trunks/apacheds/core/src/test/java/org/apache/directory/server/core/subtree/RefinementLeafEvaluatorTest.java
    directory/trunks/shared/ldap/src/main/antlr/ACIItem.g
    directory/trunks/shared/ldap/src/main/antlr/filter-parser.g
    directory/trunks/shared/ldap/src/main/antlr/subtree-specification.g
    directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/codec/TwixTransformer.java
    directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/filter/AbstractExprNode.java
    directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/filter/AssertionNode.java
    directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/filter/BranchNode.java
    directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/filter/BranchNormalizedVisitor.java
    directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/filter/ExprNode.java
    directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/filter/ExtensibleNode.java
    directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/filter/FilterVisitor.java
    directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/filter/LeafNode.java
    directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/filter/PresenceNode.java
    directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/filter/ScopeNode.java
    directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/filter/SimpleNode.java
    directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/filter/SubstringNode.java
    directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/filter/FilterParserImplTest.java
    directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/subtree/SubtreeSpecificationParserTest.java

Modified: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/authz/GroupCache.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/authz/GroupCache.java?view=diff&rev=487713&r1=487712&r2=487713
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/authz/GroupCache.java (original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/authz/GroupCache.java Fri Dec 15 15:25:43 2006
@@ -22,6 +22,7 @@
 
 import org.apache.directory.server.core.DirectoryServiceConfiguration;
 import org.apache.directory.server.core.partition.PartitionNexus;
+import org.apache.directory.shared.ldap.filter.AssertionEnum;
 import org.apache.directory.shared.ldap.filter.BranchNode;
 import org.apache.directory.shared.ldap.filter.SimpleNode;
 import org.apache.directory.shared.ldap.name.LdapDN;
@@ -106,9 +107,9 @@
         // search all naming contexts for static groups and generate
         // normalized sets of members to cache within the map
 
-        BranchNode filter = new BranchNode( BranchNode.OR );
-        filter.addNode( new SimpleNode( OC_ATTR, GROUPOFNAMES_OC, SimpleNode.EQUALITY ) );
-        filter.addNode( new SimpleNode( OC_ATTR, GROUPOFUNIQUENAMES_OC, SimpleNode.EQUALITY ) );
+        BranchNode filter = new BranchNode( AssertionEnum.OR );
+        filter.addNode( new SimpleNode( OC_ATTR, GROUPOFNAMES_OC, AssertionEnum.EQUALITY ) );
+        filter.addNode( new SimpleNode( OC_ATTR, GROUPOFUNIQUENAMES_OC, AssertionEnum.EQUALITY ) );
 
         Iterator suffixes = nexus.listSuffixes();
         while ( suffixes.hasNext() )

Modified: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/authz/TupleCache.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/authz/TupleCache.java?view=diff&rev=487713&r1=487712&r2=487713
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/authz/TupleCache.java (original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/authz/TupleCache.java Fri Dec 15 15:25:43 2006
@@ -40,6 +40,7 @@
 import org.apache.directory.shared.ldap.aci.ACIItem;
 import org.apache.directory.shared.ldap.aci.ACIItemParser;
 import org.apache.directory.shared.ldap.exception.LdapSchemaViolationException;
+import org.apache.directory.shared.ldap.filter.AssertionEnum;
 import org.apache.directory.shared.ldap.filter.ExprNode;
 import org.apache.directory.shared.ldap.filter.SimpleNode;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
@@ -119,7 +120,7 @@
         {
             String suffix = ( String ) suffixes.next();
             LdapDN baseDn = parseNormalized( suffix );
-            ExprNode filter = new SimpleNode( OC_ATTR, ACSUBENTRY_OC, SimpleNode.EQUALITY );
+            ExprNode filter = new SimpleNode( OC_ATTR, ACSUBENTRY_OC, AssertionEnum.EQUALITY );
             SearchControls ctls = new SearchControls();
             ctls.setSearchScope( SearchControls.SUBTREE_SCOPE );
             NamingEnumeration results = nexus.search( baseDn, env, filter, ctls );

Modified: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/event/EventService.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/event/EventService.java?view=diff&rev=487713&r1=487712&r2=487713
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/event/EventService.java (original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/event/EventService.java Fri Dec 15 15:25:43 2006
@@ -32,6 +32,7 @@
 import org.apache.directory.server.core.schema.AttributeTypeRegistry;
 import org.apache.directory.server.core.schema.ConcreteNameComponentNormalizer;
 import org.apache.directory.server.core.schema.OidRegistry;
+import org.apache.directory.shared.ldap.filter.AssertionEnum;
 import org.apache.directory.shared.ldap.filter.BranchNode;
 import org.apache.directory.shared.ldap.filter.ExprNode;
 import org.apache.directory.shared.ldap.filter.LeafNode;
@@ -137,7 +138,7 @@
             }
 
             // Now for AND & OR nodes with a single child left replace them with their child
-            if ( child.getChildren().size() == 1 && child.getOperator() != BranchNode.NOT )
+            if ( child.getChildren().size() == 1 && child.getOperator() != AssertionEnum.NOT )
             {
                 filter = child.getChild();
             }
@@ -149,7 +150,7 @@
         
         if ( filter != null )
         {
-            BranchNode and = new BranchNode( BranchNode.AND );
+            BranchNode and = new BranchNode( AssertionEnum.AND );
             and.addNode( scope );
             and.addNode( filter );
             filter = and;

Modified: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/event/ExpressionEvaluator.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/event/ExpressionEvaluator.java?view=diff&rev=487713&r1=487712&r2=487713
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/event/ExpressionEvaluator.java (original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/event/ExpressionEvaluator.java Fri Dec 15 15:25:43 2006
@@ -29,6 +29,8 @@
 import org.apache.directory.server.core.schema.OidRegistry;
 import org.apache.directory.shared.ldap.filter.BranchNode;
 import org.apache.directory.shared.ldap.filter.ExprNode;
+import org.apache.directory.shared.ldap.filter.AssertionEnum;
+
 
 
 /**
@@ -104,7 +106,7 @@
 
         switch ( bnode.getOperator() )
         {
-            case ( BranchNode.OR  ):
+            case OR :
                 Iterator children = bnode.getChildren().iterator();
 
                 while ( children.hasNext() )
@@ -118,7 +120,8 @@
                 }
 
                 return false;
-            case ( BranchNode.AND  ):
+                
+            case AND :
                 children = bnode.getChildren().iterator();
                 while ( children.hasNext() )
                 {
@@ -131,7 +134,8 @@
                 }
 
                 return true;
-            case ( BranchNode.NOT  ):
+                
+            case NOT :
                 if ( null != bnode.getChild() )
                 {
                     return !evaluate( bnode.getChild(), dn, entry );

Modified: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/event/LeafEvaluator.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/event/LeafEvaluator.java?view=diff&rev=487713&r1=487712&r2=487713
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/event/LeafEvaluator.java (original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/event/LeafEvaluator.java Fri Dec 15 15:25:43 2006
@@ -105,21 +105,28 @@
 
         switch ( ( ( LeafNode ) node ).getAssertionType() )
         {
-            case ( LeafNode.APPROXIMATE  ):
+            case APPROXIMATE :
                 return evalEquality( ( SimpleNode ) node, entry );
-            case ( LeafNode.EQUALITY  ):
+                
+            case EQUALITY :
                 return evalEquality( ( SimpleNode ) node, entry );
-            case ( LeafNode.EXTENSIBLE  ):
+                
+            case EXTENSIBLE :
                 throw new NotImplementedException();
-            case ( LeafNode.GREATEREQ  ):
+                
+            case GREATEREQ :
                 return evalGreater( ( SimpleNode ) node, entry, true );
-            case ( LeafNode.LESSEQ  ):
+                
+            case LESSEQ :
                 return evalGreater( ( SimpleNode ) node, entry, false );
-            case ( LeafNode.PRESENCE  ):
+                
+            case PRESENCE :
                 String attrId = ( ( PresenceNode ) node ).getAttribute();
                 return evalPresence( attrId, entry );
-            case ( LeafNode.SUBSTRING  ):
+                
+            case SUBSTRING :
                 return substringEvaluator.evaluate( node, dn, entry );
+                
             default:
                 throw new NamingException( "Unrecognized leaf node type: " + ( ( LeafNode ) node ).getAssertionType() );
         }

Modified: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/jndi/ServerDirContext.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/jndi/ServerDirContext.java?view=diff&rev=487713&r1=487712&r2=487713
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/jndi/ServerDirContext.java (original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/jndi/ServerDirContext.java Fri Dec 15 15:25:43 2006
@@ -45,6 +45,7 @@
 import org.apache.directory.server.core.DirectoryService;
 import org.apache.directory.server.core.authn.LdapPrincipal;
 import org.apache.directory.server.core.partition.PartitionNexusProxy;
+import org.apache.directory.shared.ldap.filter.AssertionEnum;
 import org.apache.directory.shared.ldap.filter.BranchNode;
 import org.apache.directory.shared.ldap.filter.ExprNode;
 import org.apache.directory.shared.ldap.filter.FilterParserImpl;
@@ -488,11 +489,11 @@
                 
                 if ( value instanceof byte[] )
                 {
-                    node = new SimpleNode( attr.getID(), ( byte [] ) value, SimpleNode.EQUALITY );
+                    node = new SimpleNode( attr.getID(), ( byte [] ) value, AssertionEnum.EQUALITY );
                 }
                 else 
                 {
-                    node = new SimpleNode( attr.getID(), ( String ) value, SimpleNode.EQUALITY );
+                    node = new SimpleNode( attr.getID(), ( String ) value, AssertionEnum.EQUALITY );
                 }
 
                 return getNexusProxy().search( target, getEnvironment(), node, ctls );
@@ -505,7 +506,7 @@
          */
         Attribute attr;
         SimpleNode node;
-        BranchNode filter = new BranchNode( BranchNode.AND );
+        BranchNode filter = new BranchNode( AssertionEnum.AND );
         NamingEnumeration list = matchingAttributes.getAll();
 
         // Loop through each attribute value pair
@@ -535,7 +536,7 @@
                 // Add simpel AVA node if its value is a String 
                 if ( val instanceof String )
                 {
-                    node = new SimpleNode( attr.getID(), ( String ) val, SimpleNode.EQUALITY );
+                    node = new SimpleNode( attr.getID(), ( String ) val, AssertionEnum.EQUALITY );
                     filter.addNode( node );
                 }
             }

Modified: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/normalization/ExpandingVisitor.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/normalization/ExpandingVisitor.java?view=diff&rev=487713&r1=487712&r2=487713
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/normalization/ExpandingVisitor.java (original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/normalization/ExpandingVisitor.java Fri Dec 15 15:25:43 2006
@@ -20,13 +20,13 @@
 package org.apache.directory.server.core.normalization;
 
 
-import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
 
 import javax.naming.NamingException;
 
 import org.apache.directory.server.core.schema.AttributeTypeRegistry;
+import org.apache.directory.shared.ldap.filter.AssertionEnum;
 import org.apache.directory.shared.ldap.filter.BranchNode;
 import org.apache.directory.shared.ldap.filter.ExprNode;
 import org.apache.directory.shared.ldap.filter.ExtensibleNode;
@@ -61,7 +61,7 @@
     }
 
 
-    public ArrayList getOrder( BranchNode node, ArrayList children )
+    public List<ExprNode> getOrder( BranchNode node, List<ExprNode> children )
     {
         return children;
     }
@@ -97,7 +97,7 @@
                         // create a new OR node to hold all descendent forms
                         // add to this node the generalized leaf node and 
                         // replace the old leaf with the new OR branch node
-                        BranchNode orNode = new BranchNode( BranchNode.OR );
+                        BranchNode orNode = new BranchNode( AssertionEnum.OR );
                         orNode.getChildren().add( leaf );
                         children.set( ii, orNode );
                         
@@ -110,26 +110,29 @@
                             
                             switch( leaf.getAssertionType() )
                             {
-                                case( LeafNode.EXTENSIBLE ):
+                                case EXTENSIBLE :
                                     ExtensibleNode extensibleNode = ( ExtensibleNode ) leaf;
                                     newLeaf = new ExtensibleNode( descendant.getOid(), 
                                         extensibleNode.getValue(), 
                                         extensibleNode.getMatchingRuleId(), 
                                         extensibleNode.dnAttributes() );
                                     break;
-                                case( LeafNode.PRESENCE ):
+                                    
+                                case PRESENCE :
                                     newLeaf = new PresenceNode( descendant.getOid() );
                                     break;
-                                case( LeafNode.SUBSTRING ):
+                                    
+                                case SUBSTRING :
                                     SubstringNode substringNode = ( SubstringNode ) leaf;
                                     newLeaf = new SubstringNode( descendant.getOid(), 
                                         substringNode.getInitial(), 
                                         substringNode.getFinal() );
                                     break;
-                                case( LeafNode.APPROXIMATE ):
-                                case( LeafNode.EQUALITY ):
-                                case( LeafNode.GREATEREQ ):
-                                case( LeafNode.LESSEQ ):
+                                    
+                                case APPROXIMATE :
+                                case EQUALITY :
+                                case GREATEREQ :
+                                case LESSEQ :
                                     SimpleNode simpleNode = ( SimpleNode ) leaf;
                                     if ( simpleNode.getValue() instanceof String )
                                     {
@@ -150,6 +153,7 @@
                                             simpleNode.getAssertionType() );
                                     }
                                     break;
+                                    
                                 default:
                                     throw new IllegalStateException( "Unknown assertion type: " 
                                         + leaf.getAssertionType() );

Modified: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/normalization/NormalizationService.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/normalization/NormalizationService.java?view=diff&rev=487713&r1=487712&r2=487713
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/normalization/NormalizationService.java (original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/normalization/NormalizationService.java Fri Dec 15 15:25:43 2006
@@ -40,6 +40,7 @@
 import org.apache.directory.server.core.schema.ConcreteNameComponentNormalizer;
 import org.apache.directory.server.core.schema.OidRegistry;
 
+import org.apache.directory.shared.ldap.filter.AssertionEnum;
 import org.apache.directory.shared.ldap.filter.BranchNode;
 import org.apache.directory.shared.ldap.filter.ExprNode;
 import org.apache.directory.shared.ldap.filter.ExtensibleNode;
@@ -211,7 +212,7 @@
                 
                 bnode.getChildren().remove( e.getUndefinedFilterNode() );
                 
-                if ( bnode.getOperator() == BranchNode.AND )
+                if ( bnode.getOperator() == AssertionEnum.AND )
                 {
                     return new EmptyEnumeration();
                 }
@@ -237,7 +238,7 @@
             }
 
             // now for AND & OR nodes with a single child left replace them with their child
-            if ( child.getChildren().size() == 1 && child.getOperator() != BranchNode.NOT )
+            if ( child.getChildren().size() == 1 && child.getOperator() != AssertionEnum.NOT )
             {
                 filter = child.getChild();
             }
@@ -259,7 +260,7 @@
             {
                 // create new OR node and add the filter leaf to it 
                 // and set filter to this new branch node
-                BranchNode bnode = new BranchNode( BranchNode.OR );
+                BranchNode bnode = new BranchNode( AssertionEnum.OR );
                 bnode.getChildren().add( filter );
                 filter = bnode;
                 
@@ -273,26 +274,29 @@
                     
                     switch( leaf.getAssertionType() )
                     {
-                        case( LeafNode.EXTENSIBLE ):
+                        case EXTENSIBLE :
                             ExtensibleNode extensibleNode = ( ExtensibleNode ) leaf;
                             newLeaf = new ExtensibleNode( descendant.getOid(), 
                                 extensibleNode.getValue(), 
                                 extensibleNode.getMatchingRuleId(), 
                                 extensibleNode.dnAttributes() );
                             break;
-                        case( LeafNode.PRESENCE ):
+                            
+                        case PRESENCE :
                             newLeaf = new PresenceNode( descendant.getOid() );
                             break;
-                        case( LeafNode.SUBSTRING ):
+                            
+                        case SUBSTRING :
                             SubstringNode substringNode = ( SubstringNode ) leaf;
                             newLeaf = new SubstringNode( descendant.getOid(), 
                                 substringNode.getInitial(), 
                                 substringNode.getFinal() );
                             break;
-                        case( LeafNode.APPROXIMATE ):
-                        case( LeafNode.EQUALITY ):
-                        case( LeafNode.GREATEREQ ):
-                        case( LeafNode.LESSEQ ):
+                            
+                        case APPROXIMATE :
+                        case EQUALITY :
+                        case GREATEREQ :
+                        case LESSEQ :
                             SimpleNode simpleNode = ( SimpleNode ) leaf;
                             if ( simpleNode.getValue() instanceof String )
                             {
@@ -313,6 +317,7 @@
                                     simpleNode.getAssertionType() );
                             }
                             break;
+                            
                         default:
                             throw new IllegalStateException( "Unknown assertion type: " 
                                 + leaf.getAssertionType() );

Modified: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/normalization/NormalizingVisitor.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/normalization/NormalizingVisitor.java?view=diff&rev=487713&r1=487712&r2=487713
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/normalization/NormalizingVisitor.java (original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/normalization/NormalizingVisitor.java Fri Dec 15 15:25:43 2006
@@ -21,6 +21,7 @@
 
 
 import org.apache.directory.server.core.schema.OidRegistry;
+import org.apache.directory.shared.ldap.filter.AssertionEnum;
 import org.apache.directory.shared.ldap.filter.BranchNode;
 import org.apache.directory.shared.ldap.filter.ExprNode;
 import org.apache.directory.shared.ldap.filter.FilterVisitor;
@@ -34,6 +35,7 @@
 
 import javax.naming.NamingException;
 import java.util.ArrayList;
+import java.util.List;
 
 
 /**
@@ -203,7 +205,7 @@
                         // remove the child at ii
                         bnode.getChildren().remove( child );
                         
-                        if ( bnode.getOperator() != BranchNode.AND )
+                        if ( bnode.getOperator() != AssertionEnum.AND )
                         {
                             bnode.set( "undefined", Boolean.TRUE );
                         }
@@ -227,7 +229,7 @@
                 catch( UndefinedFilterAttributeException e )
                 {
                     bnode.getChildren().remove( ii );
-                    if ( bnode.getOperator() != BranchNode.AND )
+                    if ( bnode.getOperator() != AssertionEnum.AND )
                     {
                         bnode.set( "undefined", Boolean.TRUE );
                     }
@@ -263,7 +265,7 @@
                     
                     // now for AND & OR nodes with a single child left replace them
                     // with their child at the same index they AND/OR node was in
-                    if ( child.getChildren().size() == 1 && child.getOperator() != BranchNode.NOT )
+                    if ( child.getChildren().size() == 1 && child.getOperator() != AssertionEnum.NOT )
                     {
                         bnode.getChildren().remove( child );
                         if ( ii >= bnode.getChildren().size() )
@@ -293,7 +295,7 @@
     }
 
 
-    public ArrayList getOrder( BranchNode node, ArrayList children )
+    public List<ExprNode> getOrder( BranchNode node, List<ExprNode> children )
     {
         return children;
     }

Modified: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/DefaultOptimizer.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/DefaultOptimizer.java?view=diff&rev=487713&r1=487712&r2=487713
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/DefaultOptimizer.java (original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/DefaultOptimizer.java Fri Dec 15 15:25:43 2006
@@ -22,6 +22,7 @@
 
 import java.math.BigInteger;
 import java.util.ArrayList;
+import java.util.List;
 
 import javax.naming.NamingException;
 import javax.naming.directory.SearchControls;
@@ -104,30 +105,36 @@
 
             switch ( leaf.getAssertionType() )
             {
-                case ( LeafNode.APPROXIMATE  ):
+                case APPROXIMATE :
                     /** Feature not implemented so we just use equality matching */
                     count = getEqualityScan( ( SimpleNode ) leaf );
                     break;
-                case ( LeafNode.EQUALITY  ):
+                    
+                case EQUALITY :
                     count = getEqualityScan( ( SimpleNode ) leaf );
                     break;
-                case ( LeafNode.EXTENSIBLE  ):
+                    
+                case EXTENSIBLE :
                     /** Cannot really say so we presume the total index count */
                     count = getFullScan( leaf );
                     break;
-                case ( LeafNode.GREATEREQ  ):
+                    
+                case GREATEREQ :
                     count = getGreaterLessScan( ( SimpleNode ) leaf, true );
                     break;
-                case ( LeafNode.LESSEQ  ):
+                    
+                case LESSEQ :
                     count = getGreaterLessScan( ( SimpleNode ) leaf, false );
                     break;
-                case ( LeafNode.PRESENCE  ):
+                case PRESENCE :
                     count = getPresenceScan( ( PresenceNode ) leaf );
                     break;
-                case ( LeafNode.SUBSTRING  ):
+                    
+                case SUBSTRING :
                     /** Cannot really say so we presume the total index count */
                     count = getFullScan( leaf );
                     break;
+                    
                 default:
                     throw new IllegalArgumentException( "Unrecognized leaf node" );
             }
@@ -141,15 +148,18 @@
 
             switch ( bnode.getOperator() )
             {
-                case ( BranchNode.AND  ):
+                case AND :
                     count = getConjunctionScan( bnode );
                     break;
-                case ( BranchNode.NOT  ):
+                    
+                case NOT :
                     count = getNegationScan( bnode );
                     break;
-                case ( BranchNode.OR  ):
+                    
+                case OR :
                     count = getDisjunctionScan( bnode );
                     break;
+                    
                 default:
                     throw new IllegalArgumentException( "Unrecognized branch node type" );
             }
@@ -179,7 +189,7 @@
     private BigInteger getConjunctionScan( BranchNode node ) throws NamingException
     {
         BigInteger count = MAX;
-        ArrayList children = node.getChildren();
+        List<ExprNode> children = node.getChildren();
 
         for ( int ii = 0; ii < children.size(); ii++ )
         {
@@ -235,7 +245,7 @@
      */
     private BigInteger getDisjunctionScan( BranchNode node ) throws NamingException
     {
-        ArrayList children = node.getChildren();
+        List<ExprNode> children = node.getChildren();
         BigInteger total = BigInteger.ZERO;
 
         for ( int ii = 0; ii < children.size(); ii++ )

Modified: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/DefaultSearchEngine.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/DefaultSearchEngine.java?view=diff&rev=487713&r1=487712&r2=487713
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/DefaultSearchEngine.java (original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/DefaultSearchEngine.java Fri Dec 15 15:25:43 2006
@@ -29,6 +29,7 @@
 import javax.naming.directory.SearchControls;
 
 import org.apache.directory.shared.ldap.filter.AbstractExprNode;
+import org.apache.directory.shared.ldap.filter.AssertionEnum;
 import org.apache.directory.shared.ldap.filter.BranchNode;
 import org.apache.directory.shared.ldap.filter.ExprNode;
 import org.apache.directory.shared.ldap.filter.ScopeNode;
@@ -126,7 +127,7 @@
         }
 
         // Add the scope node using the eective base to the ilter
-        BranchNode root = new BranchNode( AbstractExprNode.AND );
+        BranchNode root = new BranchNode( AssertionEnum.AND );
         ExprNode node = new ScopeNode( env, effectiveBase.toString(), searchCtls.getSearchScope() );
         root.getChildren().add( node );
         root.getChildren().add( filter );

Modified: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/ExpressionEnumerator.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/ExpressionEnumerator.java?view=diff&rev=487713&r1=487712&r2=487713
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/ExpressionEnumerator.java (original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/ExpressionEnumerator.java Fri Dec 15 15:25:43 2006
@@ -22,6 +22,7 @@
 
 import java.math.BigInteger;
 import java.util.ArrayList;
+import java.util.List;
 
 import javax.naming.NamingEnumeration;
 import javax.naming.NamingException;
@@ -99,27 +100,34 @@
 
             switch ( leaf.getAssertionType() )
             {
-                case ( LeafNode.APPROXIMATE  ):
+                case APPROXIMATE :
                     list = enumEquality( ( SimpleNode ) node );
                     break;
-                case ( LeafNode.EQUALITY  ):
+                    
+                case EQUALITY :
                     list = enumEquality( ( SimpleNode ) node );
                     break;
-                case ( LeafNode.EXTENSIBLE  ):
+                    
+                case EXTENSIBLE :
                     // N O T   I M P L E M E N T E D   Y E T !
                     throw new NotImplementedException();
-                case ( LeafNode.GREATEREQ  ):
+                
+                case GREATEREQ :
                     list = enumGreater( ( SimpleNode ) node, true );
                     break;
-                case ( LeafNode.LESSEQ  ):
+                    
+                case LESSEQ :
                     list = enumGreater( ( SimpleNode ) node, false );
                     break;
-                case ( LeafNode.PRESENCE  ):
+                    
+                case PRESENCE :
                     list = enumPresence( ( PresenceNode ) node );
                     break;
-                case ( LeafNode.SUBSTRING  ):
+                    
+                case SUBSTRING :
                     list = substringEnumerator.enumerate( leaf );
                     break;
+                    
                 default:
                     throw new IllegalArgumentException( "Unknown leaf assertion" );
             }
@@ -130,15 +138,18 @@
 
             switch ( branch.getOperator() )
             {
-                case ( BranchNode.AND  ):
+                case AND :
                     list = enumConj( branch );
                     break;
-                case ( BranchNode.NOT  ):
+                    
+                case NOT :
                     list = enumNeg( branch );
                     break;
-                case ( BranchNode.OR  ):
+                    
+                case OR :
                     list = enumDisj( branch );
                     break;
+                    
                 default:
                     throw new IllegalArgumentException( "Unknown branch logical operator" );
             }
@@ -155,7 +166,7 @@
      */
     private NamingEnumeration enumDisj( BranchNode node ) throws NamingException
     {
-        ArrayList children = node.getChildren();
+        List<ExprNode> children = node.getChildren();
         NamingEnumeration[] childEnumerations = new NamingEnumeration[children.size()];
 
         // Recursively create NamingEnumerations for each child expression node
@@ -226,7 +237,7 @@
          * we will use for iteration by creating a NamingEnumeration over its
          * expression.
          */
-        final ArrayList children = node.getChildren();
+        final List<ExprNode> children = node.getChildren();
         for ( int ii = 0; ii < children.size(); ii++ )
         {
             ExprNode child = ( ExprNode ) children.get( ii );

Modified: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/ExpressionEvaluator.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/ExpressionEvaluator.java?view=diff&rev=487713&r1=487712&r2=487713
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/ExpressionEvaluator.java (original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/ExpressionEvaluator.java Fri Dec 15 15:25:43 2006
@@ -107,7 +107,7 @@
 
         switch ( bnode.getOperator() )
         {
-            case ( BranchNode.OR  ):
+            case OR :
                 Iterator children = bnode.getChildren().iterator();
 
                 while ( children.hasNext() )
@@ -121,7 +121,8 @@
                 }
 
                 return false;
-            case ( BranchNode.AND  ):
+                
+            case AND :
                 children = bnode.getChildren().iterator();
                 while ( children.hasNext() )
                 {
@@ -134,13 +135,15 @@
                 }
 
                 return true;
-            case ( BranchNode.NOT  ):
+                
+            case NOT :
                 if ( null != bnode.getChild() )
                 {
                     return !evaluate( bnode.getChild(), record );
                 }
 
                 throw new NamingException( "Negation has no child: " + node );
+                
             default:
                 throw new NamingException( "Unrecognized branch node operator: " + bnode.getOperator() );
         }

Modified: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/LeafEvaluator.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/LeafEvaluator.java?view=diff&rev=487713&r1=487712&r2=487713
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/LeafEvaluator.java (original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/LeafEvaluator.java Fri Dec 15 15:25:43 2006
@@ -115,21 +115,28 @@
 
         switch ( ( ( LeafNode ) node ).getAssertionType() )
         {
-            case ( LeafNode.APPROXIMATE  ):
+            case APPROXIMATE :
                 return evalEquality( ( SimpleNode ) node, record );
-            case ( LeafNode.EQUALITY  ):
+            
+            case EQUALITY :
                 return evalEquality( ( SimpleNode ) node, record );
-            case ( LeafNode.EXTENSIBLE  ):
+            
+            case EXTENSIBLE :
                 throw new NotImplementedException();
-            case ( LeafNode.GREATEREQ  ):
+            
+            case GREATEREQ :
                 return evalGreater( ( SimpleNode ) node, record, true );
-            case ( LeafNode.LESSEQ  ):
+            
+            case LESSEQ :
                 return evalGreater( ( SimpleNode ) node, record, false );
-            case ( LeafNode.PRESENCE  ):
+            
+            case PRESENCE :
                 String attrId = ( ( PresenceNode ) node ).getAttribute();
                 return evalPresence( attrId, record );
-            case ( LeafNode.SUBSTRING  ):
+                
+            case SUBSTRING :
                 return substringEvaluator.evaluate( node, record );
+            
             default:
                 throw new NamingException( "Unrecognized leaf node type: " + ( ( LeafNode ) node ).getAssertionType() );
         }

Modified: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/ASTNode.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/ASTNode.java?view=diff&rev=487713&r1=487712&r2=487713
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/ASTNode.java (original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/ASTNode.java Fri Dec 15 15:25:43 2006
@@ -23,6 +23,7 @@
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.Enumeration;
+import java.util.List;
 
 import javax.swing.tree.TreeNode;
 
@@ -69,7 +70,7 @@
             }
 
             BranchNode branch = ( BranchNode ) exprNode;
-            ArrayList exprNodes = branch.getChildren();
+            List<ExprNode> exprNodes = branch.getChildren();
             for ( int ii = 0; ii < exprNodes.size(); ii++ )
             {
                 ExprNode child = ( ExprNode ) exprNodes.get( ii );

Modified: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/referral/ReferralService.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/referral/ReferralService.java?view=diff&rev=487713&r1=487712&r2=487713
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/referral/ReferralService.java (original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/referral/ReferralService.java Fri Dec 15 15:25:43 2006
@@ -62,6 +62,7 @@
 import org.apache.directory.shared.ldap.codec.util.LdapURLEncodingException;
 import org.apache.directory.shared.ldap.exception.LdapNamingException;
 import org.apache.directory.shared.ldap.exception.LdapReferralException;
+import org.apache.directory.shared.ldap.filter.AssertionEnum;
 import org.apache.directory.shared.ldap.filter.ExprNode;
 import org.apache.directory.shared.ldap.filter.LeafNode;
 import org.apache.directory.shared.ldap.filter.SimpleNode;
@@ -807,7 +808,7 @@
 
     static ExprNode getReferralFilter()
     {
-        return new SimpleNode( OBJCLASS_ATTR, REFERRAL_OC, LeafNode.EQUALITY );
+        return new SimpleNode( OBJCLASS_ATTR, REFERRAL_OC, AssertionEnum.EQUALITY );
     }
 
 

Modified: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/schema/SchemaService.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/schema/SchemaService.java?view=diff&rev=487713&r1=487712&r2=487713
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/schema/SchemaService.java (original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/schema/SchemaService.java Fri Dec 15 15:25:43 2006
@@ -49,6 +49,7 @@
 import org.apache.directory.shared.ldap.exception.LdapNamingException;
 import org.apache.directory.shared.ldap.exception.LdapNoSuchAttributeException;
 import org.apache.directory.shared.ldap.exception.LdapSchemaViolationException;
+import org.apache.directory.shared.ldap.filter.AssertionEnum;
 import org.apache.directory.shared.ldap.filter.ExprNode;
 import org.apache.directory.shared.ldap.filter.PresenceNode;
 import org.apache.directory.shared.ldap.filter.SimpleNode;
@@ -219,7 +220,7 @@
 
             // see if node attribute is objectClass
             if ( node.getAttribute().equalsIgnoreCase( "2.5.4.0" )
-                && "subschema".equalsIgnoreCase( compareto ) && node.getAssertionType() == SimpleNode.EQUALITY )
+                && "subschema".equalsIgnoreCase( compareto ) && node.getAssertionType() == AssertionEnum.EQUALITY )
             {
                 // call.setBypass( true );
                 Attributes attrs = getSubschemaEntry( searchCtls.getReturningAttributes() );

Modified: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/sp/LdapClassLoader.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/sp/LdapClassLoader.java?view=diff&rev=487713&r1=487712&r2=487713
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/sp/LdapClassLoader.java (original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/sp/LdapClassLoader.java Fri Dec 15 15:25:43 2006
@@ -29,6 +29,7 @@
 import javax.naming.directory.SearchResult;
 
 import org.apache.directory.server.core.jndi.ServerLdapContext;
+import org.apache.directory.shared.ldap.filter.AssertionEnum;
 import org.apache.directory.shared.ldap.filter.BranchNode;
 import org.apache.directory.shared.ldap.filter.LeafNode;
 import org.apache.directory.shared.ldap.filter.SimpleNode;
@@ -71,9 +72,9 @@
         NamingEnumeration javaClassEntries = null;
         byte[] classBytes = null;
         
-        BranchNode filter = new BranchNode( BranchNode.AND );
-        filter.addNode( new SimpleNode( "fullyQualifiedJavaClassName", name, LeafNode.EQUALITY ) );
-        filter.addNode( new SimpleNode( "objectClass", "javaClass", LeafNode.EQUALITY ) );
+        BranchNode filter = new BranchNode( AssertionEnum.AND );
+        filter.addNode( new SimpleNode( "fullyQualifiedJavaClassName", name, AssertionEnum.EQUALITY ) );
+        filter.addNode( new SimpleNode( "objectClass", "javaClass", AssertionEnum.EQUALITY ) );
         
         SearchControls controls = new SearchControls();
         controls.setSearchScope( SearchControls.SUBTREE_SCOPE );

Modified: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/subtree/RefinementEvaluator.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/subtree/RefinementEvaluator.java?view=diff&rev=487713&r1=487712&r2=487713
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/subtree/RefinementEvaluator.java (original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/subtree/RefinementEvaluator.java Fri Dec 15 15:25:43 2006
@@ -74,7 +74,7 @@
 
         switch ( bnode.getOperator() )
         {
-            case ( BranchNode.OR  ):
+            case OR :
                 Iterator children = bnode.getChildren().iterator();
 
                 while ( children.hasNext() )
@@ -88,7 +88,8 @@
                 }
 
                 return false;
-            case ( BranchNode.AND  ):
+                
+            case AND :
                 children = bnode.getChildren().iterator();
                 while ( children.hasNext() )
                 {
@@ -101,7 +102,8 @@
                 }
 
                 return true;
-            case ( BranchNode.NOT  ):
+                
+            case NOT :
                 if ( null != bnode.getChild() )
                 {
                     return !evaluate( bnode.getChild(), objectClasses );

Modified: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/subtree/RefinementLeafEvaluator.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/subtree/RefinementLeafEvaluator.java?view=diff&rev=487713&r1=487712&r2=487713
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/subtree/RefinementLeafEvaluator.java (original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/subtree/RefinementLeafEvaluator.java Fri Dec 15 15:25:43 2006
@@ -21,6 +21,7 @@
 
 
 import org.apache.directory.server.core.schema.OidRegistry;
+import org.apache.directory.shared.ldap.filter.AssertionEnum;
 import org.apache.directory.shared.ldap.filter.LeafNode;
 import org.apache.directory.shared.ldap.filter.SimpleNode;
 import org.apache.directory.shared.ldap.util.StringTools;
@@ -71,7 +72,7 @@
         {
             throw new IllegalArgumentException( "node cannot be null" );
         }
-        if ( node.getAssertionType() != LeafNode.EQUALITY )
+        if ( node.getAssertionType() != AssertionEnum.EQUALITY )
         {
             throw new NamingException( "Unrecognized assertion type for refinement node: " + node.getAssertionType() );
         }

Modified: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/subtree/SubentryService.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/subtree/SubentryService.java?view=diff&rev=487713&r1=487712&r2=487713
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/subtree/SubentryService.java (original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/subtree/SubentryService.java Fri Dec 15 15:25:43 2006
@@ -36,6 +36,7 @@
 import org.apache.directory.shared.ldap.exception.LdapInvalidAttributeValueException;
 import org.apache.directory.shared.ldap.exception.LdapNoSuchAttributeException;
 import org.apache.directory.shared.ldap.exception.LdapSchemaViolationException;
+import org.apache.directory.shared.ldap.filter.AssertionEnum;
 import org.apache.directory.shared.ldap.filter.ExprNode;
 import org.apache.directory.shared.ldap.filter.LeafNode;
 import org.apache.directory.shared.ldap.filter.PresenceNode;
@@ -133,7 +134,7 @@
 
         // prepare to find all subentries in all namingContexts
         Iterator suffixes = this.nexus.listSuffixes();
-        ExprNode filter = new SimpleNode( "objectclass", "subentry", LeafNode.EQUALITY );
+        ExprNode filter = new SimpleNode( "objectclass", "subentry", AssertionEnum.EQUALITY );
         SearchControls controls = new SearchControls();
         controls.setSearchScope( SearchControls.SUBTREE_SCOPE );
         controls.setReturningAttributes( new String[] { "subtreeSpecification", "objectClass" } );

Modified: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/trigger/TriggerSpecCache.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/trigger/TriggerSpecCache.java?view=diff&rev=487713&r1=487712&r2=487713
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/trigger/TriggerSpecCache.java (original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/trigger/TriggerSpecCache.java Fri Dec 15 15:25:43 2006
@@ -41,6 +41,7 @@
 import org.apache.directory.server.core.DirectoryServiceConfiguration;
 import org.apache.directory.server.core.partition.PartitionNexus;
 import org.apache.directory.server.core.schema.AttributeTypeRegistry;
+import org.apache.directory.shared.ldap.filter.AssertionEnum;
 import org.apache.directory.shared.ldap.filter.ExprNode;
 import org.apache.directory.shared.ldap.filter.SimpleNode;
 import org.apache.directory.shared.ldap.name.LdapDN;
@@ -115,7 +116,7 @@
         {
             String suffix = ( String ) suffixes.next();
             LdapDN baseDn = new LdapDN( suffix );
-            ExprNode filter = new SimpleNode( OC_ATTR, TRIGGER_SUBENTRY_OC, SimpleNode.EQUALITY );
+            ExprNode filter = new SimpleNode( OC_ATTR, TRIGGER_SUBENTRY_OC, AssertionEnum.EQUALITY );
             SearchControls ctls = new SearchControls();
             ctls.setSearchScope( SearchControls.SUBTREE_SCOPE );
             NamingEnumeration results = nexus.search( baseDn, env, filter, ctls );

Modified: directory/trunks/apacheds/core/src/test/java/org/apache/directory/server/core/subtree/RefinementEvaluatorTest.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/core/src/test/java/org/apache/directory/server/core/subtree/RefinementEvaluatorTest.java?view=diff&rev=487713&r1=487712&r2=487713
==============================================================================
--- directory/trunks/apacheds/core/src/test/java/org/apache/directory/server/core/subtree/RefinementEvaluatorTest.java (original)
+++ directory/trunks/apacheds/core/src/test/java/org/apache/directory/server/core/subtree/RefinementEvaluatorTest.java Fri Dec 15 15:25:43 2006
@@ -30,6 +30,7 @@
 import org.apache.directory.server.core.schema.global.GlobalRegistries;
 import org.apache.directory.server.core.subtree.RefinementEvaluator;
 import org.apache.directory.server.core.subtree.RefinementLeafEvaluator;
+import org.apache.directory.shared.ldap.filter.AssertionEnum;
 import org.apache.directory.shared.ldap.filter.BranchNode;
 import org.apache.directory.shared.ldap.filter.ExprNode;
 import org.apache.directory.shared.ldap.filter.FilterParser;
@@ -115,7 +116,7 @@
 
         try
         {
-            assertFalse( evaluator.evaluate( new SimpleNode( "", "", LeafNode.EQUALITY ), null ) );
+            assertFalse( evaluator.evaluate( new SimpleNode( "", "", AssertionEnum.EQUALITY ), null ) );
             fail( "should never get here due to an IAE" );
         }
         catch ( IllegalArgumentException iae )
@@ -124,7 +125,7 @@
 
         try
         {
-            assertFalse( evaluator.evaluate( new SimpleNode( "", "", LeafNode.EQUALITY ), new BasicAttribute( "blah" ) ) );
+            assertFalse( evaluator.evaluate( new SimpleNode( "", "", AssertionEnum.EQUALITY ), new BasicAttribute( "blah" ) ) );
             fail( "should never get here due to an IAE" );
         }
         catch ( IllegalArgumentException iae )
@@ -139,19 +140,19 @@
 
         // positive test
         objectClasses = new BasicAttribute( "objectClass", "person" );
-        assertTrue( evaluator.evaluate( new SimpleNode( "objectClass", "person", LeafNode.EQUALITY ), objectClasses ) );
+        assertTrue( evaluator.evaluate( new SimpleNode( "objectClass", "person", AssertionEnum.EQUALITY ), objectClasses ) );
 
         objectClasses = new BasicAttribute( "objectClass" );
         objectClasses.add( "person" );
         objectClasses.add( "blah" );
-        assertTrue( evaluator.evaluate( new SimpleNode( "objectClass", "person", LeafNode.EQUALITY ), objectClasses ) );
+        assertTrue( evaluator.evaluate( new SimpleNode( "objectClass", "person", AssertionEnum.EQUALITY ), objectClasses ) );
 
         // negative tests
         objectClasses = new BasicAttribute( "objectClass", "person" );
-        assertFalse( evaluator.evaluate( new SimpleNode( "objectClass", "blah", LeafNode.EQUALITY ), objectClasses ) );
+        assertFalse( evaluator.evaluate( new SimpleNode( "objectClass", "blah", AssertionEnum.EQUALITY ), objectClasses ) );
 
         objectClasses = new BasicAttribute( "objectClass", "blah" );
-        assertFalse( evaluator.evaluate( new SimpleNode( "objectClass", "person", LeafNode.EQUALITY ), objectClasses ) );
+        assertFalse( evaluator.evaluate( new SimpleNode( "objectClass", "person", AssertionEnum.EQUALITY ), objectClasses ) );
     }
 
 
@@ -161,19 +162,19 @@
 
         // positive test
         objectClasses = new BasicAttribute( "objectClass", "person" );
-        assertTrue( evaluator.evaluate( new SimpleNode( "objectClass", "2.5.6.6", LeafNode.EQUALITY ), objectClasses ) );
+        assertTrue( evaluator.evaluate( new SimpleNode( "objectClass", "2.5.6.6", AssertionEnum.EQUALITY ), objectClasses ) );
 
         objectClasses = new BasicAttribute( "objectClass" );
         objectClasses.add( "person" );
         objectClasses.add( "blah" );
-        assertTrue( evaluator.evaluate( new SimpleNode( "objectClass", "2.5.6.6", LeafNode.EQUALITY ), objectClasses ) );
+        assertTrue( evaluator.evaluate( new SimpleNode( "objectClass", "2.5.6.6", AssertionEnum.EQUALITY ), objectClasses ) );
 
         // negative tests
         objectClasses = new BasicAttribute( "objectClass", "person" );
-        assertFalse( evaluator.evaluate( new SimpleNode( "objectClass", "2.5.6.5", LeafNode.EQUALITY ), objectClasses ) );
+        assertFalse( evaluator.evaluate( new SimpleNode( "objectClass", "2.5.6.5", AssertionEnum.EQUALITY ), objectClasses ) );
 
         objectClasses = new BasicAttribute( "objectClass", "blah" );
-        assertFalse( evaluator.evaluate( new SimpleNode( "objectClass", "2.5.6.5", LeafNode.EQUALITY ), objectClasses ) );
+        assertFalse( evaluator.evaluate( new SimpleNode( "objectClass", "2.5.6.5", AssertionEnum.EQUALITY ), objectClasses ) );
     }
 
 
@@ -228,16 +229,7 @@
 
         try
         {
-            assertFalse( evaluator.evaluate( new BranchNode( 1000 ), new BasicAttribute( "objectClass" ) ) );
-            fail( "should never get here due to an IAE" );
-        }
-        catch ( IllegalArgumentException iae )
-        {
-        }
-
-        try
-        {
-            assertFalse( evaluator.evaluate( new BranchNode( BranchNode.NOT ), new BasicAttribute( "objectClass" ) ) );
+            assertFalse( evaluator.evaluate( new BranchNode( AssertionEnum.NOT ), new BasicAttribute( "objectClass" ) ) );
             fail( "should never get here due to an IAE" );
         }
         catch ( IllegalArgumentException iae )

Modified: directory/trunks/apacheds/core/src/test/java/org/apache/directory/server/core/subtree/RefinementLeafEvaluatorTest.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/core/src/test/java/org/apache/directory/server/core/subtree/RefinementLeafEvaluatorTest.java?view=diff&rev=487713&r1=487712&r2=487713
==============================================================================
--- directory/trunks/apacheds/core/src/test/java/org/apache/directory/server/core/subtree/RefinementLeafEvaluatorTest.java (original)
+++ directory/trunks/apacheds/core/src/test/java/org/apache/directory/server/core/subtree/RefinementLeafEvaluatorTest.java Fri Dec 15 15:25:43 2006
@@ -29,6 +29,7 @@
 import org.apache.directory.server.core.schema.bootstrap.*;
 import org.apache.directory.server.core.schema.global.GlobalRegistries;
 import org.apache.directory.server.core.subtree.RefinementLeafEvaluator;
+import org.apache.directory.shared.ldap.filter.AssertionEnum;
 import org.apache.directory.shared.ldap.filter.LeafNode;
 import org.apache.directory.shared.ldap.filter.SimpleNode;
 
@@ -111,7 +112,7 @@
 
         try
         {
-            assertFalse( evaluator.evaluate( new SimpleNode( "", "", LeafNode.GREATEREQ ), objectClasses ) );
+            assertFalse( evaluator.evaluate( new SimpleNode( "", "", AssertionEnum.GREATEREQ ), objectClasses ) );
             fail( "should never get here due to an NE" );
         }
         catch ( NamingException ne )
@@ -120,7 +121,7 @@
 
         try
         {
-            assertFalse( evaluator.evaluate( new SimpleNode( "", "", LeafNode.EQUALITY ), objectClasses ) );
+            assertFalse( evaluator.evaluate( new SimpleNode( "", "", AssertionEnum.EQUALITY ), objectClasses ) );
             fail( "should never get here due to an NE" );
         }
         catch ( NamingException ne )
@@ -129,7 +130,7 @@
 
         try
         {
-            assertFalse( evaluator.evaluate( new SimpleNode( "objectClass", "", LeafNode.EQUALITY ), objectClasses ) );
+            assertFalse( evaluator.evaluate( new SimpleNode( "objectClass", "", AssertionEnum.EQUALITY ), objectClasses ) );
             fail( "should never get here due to an IAE" );
         }
         catch ( IllegalArgumentException iae )
@@ -139,7 +140,7 @@
         try
         {
             objectClasses = new BasicAttribute( "incorrectAttrId" );
-            assertFalse( evaluator.evaluate( new SimpleNode( "objectClass", "", LeafNode.EQUALITY ), objectClasses ) );
+            assertFalse( evaluator.evaluate( new SimpleNode( "objectClass", "", AssertionEnum.EQUALITY ), objectClasses ) );
             fail( "should never get here due to an IAE" );
         }
         catch ( IllegalArgumentException iae )
@@ -154,19 +155,19 @@
 
         // positive test
         objectClasses = new BasicAttribute( "objectClass", "person" );
-        assertTrue( evaluator.evaluate( new SimpleNode( "objectClass", "person", LeafNode.EQUALITY ), objectClasses ) );
+        assertTrue( evaluator.evaluate( new SimpleNode( "objectClass", "person", AssertionEnum.EQUALITY ), objectClasses ) );
 
         objectClasses = new BasicAttribute( "objectClass" );
         objectClasses.add( "person" );
         objectClasses.add( "blah" );
-        assertTrue( evaluator.evaluate( new SimpleNode( "objectClass", "person", LeafNode.EQUALITY ), objectClasses ) );
+        assertTrue( evaluator.evaluate( new SimpleNode( "objectClass", "person", AssertionEnum.EQUALITY ), objectClasses ) );
 
         // negative tests
         objectClasses = new BasicAttribute( "objectClass", "person" );
-        assertFalse( evaluator.evaluate( new SimpleNode( "objectClass", "blah", LeafNode.EQUALITY ), objectClasses ) );
+        assertFalse( evaluator.evaluate( new SimpleNode( "objectClass", "blah", AssertionEnum.EQUALITY ), objectClasses ) );
 
         objectClasses = new BasicAttribute( "objectClass", "blah" );
-        assertFalse( evaluator.evaluate( new SimpleNode( "objectClass", "person", LeafNode.EQUALITY ), objectClasses ) );
+        assertFalse( evaluator.evaluate( new SimpleNode( "objectClass", "person", AssertionEnum.EQUALITY ), objectClasses ) );
     }
 
 
@@ -176,18 +177,18 @@
 
         // positive test
         objectClasses = new BasicAttribute( "objectClass", "person" );
-        assertTrue( evaluator.evaluate( new SimpleNode( "objectClass", "2.5.6.6", LeafNode.EQUALITY ), objectClasses ) );
+        assertTrue( evaluator.evaluate( new SimpleNode( "objectClass", "2.5.6.6", AssertionEnum.EQUALITY ), objectClasses ) );
 
         objectClasses = new BasicAttribute( "objectClass" );
         objectClasses.add( "person" );
         objectClasses.add( "blah" );
-        assertTrue( evaluator.evaluate( new SimpleNode( "objectClass", "2.5.6.6", LeafNode.EQUALITY ), objectClasses ) );
+        assertTrue( evaluator.evaluate( new SimpleNode( "objectClass", "2.5.6.6", AssertionEnum.EQUALITY ), objectClasses ) );
 
         // negative tests
         objectClasses = new BasicAttribute( "objectClass", "person" );
-        assertFalse( evaluator.evaluate( new SimpleNode( "objectClass", "2.5.6.5", LeafNode.EQUALITY ), objectClasses ) );
+        assertFalse( evaluator.evaluate( new SimpleNode( "objectClass", "2.5.6.5", AssertionEnum.EQUALITY ), objectClasses ) );
 
         objectClasses = new BasicAttribute( "objectClass", "blah" );
-        assertFalse( evaluator.evaluate( new SimpleNode( "objectClass", "2.5.6.5", LeafNode.EQUALITY ), objectClasses ) );
+        assertFalse( evaluator.evaluate( new SimpleNode( "objectClass", "2.5.6.5", AssertionEnum.EQUALITY ), objectClasses ) );
     }
 }

Modified: directory/trunks/shared/ldap/src/main/antlr/ACIItem.g
URL: http://svn.apache.org/viewvc/directory/trunks/shared/ldap/src/main/antlr/ACIItem.g?view=diff&rev=487713&r1=487712&r2=487713
==============================================================================
--- directory/trunks/shared/ldap/src/main/antlr/ACIItem.g (original)
+++ directory/trunks/shared/ldap/src/main/antlr/ACIItem.g Fri Dec 15 15:25:43 2006
@@ -35,7 +35,7 @@
 import javax.naming.directory.BasicAttribute;
 import javax.naming.NamingException;
 
-import org.apache.directory.shared.ldap.filter.AbstractExprNode;
+import org.apache.directory.shared.ldap.filter.AssertionEnum;
 import org.apache.directory.shared.ldap.filter.BranchNode;
 import org.apache.directory.shared.ldap.filter.ExprNode;
 import org.apache.directory.shared.ldap.filter.FilterParserImpl;
@@ -1213,7 +1213,7 @@
     :
     ID_item ( SP )* COLON ( SP )* l_oid=oid
     {
-        node = new SimpleNode( "objectClass" , l_oid , AbstractExprNode.EQUALITY );
+        node = new SimpleNode( "objectClass" , l_oid , AssertionEnum.EQUALITY );
     }
     ;
 
@@ -1226,7 +1226,7 @@
     :
     ID_and ( SP )* COLON ( SP )* children=refinements
     {
-        node = new BranchNode( AbstractExprNode.AND , children );
+        node = new BranchNode( AssertionEnum.AND , children );
     }
     ;
 
@@ -1239,7 +1239,7 @@
     :
     ID_or ( SP )* COLON ( SP )* children=refinements
     {
-        node = new BranchNode( AbstractExprNode.OR , children );
+        node = new BranchNode( AssertionEnum.OR , children );
     }
     ;
 
@@ -1252,7 +1252,7 @@
     :
     ID_not ( SP )* COLON ( SP )* children=refinements
     {
-        node = new BranchNode( AbstractExprNode.NOT , children );
+        node = new BranchNode( AssertionEnum.NOT , children );
     }
     ;
 

Modified: directory/trunks/shared/ldap/src/main/antlr/filter-parser.g
URL: http://svn.apache.org/viewvc/directory/trunks/shared/ldap/src/main/antlr/filter-parser.g?view=diff&rev=487713&r1=487712&r2=487713
==============================================================================
--- directory/trunks/shared/ldap/src/main/antlr/filter-parser.g (original)
+++ directory/trunks/shared/ldap/src/main/antlr/filter-parser.g Fri Dec 15 15:25:43 2006
@@ -28,6 +28,7 @@
 import antlr.*;
 import java.util.ArrayList;
 import org.apache.directory.shared.ldap.util.StringTools;
+import org.apache.directory.shared.ldap.filter.AssertionEnum;
 }
 
 // ----------------------------------------------------------------------------
@@ -182,7 +183,7 @@
       }
     )+
     {
-        node = new BranchNode( AbstractExprNode.AND, children );
+        node = new BranchNode( AssertionEnum.AND, children );
     }
     ;
 
@@ -207,7 +208,7 @@
       }
     )+
     {
-        node = new BranchNode( AbstractExprNode.OR, children );
+        node = new BranchNode( AssertionEnum.OR, children );
     }
     ;
 
@@ -222,7 +223,7 @@
 }
     : EXCLAMATION child=filter
     {
-        node = new BranchNode( AbstractExprNode.NOT );
+        node = new BranchNode( AssertionEnum.NOT );
         node.addNode( child );
     }
     ;
@@ -256,7 +257,7 @@
 {
     String attribute = null;
     node = null;
-    int type = -1;
+    AssertionEnum type = null;
 }
     /*
      * Reads the attribute description, the assertion operator, and then
@@ -271,19 +272,19 @@
     (
       APPROX
         {
-            type = AbstractExprNode.APPROXIMATE;
+            type = AssertionEnum.APPROXIMATE;
         }
     | GREATEROREQUAL
         {
-            type = AbstractExprNode.GREATEREQ;
+            type = AssertionEnum.GREATEREQ;
         }
     | LESSOREQUAL
         {
-            type = AbstractExprNode.LESSEQ;
+            type = AssertionEnum.LESSEQ;
         }
     | EQUALS
         {
-            type = AbstractExprNode.EQUALITY;
+            type = AssertionEnum.EQUALITY;
         }
     )
       {
@@ -305,9 +306,9 @@
 
         switch( type )
         {
-            case( AbstractExprNode.APPROXIMATE ):
-            case( AbstractExprNode.GREATEREQ ):
-            case( AbstractExprNode.LESSEQ ):
+            case APPROXIMATE :
+            case GREATEREQ :
+            case LESSEQ :
                 if ( value instanceof String )
                 {
                     node = new SimpleNode( attribute, ( String ) value, type );
@@ -317,7 +318,8 @@
                     node = new SimpleNode( attribute, ( byte[] ) value, type );
                 }
                 break;
-            case( AbstractExprNode.EQUALITY ):
+                
+            case EQUALITY :
                 if ( value instanceof String )
                 {
                     node = new SimpleNode( attribute, ( String ) value, type );
@@ -331,6 +333,7 @@
                     node = ( LeafNode ) value;
                 }
                 break;
+                
             default:
                 throw new IllegalStateException( "Expecting one of 4 types" );
         }

Modified: directory/trunks/shared/ldap/src/main/antlr/subtree-specification.g
URL: http://svn.apache.org/viewvc/directory/trunks/shared/ldap/src/main/antlr/subtree-specification.g?view=diff&rev=487713&r1=487712&r2=487713
==============================================================================
--- directory/trunks/shared/ldap/src/main/antlr/subtree-specification.g (original)
+++ directory/trunks/shared/ldap/src/main/antlr/subtree-specification.g Fri Dec 15 15:25:43 2006
@@ -33,7 +33,7 @@
 import org.apache.directory.shared.ldap.filter.LeafNode;
 import org.apache.directory.shared.ldap.filter.SimpleNode;
 import org.apache.directory.shared.ldap.filter.BranchNode;
-import org.apache.directory.shared.ldap.filter.AbstractExprNode;
+import org.apache.directory.shared.ldap.filter.AssertionEnum;
 import org.apache.directory.shared.ldap.subtree.SubtreeSpecification;
 import org.apache.directory.shared.ldap.subtree.SubtreeSpecificationModifier;
 import org.apache.directory.shared.ldap.schema.NormalizerMappingResolver;
@@ -369,7 +369,7 @@
     :
     ID_item ( SP )* COLON ( SP )* l_oid=oid
     {
-        node = new SimpleNode( "objectClass" , l_oid , AbstractExprNode.EQUALITY );
+        node = new SimpleNode( "objectClass" , l_oid , AssertionEnum.EQUALITY );
     }
     ;
 
@@ -382,7 +382,7 @@
     :
     ID_and ( SP )* COLON ( SP )* children=refinements
     {
-        node = new BranchNode( AbstractExprNode.AND , children );
+        node = new BranchNode( AssertionEnum.AND , children );
     }
     ;
 
@@ -395,7 +395,7 @@
     :
     ID_or ( SP )* COLON ( SP )* children=refinements
     {
-        node = new BranchNode( AbstractExprNode.OR , children );
+        node = new BranchNode( AssertionEnum.OR , children );
     }
     ;
 
@@ -408,7 +408,7 @@
     :
     ID_not ( SP )* COLON ( SP )* children=refinements
     {
-        node = new BranchNode( AbstractExprNode.NOT , children );
+        node = new BranchNode( AssertionEnum.NOT , children );
     }
     ;
 

Modified: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/codec/TwixTransformer.java
URL: http://svn.apache.org/viewvc/directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/codec/TwixTransformer.java?view=diff&rev=487713&r1=487712&r2=487713
==============================================================================
--- directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/codec/TwixTransformer.java (original)
+++ directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/codec/TwixTransformer.java Fri Dec 15 15:25:43 2006
@@ -69,6 +69,7 @@
 import org.apache.directory.shared.ldap.codec.util.LdapURL;
 import org.apache.directory.shared.ldap.codec.util.LdapURLEncodingException;
 import org.apache.directory.shared.ldap.filter.AbstractExprNode;
+import org.apache.directory.shared.ldap.filter.AssertionEnum;
 import org.apache.directory.shared.ldap.filter.BranchNode;
 import org.apache.directory.shared.ldap.filter.ExprNode;
 import org.apache.directory.shared.ldap.filter.ExtensibleNode;
@@ -394,15 +395,15 @@
 
                 if ( twixFilter instanceof AndFilter )
                 {
-                    branch = new BranchNode( AbstractExprNode.AND );
+                    branch = new BranchNode( AssertionEnum.AND );
                 }
                 else if ( twixFilter instanceof OrFilter )
                 {
-                    branch = new BranchNode( AbstractExprNode.OR );
+                    branch = new BranchNode( AssertionEnum.OR );
                 }
                 else if ( twixFilter instanceof NotFilter )
                 {
-                    branch = new BranchNode( AbstractExprNode.NOT );
+                    branch = new BranchNode( AssertionEnum.NOT );
                 }
 
                 List<Filter> filtersSet = ( ( ConnectorFilter ) twixFilter ).getFilterSet();
@@ -441,13 +442,13 @@
                             {
                                 branch = new SimpleNode( ava.getAttributeDesc().toString(), 
                                     (String)ava.getAssertionValue(), 
-                                    AbstractExprNode.EQUALITY );
+                                    AssertionEnum.EQUALITY );
                             }
                             else
                             {
                                 branch = new SimpleNode( ava.getAttributeDesc().toString(), 
                                     (byte[])ava.getAssertionValue(), 
-                                    AbstractExprNode.EQUALITY );
+                                    AssertionEnum.EQUALITY );
                             }
                             
                             break;
@@ -457,13 +458,13 @@
                             {
                                 branch = new SimpleNode( ava.getAttributeDesc().toString(),
                                     (String)ava.getAssertionValue(),
-                                    AbstractExprNode.GREATEREQ );
+                                    AssertionEnum.GREATEREQ );
                             }
                             else
                             {
                                 branch = new SimpleNode( ava.getAttributeDesc().toString(),
                                     (byte[])ava.getAssertionValue(),
-                                    AbstractExprNode.GREATEREQ );
+                                    AssertionEnum.GREATEREQ );
                             }
 
                             break;
@@ -473,13 +474,13 @@
                             {
                                 branch = new SimpleNode( ava.getAttributeDesc().toString(), 
                                     (String)ava.getAssertionValue(), 
-                                    AbstractExprNode.LESSEQ );
+                                    AssertionEnum.LESSEQ );
                             }
                             else
                             {
                                 branch = new SimpleNode( ava.getAttributeDesc().toString(), 
                                     (byte[])ava.getAssertionValue(), 
-                                    AbstractExprNode.LESSEQ );
+                                    AssertionEnum.LESSEQ );
                             }
 
                             break;
@@ -489,13 +490,13 @@
                             {
                                 branch = new SimpleNode( ava.getAttributeDesc().toString(), 
                                     (String)ava.getAssertionValue(), 
-                                    AbstractExprNode.APPROXIMATE );
+                                    AssertionEnum.APPROXIMATE );
                             }
                             else
                             {
                                 branch = new SimpleNode( ava.getAttributeDesc().toString(), 
                                     (byte[])ava.getAssertionValue(), 
-                                    AbstractExprNode.APPROXIMATE );
+                                    AssertionEnum.APPROXIMATE );
                             }
 
                             break;

Modified: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/filter/AbstractExprNode.java
URL: http://svn.apache.org/viewvc/directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/filter/AbstractExprNode.java?view=diff&rev=487713&r1=487712&r2=487713
==============================================================================
--- directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/filter/AbstractExprNode.java (original)
+++ directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/filter/AbstractExprNode.java Fri Dec 15 15:25:43 2006
@@ -32,47 +32,11 @@
  */
 public abstract class AbstractExprNode implements ExprNode
 {
-    /** equality assertion node */
-    public static final int EQUALITY = 0;
-
-    /** presence assertion node */
-    public static final int PRESENCE = 1;
-
-    /** substring match assertion node */
-    public static final int SUBSTRING = 2;
-
-    /** greater than or equal to assertion node */
-    public static final int GREATEREQ = 3;
-
-    /** less than or equal to assertion node */
-    public static final int LESSEQ = 4;
-
-    /** approximate assertion node */
-    public static final int APPROXIMATE = 5;
-
-    /** extensible match assertion node */
-    public static final int EXTENSIBLE = 6;
-
-    /** scope assertion node */
-    public static final int SCOPE = 7;
-
-    /** Predicate assertion node */
-    public static final int ASSERTION = 8;
-
-    /** OR operator constant */
-    public static final int OR = 9;
-
-    /** AND operator constant */
-    public static final int AND = 10;
-
-    /** NOT operator constant */
-    public static final int NOT = 11;
-
     /** The map of annotations */
-    private Map m_annotations;
+    private Map<String, Object> annotations;
 
     /** node type set to enumation of constants */
-    private final int m_assertionType;
+    private final AssertionEnum assertionType;
 
 
     /**
@@ -81,65 +45,23 @@
      * @param a_type
      *            the type of this leaf node
      */
-    protected AbstractExprNode(int a_type)
+    protected AbstractExprNode( AssertionEnum type)
     {
-        m_assertionType = a_type;
-
-        switch ( m_assertionType )
-        {
-            case ( APPROXIMATE ):
-                break;
-
-            case ( EQUALITY ):
-                break;
-
-            case ( EXTENSIBLE ):
-                break;
-
-            case ( GREATEREQ ):
-                break;
-
-            case ( LESSEQ ):
-                break;
-
-            case ( PRESENCE ):
-                break;
-
-            case ( SUBSTRING ):
-                break;
-
-            case ( SCOPE ):
-                break;
-
-            case ( ASSERTION ):
-                break;
-
-            case ( OR ):
-                break;
-
-            case ( AND ):
-                break;
-
-            case ( NOT ):
-                break;
-
-            default:
-                throw new IllegalArgumentException( "Attribute value assertion type is undefined." );
-        }
+        assertionType = type;
     }
 
 
     /**
      * @see org.apache.directory.shared.ldap.filter.ExprNode#get(java.lang.Object)
      */
-    public Object get( Object a_key )
+    public Object get( Object key )
     {
-        if ( null == getAnnotations() )
+        if ( null == annotations )
         {
             return null;
         }
 
-        return getAnnotations().get( a_key );
+        return annotations.get( key );
     }
 
 
@@ -147,14 +69,14 @@
      * @see org.apache.directory.shared.ldap.filter.ExprNode#set(java.lang.Object,
      *      java.lang.Object)
      */
-    public void set( Object a_key, Object a_value )
+    public void set( String key, Object value )
     {
-        if ( null == getAnnotations() )
+        if ( null == annotations )
         {
-            m_annotations = new HashMap( 2 );
+            annotations = new HashMap<String, Object>( 2 );
         }
 
-        getAnnotations().put( a_key, a_value );
+        annotations.put( key, value );
     }
 
 
@@ -165,7 +87,7 @@
      */
     protected Map getAnnotations()
     {
-        return m_annotations;
+        return annotations;
     }
 
 
@@ -174,9 +96,9 @@
      * 
      * @return the assertion or node type
      */
-    public final int getAssertionType()
+    public AssertionEnum getAssertionType()
     {
-        return m_assertionType;
+        return assertionType;
     }
 
 
@@ -188,44 +110,44 @@
      * @return the string representation
      * TODO Refactor these classes to use an enumeration type
      */
-    public static final String getOperationString( int a_assertionType )
+    public static final String getOperationString( AssertionEnum assertionType )
     {
-        String l_opstr = null;
+        String opstr = null;
 
-        switch ( a_assertionType )
+        switch ( assertionType )
         {
-            case ( APPROXIMATE ):
-                l_opstr = "~=";
+            case APPROXIMATE :
+                opstr = "~=";
 
                 break;
 
-            case ( EQUALITY ):
-                l_opstr = "=";
+            case EQUALITY :
+                opstr = "=";
 
                 break;
 
-            case ( EXTENSIBLE ):
-                l_opstr = "extensible";
+            case EXTENSIBLE :
+                opstr = "extensible";
 
                 break;
 
-            case ( GREATEREQ ):
-                l_opstr = ">=";
+            case GREATEREQ :
+                opstr = ">=";
 
                 break;
 
-            case ( LESSEQ ):
-                l_opstr = "<=";
+            case LESSEQ :
+                opstr = "<=";
 
                 break;
 
-            case ( PRESENCE ):
-                l_opstr = "=*";
+            case PRESENCE :
+                opstr = "=*";
 
                 break;
 
-            case ( SUBSTRING ):
-                l_opstr = "=";
+            case SUBSTRING :
+                opstr = "=";
 
                 break;
 
@@ -233,7 +155,7 @@
                 throw new IllegalArgumentException( "Attribute value assertion type is undefined." );
         }
 
-        return l_opstr;
+        return opstr;
     }
 
 
@@ -261,20 +183,21 @@
 
         AbstractExprNode otherExprNode = ( AbstractExprNode ) other;
 
-        if ( otherExprNode.getAssertionType() != m_assertionType )
+        if ( otherExprNode.getAssertionType() != assertionType )
         {
             return false;
         }
 
-        Map otherAnnotations = otherExprNode.getAnnotations();
+        Map otherAnnotations = otherExprNode.annotations;
 
-        if ( otherAnnotations == m_annotations )
+        if ( otherAnnotations == annotations )
         {
             return true;
         }
 
         // return true if both are non-null and equals() is true
 
-        return ( ( null != m_annotations && null != otherAnnotations ) && m_annotations.equals( otherAnnotations ) );
+        return ( ( null != annotations ) && ( null != otherAnnotations ) && 
+        		annotations.equals( otherAnnotations ) );
     }
 }

Modified: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/filter/AssertionNode.java
URL: http://svn.apache.org/viewvc/directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/filter/AssertionNode.java?view=diff&rev=487713&r1=487712&r2=487713
==============================================================================
--- directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/filter/AssertionNode.java (original)
+++ directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/filter/AssertionNode.java Fri Dec 15 15:25:43 2006
@@ -75,7 +75,7 @@
      */
     public AssertionNode(Assertion a_assertion, String a_desc)
     {
-        super( ASSERTION );
+        super( AssertionEnum.ASSERTION );
         m_desc = a_desc;
         m_assertion = a_assertion;
 



Mime
View raw message