directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r414062 - in /directory/trunks/apacheds: core-unit/src/test/java/org/apache/directory/server/core/trigger/ core/src/main/java/org/apache/directory/server/core/ core/src/main/java/org/apache/directory/server/core/configuration/ core/src/main...
Date Wed, 14 Jun 2006 04:15:22 GMT
Author: akarasulu
Date: Tue Jun 13 21:15:22 2006
New Revision: 414062

URL: http://svn.apache.org/viewvc?rev=414062&view=rev
Log:
fixed breakage in build due to merge of normalization optimiization branch

Modified:
    directory/trunks/apacheds/core-unit/src/test/java/org/apache/directory/server/core/trigger/DefaulTriggerServiceTest.java
    directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java
    directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/configuration/StartupConfiguration.java
    directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/schema/bootstrap/BootstrapAttributeTypeRegistry.java
    directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/schema/global/GlobalAttributeTypeRegistry.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/trigger/DeleteStoredProcedureParameterInjector.java
    directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/trigger/TriggerService.java
    directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/trigger/TriggerSpecCache.java
    directory/trunks/apacheds/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/extended/StoredProcedureExtendedOperationHandler.java
    directory/trunks/apacheds/server-jndi/src/main/java/org/apache/directory/server/jndi/ServerContextFactory.java

Modified: directory/trunks/apacheds/core-unit/src/test/java/org/apache/directory/server/core/trigger/DefaulTriggerServiceTest.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/core-unit/src/test/java/org/apache/directory/server/core/trigger/DefaulTriggerServiceTest.java?rev=414062&r1=414061&r2=414062&view=diff
==============================================================================
--- directory/trunks/apacheds/core-unit/src/test/java/org/apache/directory/server/core/trigger/DefaulTriggerServiceTest.java
(original)
+++ directory/trunks/apacheds/core-unit/src/test/java/org/apache/directory/server/core/trigger/DefaulTriggerServiceTest.java
Tue Jun 13 21:15:22 2006
@@ -24,7 +24,7 @@
 import javax.naming.directory.BasicAttribute;
 import javax.naming.directory.BasicAttributes;
 
-import org.apache.directory.shared.ldap.name.LdapName;
+import org.apache.directory.shared.ldap.name.LdapDN;
 
 
 /**
@@ -49,7 +49,7 @@
         objectClass.add( "organizationalUnit" );
         sysRoot.createSubcontext( "ou=testou", testEntry );
         
-        addEntryTrigger( new LdapName( "ou=testou" ), "AFTER delete CALL \"Audit.userDeletedAnEntry\"
( $deletedEntry, $operationPrincipal )" );
+        addEntryTrigger( new LdapDN( "ou=testou" ), "AFTER delete CALL \"Audit.userDeletedAnEntry\"
( $deletedEntry, $operationPrincipal )" );
         
         sysRoot.destroySubcontext( "ou=testou" );
 

Modified: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java?rev=414062&r1=414061&r2=414062&view=diff
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java
(original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java
Tue Jun 13 21:15:22 2006
@@ -40,6 +40,7 @@
 import org.apache.directory.server.core.schema.AttributeTypeRegistry;
 import org.apache.directory.server.core.schema.bootstrap.BootstrapRegistries;
 import org.apache.directory.server.core.schema.bootstrap.BootstrapSchemaLoader;
+import org.apache.directory.server.core.schema.global.GlobalRegistries;
 import org.apache.directory.shared.ldap.exception.LdapAuthenticationNotSupportedException;
 import org.apache.directory.shared.ldap.exception.LdapConfigurationException;
 import org.apache.directory.shared.ldap.exception.LdapNoPermissionException;

Modified: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/configuration/StartupConfiguration.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/configuration/StartupConfiguration.java?rev=414062&r1=414061&r2=414062&view=diff
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/configuration/StartupConfiguration.java
(original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/configuration/StartupConfiguration.java
Tue Jun 13 21:15:22 2006
@@ -41,7 +41,14 @@
 import org.apache.directory.server.core.operational.OperationalAttributeService;
 import org.apache.directory.server.core.referral.ReferralService;
 import org.apache.directory.server.core.schema.SchemaService;
-import org.apache.directory.server.core.schema.bootstrap.*;
+import org.apache.directory.server.core.schema.bootstrap.ApacheSchema;
+import org.apache.directory.server.core.schema.bootstrap.BootstrapSchema;
+import org.apache.directory.server.core.schema.bootstrap.CollectiveSchema;
+import org.apache.directory.server.core.schema.bootstrap.CoreSchema;
+import org.apache.directory.server.core.schema.bootstrap.CosineSchema;
+import org.apache.directory.server.core.schema.bootstrap.InetorgpersonSchema;
+import org.apache.directory.server.core.schema.bootstrap.JavaSchema;
+import org.apache.directory.server.core.schema.bootstrap.SystemSchema;
 import org.apache.directory.server.core.subtree.SubentryService;
 import org.apache.directory.server.core.trigger.TriggerService;
 import org.apache.directory.shared.ldap.ldif.Entry;

Modified: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/schema/bootstrap/BootstrapAttributeTypeRegistry.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/schema/bootstrap/BootstrapAttributeTypeRegistry.java?rev=414062&r1=414061&r2=414062&view=diff
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/schema/bootstrap/BootstrapAttributeTypeRegistry.java
(original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/schema/bootstrap/BootstrapAttributeTypeRegistry.java
Tue Jun 13 21:15:22 2006
@@ -30,8 +30,6 @@
 import org.apache.directory.shared.ldap.schema.MatchingRule;
 import org.apache.directory.shared.ldap.schema.NoOpNormalizer;
 import org.apache.directory.shared.ldap.schema.OidNormalizer;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;

Modified: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/schema/global/GlobalAttributeTypeRegistry.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/schema/global/GlobalAttributeTypeRegistry.java?rev=414062&r1=414061&r2=414062&view=diff
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/schema/global/GlobalAttributeTypeRegistry.java
(original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/schema/global/GlobalAttributeTypeRegistry.java
Tue Jun 13 21:15:22 2006
@@ -17,6 +17,7 @@
 package org.apache.directory.server.core.schema.global;
 
 
+import java.util.Collections;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.Map;
@@ -27,9 +28,9 @@
 import org.apache.directory.server.core.schema.OidRegistry;
 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;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 
 /**
@@ -40,8 +41,6 @@
  */
 public class GlobalAttributeTypeRegistry implements AttributeTypeRegistry
 {
-    /** static class logger */
-    private final static Logger log = LoggerFactory.getLogger( GlobalAttributeTypeRegistry.class
);
     /** maps an OID to an AttributeType */
     private final Map byOid;
     /** maps an OID to a schema name*/
@@ -50,6 +49,8 @@
     private final OidRegistry oidRegistry;
     /** the underlying bootstrap registry to delegate on misses to */
     private BootstrapAttributeTypeRegistry bootstrap;
+    /** cached normalizer mapping */
+    private transient Map mapping;
 
 
     // ------------------------------------------------------------------------
@@ -67,6 +68,7 @@
     {
         this.byOid = new HashMap();
         this.oidToSchema = new HashMap();
+
         this.oidRegistry = oidRegistry;
         if ( this.oidRegistry == null )
         {
@@ -85,7 +87,6 @@
     // Service Methods
     // ------------------------------------------------------------------------
 
-    
     public void register( String schema, AttributeType attributeType ) throws NamingException
     {
         if ( byOid.containsKey( attributeType.getOid() ) || bootstrap.hasAttributeType( attributeType.getOid()
) )
@@ -103,9 +104,23 @@
 
         oidToSchema.put( attributeType.getOid(), schema );
         byOid.put( attributeType.getOid(), attributeType );
-        if ( log.isDebugEnabled() )
+        
+        // update the cached normalizer mapping
+        if ( mapping == null )
+        {
+            Map bootstrapMapping = bootstrap.getNormalizerMapping();
+            mapping = new HashMap( bootstrapMapping.size() );
+            mapping.putAll( bootstrapMapping );
+        }
+        
+        Normalizer normalizer = attributeType.getEquality().getNormalizer();
+        OidNormalizer oidNormalizer = new OidNormalizer( attributeType.getOid(), normalizer
);
+        mapping.put( attributeType.getOid(), oidNormalizer );
+        String[] aliases = attributeType.getNames();
+        for ( int jj = 0; jj < aliases.length; jj++ )
         {
-            log.debug( "registered attributeType: " + attributeType );
+            mapping.put( aliases[jj], oidNormalizer );
+            mapping.put( aliases[jj].toLowerCase(), oidNormalizer );
         }
     }
 
@@ -127,10 +142,6 @@
             attributeType = bootstrap.lookup( id );
         }
 
-        if ( log.isDebugEnabled() )
-        {
-            log.debug( "looked up attributeType " + attributeType + " with id '" + id + "'"
);
-        }
         return attributeType;
     }
 
@@ -175,5 +186,29 @@
     {
         return new JoinIterator( new Iterator[]
             { byOid.values().iterator(), bootstrap.list() } );
+    }
+    
+    
+    public Map getNormalizerMapping() throws NamingException
+    {
+        if ( mapping == null )
+        {
+            Map bootstrapMapping = bootstrap.getNormalizerMapping();
+            mapping = new HashMap( ( byOid.size() << 1 ) + bootstrapMapping.size()
);
+            mapping.putAll( bootstrapMapping );
+            for ( Iterator ii = byOid.values().iterator(); ii.hasNext(); /**/ )
+            {
+                AttributeType type = ( AttributeType ) ii.next();
+                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], oidNormalizer );
+                    mapping.put( aliases[jj].toLowerCase(), oidNormalizer );
+                }
+            }
+        }
+        return Collections.unmodifiableMap( mapping );
     }
 }

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?rev=414062&r1=414061&r2=414062&view=diff
==============================================================================
--- 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
Tue Jun 13 21:15:22 2006
@@ -29,7 +29,8 @@
 import org.apache.directory.shared.ldap.filter.BranchNode;
 import org.apache.directory.shared.ldap.filter.LeafNode;
 import org.apache.directory.shared.ldap.filter.SimpleNode;
-import org.apache.directory.shared.ldap.name.LdapName;
+import org.apache.directory.shared.ldap.name.LdapDN;
+
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -80,7 +81,7 @@
                 currentSearchContextName = ( String ) searchContexts.next();
                 currentSearchContext = ( ServerLdapContext ) RootDSE.lookup( currentSearchContextName
);
                 
-                javaClassEntries = currentSearchContext.search( new LdapName(), filter, controls
);
+                javaClassEntries = currentSearchContext.search( LdapDN.EMPTY_LDAPDN, filter,
controls );
                 if ( javaClassEntries.hasMore() ) // there should be only one!
                 {
                     SearchResult javaClassEntry = ( SearchResult ) javaClassEntries.next();

Modified: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/trigger/DeleteStoredProcedureParameterInjector.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/trigger/DeleteStoredProcedureParameterInjector.java?rev=414062&r1=414061&r2=414062&view=diff
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/trigger/DeleteStoredProcedureParameterInjector.java
(original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/trigger/DeleteStoredProcedureParameterInjector.java
Tue Jun 13 21:15:22 2006
@@ -17,18 +17,20 @@
 
 package org.apache.directory.server.core.trigger;
 
+
 import java.util.Map;
 
-import javax.naming.Name;
 import javax.naming.NamingException;
 import javax.naming.directory.Attributes;
 
 import org.apache.directory.server.core.partition.DirectoryPartitionNexusProxy;
+import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.trigger.StoredProcedureParameter.DeleteStoredProcedureParameter;
 
+
 public class DeleteStoredProcedureParameterInjector extends AbstractStoredProcedureParameterInjector
 {
-    private Name deletedEntryName;
+    private LdapDN deletedEntryName;
     
     private Map injectors;
     
@@ -39,7 +41,7 @@
         injectors.put( DeleteStoredProcedureParameter.DELETED_ENTRY, $deletedEntryInjector
);
     }
     
-    public void setDeletedEntryName( Name deletedEntryName )
+    public void setDeletedEntryName( LdapDN deletedEntryName )
     {
         this.deletedEntryName = deletedEntryName;
     }

Modified: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/trigger/TriggerService.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/trigger/TriggerService.java?rev=414062&r1=414061&r2=414062&view=diff
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/trigger/TriggerService.java
(original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/trigger/TriggerService.java
Tue Jun 13 21:15:22 2006
@@ -25,9 +25,7 @@
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
-import java.util.Map.Entry;
 
-import javax.naming.Name;
 import javax.naming.NamingException;
 import javax.naming.directory.Attribute;
 import javax.naming.directory.Attributes;
@@ -36,21 +34,21 @@
 import org.apache.directory.server.core.authn.LdapPrincipal;
 import org.apache.directory.server.core.configuration.InterceptorConfiguration;
 import org.apache.directory.server.core.interceptor.BaseInterceptor;
-import org.apache.directory.server.core.interceptor.InterceptorChain;
 import org.apache.directory.server.core.interceptor.NextInterceptor;
 import org.apache.directory.server.core.invocation.Invocation;
 import org.apache.directory.server.core.invocation.InvocationStack;
 import org.apache.directory.server.core.jndi.ServerContext;
 import org.apache.directory.server.core.partition.DirectoryPartitionNexusProxy;
 import org.apache.directory.server.core.schema.AttributeTypeRegistry;
-import org.apache.directory.server.core.schema.ConcreteNameComponentNormalizer;
 import org.apache.directory.shared.ldap.exception.LdapNamingException;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
-import org.apache.directory.shared.ldap.name.DnParser;
+import org.apache.directory.shared.ldap.name.LdapDN;
+import org.apache.directory.shared.ldap.schema.NormalizerMappingResolver;
 import org.apache.directory.shared.ldap.trigger.ActionTime;
 import org.apache.directory.shared.ldap.trigger.LdapOperation;
 import org.apache.directory.shared.ldap.trigger.TriggerSpecification;
 import org.apache.directory.shared.ldap.trigger.TriggerSpecificationParser;
+
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -80,10 +78,6 @@
     private TriggerSpecCache triggerSpecCache;
     /** a normalizing Trigger Specification parser */
     private TriggerSpecificationParser triggerParser;
-    /** a normalizing Distinguished Name parser */
-    private DnParser dnParser;
-    /** the interceptor chain */
-    private InterceptorChain chain;
     /** the attribute type registry */
     private AttributeTypeRegistry attrRegistry;
     /** whether or not this interceptor is activated */
@@ -103,7 +97,7 @@
      * @throws NamingException if there are problems accessing attribute values
      */
     private void addPrescriptiveTriggerSpecs( List triggerSpecs, DirectoryPartitionNexusProxy
proxy,
-        Name dn, Attributes entry ) throws NamingException
+        LdapDN dn, Attributes entry ) throws NamingException
     {
         
         /*
@@ -117,7 +111,7 @@
          */
         if ( entry.get( "objectClass" ).contains( "subentry" ) )
         {
-            Name parentDn = ( Name ) dn.clone();
+            LdapDN parentDn = ( LdapDN ) dn.clone();
             parentDn.remove( dn.size() - 1 );
             entry = proxy.lookup( parentDn, DirectoryPartitionNexusProxy.LOOKUP_BYPASS );
         }
@@ -240,45 +234,51 @@
         super.init( dirServCfg, intCfg );
         triggerSpecCache = new TriggerSpecCache( dirServCfg );
         attrRegistry = dirServCfg.getGlobalRegistries().getAttributeTypeRegistry();
-        triggerParser = new TriggerSpecificationParser( new ConcreteNameComponentNormalizer(
attrRegistry ) );
-        dnParser = new DnParser( new ConcreteNameComponentNormalizer( attrRegistry ) );
-        chain = dirServCfg.getInterceptorChain();
+        triggerParser = new TriggerSpecificationParser( new NormalizerMappingResolver()
+            {
+                public Map getNormalizerMapping() throws NamingException
+                {
+                    return attrRegistry.getNormalizerMapping();
+                }
+            });
         this.enabled = true; // TODO: get this from the configuration if needed
     }
 
 
-    public void add( NextInterceptor next, String upName, Name normName, Attributes entry
) throws NamingException
+    public void add( NextInterceptor next, LdapDN normName, Attributes entry ) throws NamingException
     {
         // Access the principal requesting the operation
         Invocation invocation = InvocationStack.getInstance().peek();
         LdapPrincipal principal = ( ( ServerContext ) invocation.getCaller() ).getPrincipal();
-        Name userName = dnParser.parse( principal.getName() );
+        LdapDN userName = new LdapDN( principal.getName() );
+        userName.normalize();
 
         // Bypass trigger code if we are disabled
         if ( !enabled )
         {
-            next.add( upName, normName, entry );
+            next.add( normName, entry );
             return;
         }
         
         /**
          * 
          */
-        next.add( upName, normName, entry );
+        next.add( normName, entry );
         
         triggerSpecCache.subentryAdded( normName, entry );
         
     }
 
 
-    public void delete( NextInterceptor next, Name name ) throws NamingException
+    public void delete( NextInterceptor next, LdapDN name ) throws NamingException
     {
         // Access the principal requesting the operation
         Invocation invocation = InvocationStack.getInstance().peek();
         DirectoryPartitionNexusProxy proxy = invocation.getProxy();
         Attributes entry = proxy.lookup( name, DirectoryPartitionNexusProxy.LOOKUP_BYPASS
);
         LdapPrincipal principal = ( ( ServerContext ) invocation.getCaller() ).getPrincipal();
-        Name userName = dnParser.parse( principal.getName() );
+        LdapDN userName = new LdapDN( principal.getName() );
+        userName.normalize();
 
         // Bypass trigger code if we are disabled
         if ( !enabled )
@@ -317,5 +317,4 @@
         log.debug( "There are " + afterTriggerSpecs.size() + " \"AFTER delete\" triggers
associated with this entry [" + name + "] being deleted:" );
         log.debug( ">>> " + afterTriggerSpecs );
     }
-
 }

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?rev=414062&r1=414061&r2=414062&view=diff
==============================================================================
--- 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
Tue Jun 13 21:15:22 2006
@@ -27,7 +27,6 @@
 import java.util.List;
 import java.util.Map;
 
-import javax.naming.Name;
 import javax.naming.NamingEnumeration;
 import javax.naming.NamingException;
 import javax.naming.directory.Attribute;
@@ -39,14 +38,13 @@
 import org.apache.directory.server.core.DirectoryServiceConfiguration;
 import org.apache.directory.server.core.partition.DirectoryPartitionNexus;
 import org.apache.directory.server.core.schema.AttributeTypeRegistry;
-import org.apache.directory.server.core.schema.ConcreteNameComponentNormalizer;
 import org.apache.directory.shared.ldap.filter.ExprNode;
 import org.apache.directory.shared.ldap.filter.SimpleNode;
-import org.apache.directory.shared.ldap.name.DnParser;
-import org.apache.directory.shared.ldap.name.LdapName;
-import org.apache.directory.shared.ldap.name.NameComponentNormalizer;
+import org.apache.directory.shared.ldap.name.LdapDN;
+import org.apache.directory.shared.ldap.schema.NormalizerMappingResolver;
 import org.apache.directory.shared.ldap.trigger.TriggerSpecification;
 import org.apache.directory.shared.ldap.trigger.TriggerSpecificationParser;
+
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -79,8 +77,6 @@
     private final DirectoryPartitionNexus nexus;
     /** a normalizing TriggerSpecification parser */
     private final TriggerSpecificationParser triggerSpecParser;
-    /** a normalizing DN parser */
-    private final DnParser dnParser;
 
 
     /**
@@ -91,10 +87,14 @@
     public TriggerSpecCache( DirectoryServiceConfiguration dirServCfg ) throws NamingException
     {
         this.nexus = dirServCfg.getPartitionNexus();
-        AttributeTypeRegistry registry = dirServCfg.getGlobalRegistries().getAttributeTypeRegistry();
-        NameComponentNormalizer ncn = new ConcreteNameComponentNormalizer( registry );
-        triggerSpecParser = new TriggerSpecificationParser( ncn );
-        dnParser = new DnParser( ncn );
+        final AttributeTypeRegistry registry = dirServCfg.getGlobalRegistries().getAttributeTypeRegistry();
+        triggerSpecParser = new TriggerSpecificationParser( new NormalizerMappingResolver()
+            {
+                public Map getNormalizerMapping() throws NamingException
+                {
+                    return registry.getNormalizerMapping();
+                }
+            });
         env = ( Hashtable ) dirServCfg.getEnvironment().clone();
         initialize();
     }
@@ -105,11 +105,11 @@
         // search all naming contexts for trigger subentenries
         // generate TriggerSpecification arrays for each subentry
         // add that subentry to the hash
-        Iterator suffixes = nexus.listSuffixes( true );
+        Iterator suffixes = nexus.listSuffixes();
         while ( suffixes.hasNext() )
         {
             String suffix = ( String ) suffixes.next();
-            Name baseDn = new LdapName( suffix );
+            LdapDN baseDn = new LdapDN( suffix );
             ExprNode filter = new SimpleNode( OC_ATTR, TRIGGER_SUBENTRY_OC, SimpleNode.EQUALITY
);
             SearchControls ctls = new SearchControls();
             ctls.setSearchScope( SearchControls.SUBTREE_SCOPE );
@@ -125,7 +125,8 @@
                     continue;
                 }
 
-                Name normSubentryName = dnParser.parse( subentryDn );
+                LdapDN normSubentryName = new LdapDN( subentryDn );
+                normSubentryName.normalize();
                 subentryAdded( normSubentryName, result.getAttributes() );
             }
             results.close();
@@ -145,7 +146,7 @@
     }
 
 
-    public void subentryAdded( Name normName, Attributes entry ) throws NamingException
+    public void subentryAdded( LdapDN normName, Attributes entry ) throws NamingException
     {
         // only do something if the entry contains prescriptiveTrigger
         Attribute triggerSpec = entry.get( PRESCRIPTIVE_TRIGGER_ATTR );
@@ -175,7 +176,7 @@
     }
 
 
-    public void subentryDeleted( Name normName, Attributes entry ) throws NamingException
+    public void subentryDeleted( LdapDN normName, Attributes entry ) throws NamingException
     {
         if ( !hasPrescriptiveTrigger( entry ) )
         {
@@ -186,7 +187,7 @@
     }
 
 
-    public void subentryModified( Name normName, ModificationItem[] mods, Attributes entry
) throws NamingException
+    public void subentryModified( LdapDN normName, ModificationItem[] mods, Attributes entry
) throws NamingException
     {
         if ( !hasPrescriptiveTrigger( entry ) )
         {
@@ -206,7 +207,7 @@
     }
 
 
-    public void subentryModified( Name normName, int modOp, Attributes mods, Attributes entry
) throws NamingException
+    public void subentryModified( LdapDN normName, int modOp, Attributes mods, Attributes
entry ) throws NamingException
     {
         if ( !hasPrescriptiveTrigger( entry ) )
         {
@@ -232,7 +233,7 @@
     }
 
 
-    public void subentryRenamed( Name oldName, Name newName )
+    public void subentryRenamed( LdapDN oldName, LdapDN newName )
     {
         triggerSpecs.put( newName.toString(), triggerSpecs.remove( oldName.toString() ) );
     }

Modified: directory/trunks/apacheds/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/extended/StoredProcedureExtendedOperationHandler.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/extended/StoredProcedureExtendedOperationHandler.java?rev=414062&r1=414061&r2=414062&view=diff
==============================================================================
--- directory/trunks/apacheds/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/extended/StoredProcedureExtendedOperationHandler.java
(original)
+++ directory/trunks/apacheds/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/extended/StoredProcedureExtendedOperationHandler.java
Tue Jun 13 21:15:22 2006
@@ -30,7 +30,6 @@
 import org.apache.directory.server.ldap.SessionRegistry;
 import org.apache.directory.shared.asn1.ber.Asn1Decoder;
 import org.apache.directory.shared.asn1.ber.IAsn1Container;
-import org.apache.directory.shared.asn1.codec.DecoderException;
 import org.apache.directory.shared.ldap.codec.extended.operations.StoredProcedure;
 import org.apache.directory.shared.ldap.codec.extended.operations.StoredProcedureContainer;
 import org.apache.directory.shared.ldap.codec.extended.operations.StoredProcedureDecoder;
@@ -81,7 +80,7 @@
         {
             storedProcedureDecoder.decode( stream, storedProcedureContainer );
         }
-        catch (DecoderException de)
+        catch ( Exception de )
         {
             de.printStackTrace();
         }

Modified: directory/trunks/apacheds/server-jndi/src/main/java/org/apache/directory/server/jndi/ServerContextFactory.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/server-jndi/src/main/java/org/apache/directory/server/jndi/ServerContextFactory.java?rev=414062&r1=414061&r2=414062&view=diff
==============================================================================
--- directory/trunks/apacheds/server-jndi/src/main/java/org/apache/directory/server/jndi/ServerContextFactory.java
(original)
+++ directory/trunks/apacheds/server-jndi/src/main/java/org/apache/directory/server/jndi/ServerContextFactory.java
Tue Jun 13 21:15:22 2006
@@ -59,10 +59,11 @@
 import org.apache.mina.common.IoFilterChainBuilder;
 import org.apache.mina.common.IoSession;
 import org.apache.mina.common.WriteFuture;
-import org.apache.mina.filter.ThreadPoolFilter;
+import org.apache.mina.filter.thread.ThreadPoolFilter;
 import org.apache.mina.transport.socket.nio.DatagramAcceptor;
 import org.apache.mina.transport.socket.nio.SocketAcceptor;
 import org.apache.mina.transport.socket.nio.SocketAcceptorConfig;
+
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 



Mime
View raw message