directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r412102 - in /directory/branches/apacheds/optimization/core/src: main/java/org/apache/directory/server/core/schema/ main/java/org/apache/directory/server/core/schema/bootstrap/ test/java/org/apache/directory/server/core/authz/support/ test/...
Date Tue, 06 Jun 2006 11:51:07 GMT
Author: akarasulu
Date: Tue Jun  6 04:51:06 2006
New Revision: 412102

URL: http://svn.apache.org/viewvc?rev=412102&view=rev
Log:
started using OidNormalizer in attribute type registries for the Normalizer mappings

Modified:
    directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/schema/GlobalAttributeTypeRegistry.java
    directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/schema/bootstrap/BootstrapAttributeTypeRegistry.java
    directory/branches/apacheds/optimization/core/src/test/java/org/apache/directory/server/core/authz/support/RelatedProtectedItemFilterTest.java
    directory/branches/apacheds/optimization/core/src/test/java/org/apache/directory/server/core/authz/support/RelatedUserClassFilterTest.java
    directory/branches/apacheds/optimization/core/src/test/java/org/apache/directory/server/core/referral/ReferralLutTest.java

Modified: directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/schema/GlobalAttributeTypeRegistry.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/schema/GlobalAttributeTypeRegistry.java?rev=412102&r1=412101&r2=412102&view=diff
==============================================================================
--- directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/schema/GlobalAttributeTypeRegistry.java
(original)
+++ directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/schema/GlobalAttributeTypeRegistry.java
Tue Jun  6 04:51:06 2006
@@ -27,6 +27,7 @@
 import org.apache.directory.server.core.schema.bootstrap.BootstrapAttributeTypeRegistry;
 import org.apache.directory.shared.ldap.schema.AttributeType;
 import org.apache.directory.shared.ldap.schema.Normalizer;
+import org.apache.directory.shared.ldap.schema.OidNormalizer;
 import org.apache.directory.shared.ldap.util.JoinIterator;
 
 
@@ -127,11 +128,12 @@
         }
         
         Normalizer normalizer = attributeType.getEquality().getNormalizer();
-        mapping.put( attributeType.getOid(), normalizer );
+        OidNormalizer oidNormalizer = new OidNormalizer( attributeType.getOid(), normalizer
);
+        mapping.put( attributeType.getOid(), oidNormalizer );
         String[] aliases = attributeType.getNames();
         for ( int jj = 0; jj < aliases.length; jj++ )
         {
-            mapping.put( aliases[jj], normalizer );
+            mapping.put( aliases[jj], oidNormalizer );
         }
     }
 
@@ -212,12 +214,12 @@
             for ( Iterator ii = byOid.values().iterator(); ii.hasNext(); /**/ )
             {
                 AttributeType type = ( AttributeType ) ii.next();
-                Normalizer normalizer = type.getEquality().getNormalizer();
-                mapping.put( type.getOid(), normalizer );
+                OidNormalizer oidNormalizer = new OidNormalizer( type.getOid(), type.getEquality().getNormalizer()
);
+                mapping.put( type.getOid(), oidNormalizer );
                 String[] aliases = type.getNames();
                 for ( int jj = 0; jj < aliases.length; jj++ )
                 {
-                    mapping.put( aliases[jj], normalizer );
+                    mapping.put( aliases[jj], oidNormalizer );
                 }
             }
         }

Modified: directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/schema/bootstrap/BootstrapAttributeTypeRegistry.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/schema/bootstrap/BootstrapAttributeTypeRegistry.java?rev=412102&r1=412101&r2=412102&view=diff
==============================================================================
--- directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/schema/bootstrap/BootstrapAttributeTypeRegistry.java
(original)
+++ directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/schema/bootstrap/BootstrapAttributeTypeRegistry.java
Tue Jun  6 04:51:06 2006
@@ -31,7 +31,7 @@
 import org.apache.directory.shared.ldap.schema.AttributeType;
 import org.apache.directory.shared.ldap.schema.MatchingRule;
 import org.apache.directory.shared.ldap.schema.NoOpNormalizer;
-import org.apache.directory.shared.ldap.schema.Normalizer;
+import org.apache.directory.shared.ldap.schema.OidNormalizer;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -172,27 +172,24 @@
             for ( Iterator ii = byOid.values().iterator(); ii.hasNext(); /**/ )
             {
                 AttributeType type = ( AttributeType ) ii.next();
-                
                 MatchingRule matchingRule = type.getEquality();
-                
-                Normalizer normalizer = null;
+                OidNormalizer oidNormalizer = null;
                 
                 if ( matchingRule == null )
                 {
                     log.warn( "Attribute " + type.getName() + " does not have normalize :
using NoopNormalizer" );
-                    normalizer = new NoOpNormalizer();
+                    oidNormalizer = new OidNormalizer( type.getOid(), new NoOpNormalizer()
);
                 }
                 else
                 {
-                    normalizer = matchingRule.getNormalizer();
+                    oidNormalizer = new OidNormalizer( type.getOid(), matchingRule.getNormalizer()
);
                 }
                 
-                mapping.put( type.getOid(), normalizer );
+                mapping.put( type.getOid(), oidNormalizer );
                 String[] aliases = type.getNames();
-             
                 for ( int jj = 0; jj < aliases.length; jj++ )
                 {
-                    mapping.put( aliases[jj], normalizer );
+                    mapping.put( aliases[jj], oidNormalizer );
                 }
             }
         }

Modified: directory/branches/apacheds/optimization/core/src/test/java/org/apache/directory/server/core/authz/support/RelatedProtectedItemFilterTest.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/optimization/core/src/test/java/org/apache/directory/server/core/authz/support/RelatedProtectedItemFilterTest.java?rev=412102&r1=412101&r2=412102&view=diff
==============================================================================
--- directory/branches/apacheds/optimization/core/src/test/java/org/apache/directory/server/core/authz/support/RelatedProtectedItemFilterTest.java
(original)
+++ directory/branches/apacheds/optimization/core/src/test/java/org/apache/directory/server/core/authz/support/RelatedProtectedItemFilterTest.java
Tue Jun  6 04:51:06 2006
@@ -25,7 +25,6 @@
 import java.util.HashSet;
 import java.util.Set;
 
-import javax.naming.Name;
 import javax.naming.NamingException;
 import javax.naming.directory.Attributes;
 import javax.naming.directory.BasicAttribute;
@@ -48,7 +47,6 @@
 import org.apache.directory.shared.ldap.aci.ProtectedItem.MaxValueCountItem;
 import org.apache.directory.shared.ldap.aci.ProtectedItem.RestrictedByItem;
 import org.apache.directory.shared.ldap.filter.PresenceNode;
-import org.apache.directory.shared.ldap.name.LdapName;
 import org.apache.directory.shared.ldap.name.LdapDN;
 
 

Modified: directory/branches/apacheds/optimization/core/src/test/java/org/apache/directory/server/core/authz/support/RelatedUserClassFilterTest.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/optimization/core/src/test/java/org/apache/directory/server/core/authz/support/RelatedUserClassFilterTest.java?rev=412102&r1=412101&r2=412102&view=diff
==============================================================================
--- directory/branches/apacheds/optimization/core/src/test/java/org/apache/directory/server/core/authz/support/RelatedUserClassFilterTest.java
(original)
+++ directory/branches/apacheds/optimization/core/src/test/java/org/apache/directory/server/core/authz/support/RelatedUserClassFilterTest.java
Tue Jun  6 04:51:06 2006
@@ -25,7 +25,6 @@
 import java.util.HashSet;
 import java.util.Set;
 
-import javax.naming.Name;
 import javax.naming.NamingException;
 
 import junit.framework.Assert;
@@ -37,7 +36,6 @@
 import org.apache.directory.shared.ldap.aci.ACITuple;
 import org.apache.directory.shared.ldap.aci.AuthenticationLevel;
 import org.apache.directory.shared.ldap.aci.UserClass;
-import org.apache.directory.shared.ldap.name.LdapName;
 import org.apache.directory.shared.ldap.name.LdapDN;
 
 
@@ -123,7 +121,7 @@
             AuthenticationLevel.NONE, null, null, null, null, null ).size() );
 
         Set wrongGroupNames = new HashSet();
-        wrongGroupNames.add( new LdapName( "ou=unrelatedgroup" ) );
+        wrongGroupNames.add( new LdapDN( "ou=unrelatedgroup" ) );
 
         Assert.assertEquals( 0, filter.filter( tuples, OperationScope.ENTRY, null, wrongGroupNames,
USER_NAME, null,
             AuthenticationLevel.NONE, USER_NAME, null, null, null, null ).size() );
@@ -186,7 +184,7 @@
             Set names = new HashSet();
             try
             {
-                names.add( new LdapName( "dummy=dummy" ) );
+                names.add( new LdapDN( "dummy=dummy" ) );
             }
             catch ( NamingException e )
             {

Modified: directory/branches/apacheds/optimization/core/src/test/java/org/apache/directory/server/core/referral/ReferralLutTest.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/optimization/core/src/test/java/org/apache/directory/server/core/referral/ReferralLutTest.java?rev=412102&r1=412101&r2=412102&view=diff
==============================================================================
--- directory/branches/apacheds/optimization/core/src/test/java/org/apache/directory/server/core/referral/ReferralLutTest.java
(original)
+++ directory/branches/apacheds/optimization/core/src/test/java/org/apache/directory/server/core/referral/ReferralLutTest.java
Tue Jun  6 04:51:06 2006
@@ -17,11 +17,9 @@
 package org.apache.directory.server.core.referral;
 
 
-import javax.naming.Name;
 import javax.naming.NamingException;
 
 import org.apache.directory.server.core.referral.ReferralLut;
-import org.apache.directory.shared.ldap.name.LdapName;
 import org.apache.directory.shared.ldap.name.LdapDN;
 
 import junit.framework.TestCase;



Mime
View raw message