directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r607412 [3/4] - in /directory: apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/ apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authn/ apacheds/branches/bigbang/core/src/main/java/...
Date Sat, 29 Dec 2007 11:42:44 GMT
Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/PartitionSchemaLoader.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/PartitionSchemaLoader.java?rev=607412&r1=607411&r2=607412&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/PartitionSchemaLoader.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/PartitionSchemaLoader.java Sat Dec 29 03:42:29 2007
@@ -81,7 +81,13 @@
     private final SchemaPartitionDao dao;
     private SchemaEntityFactory factory;
     private Partition partition;
-    private AttributeTypeRegistry attrRegistry;
+    
+    /** The attributeType registry */
+    private AttributeTypeRegistry atRegistry;
+    
+    /** The global registries */
+    private Registries registries;
+    
     private final AttributeType mOidAT;
     private final AttributeType mNameAT;
     private final AttributeType cnAT;
@@ -97,19 +103,20 @@
     private static Map<String, LdapDN> staticSyntaxCheckersDNs = new HashMap<String, LdapDN>();
     private static Map<String, LdapDN> staticSyntaxesDNs = new HashMap<String, LdapDN>();
     
-    public PartitionSchemaLoader( Partition partition, Registries bootstrapRegistries ) throws NamingException
+    public PartitionSchemaLoader( Partition partition, Registries registries ) throws NamingException
     {
-        this.factory = new SchemaEntityFactory( bootstrapRegistries );
+        this.factory = new SchemaEntityFactory( registries );
         this.partition = partition;
-        this.attrRegistry = bootstrapRegistries.getAttributeTypeRegistry();
+        this.registries = registries;
+        atRegistry = registries.getAttributeTypeRegistry();
         
-        this.dao = new SchemaPartitionDao( this.partition, bootstrapRegistries );
-        this.mOidAT = bootstrapRegistries.getAttributeTypeRegistry().lookup( MetaSchemaConstants.M_OID_AT );
-        this.mNameAT = bootstrapRegistries.getAttributeTypeRegistry().lookup( MetaSchemaConstants.M_NAME_AT );
-        this.cnAT = bootstrapRegistries.getAttributeTypeRegistry().lookup( SchemaConstants.CN_AT );
-        this.byteCodeAT = bootstrapRegistries.getAttributeTypeRegistry().lookup( MetaSchemaConstants.M_BYTECODE_AT );
-        this.descAT = bootstrapRegistries.getAttributeTypeRegistry().lookup( MetaSchemaConstants.M_DESCRIPTION_AT );
-        this.fqcnAT = bootstrapRegistries.getAttributeTypeRegistry().lookup( MetaSchemaConstants.M_FQCN_AT );
+        dao = new SchemaPartitionDao( this.partition, registries );
+        mOidAT = atRegistry.lookup( MetaSchemaConstants.M_OID_AT );
+        mNameAT = atRegistry.lookup( MetaSchemaConstants.M_NAME_AT );
+        cnAT = atRegistry.lookup( SchemaConstants.CN_AT );
+        byteCodeAT = atRegistry.lookup( MetaSchemaConstants.M_BYTECODE_AT );
+        descAT = atRegistry.lookup( MetaSchemaConstants.M_DESCRIPTION_AT );
+        fqcnAT = atRegistry.lookup( MetaSchemaConstants.M_FQCN_AT );
         
         initStaticDNs( "system" );
         initStaticDNs( "core" );
@@ -127,37 +134,37 @@
         
         // Initialize AttributeType Dns
         LdapDN dn = new LdapDN( "ou=attributeTypes,cn=" + schemaName + ",ou=schema" );
-        dn.normalize( this.attrRegistry.getNormalizerMapping() );
+        dn.normalize( atRegistry.getNormalizerMapping() );
         staticAttributeTypeDNs.put( schemaName, dn );
 
         // Initialize ObjectClasses Dns
         dn = new LdapDN( "ou=objectClasses,cn=" + schemaName + ",ou=schema" );
-        dn.normalize( this.attrRegistry.getNormalizerMapping() );
+        dn.normalize( atRegistry.getNormalizerMapping() );
         staticObjectClassesDNs.put( schemaName, dn );
 
         // Initialize MatchingRules Dns
         dn = new LdapDN( "ou=matchingRules,cn=" + schemaName + ",ou=schema" );
-        dn.normalize( this.attrRegistry.getNormalizerMapping() );
+        dn.normalize( atRegistry.getNormalizerMapping() );
         staticMatchingRulesDNs.put( schemaName, dn );
 
         // Initialize Comparators Dns
         dn = new LdapDN( "ou=comparators,cn=" + schemaName + ",ou=schema" );
-        dn.normalize( this.attrRegistry.getNormalizerMapping() );
+        dn.normalize( atRegistry.getNormalizerMapping() );
         staticComparatorsDNs.put( schemaName, dn );
         
         // Initialize Normalizers Dns
         dn = new LdapDN( "ou=normalizers,cn=" + schemaName + ",ou=schema" );
-        dn.normalize( this.attrRegistry.getNormalizerMapping() );
+        dn.normalize( atRegistry.getNormalizerMapping() );
         staticNormalizersDNs.put( schemaName, dn );
 
         // Initialize SyntaxCheckers Dns
         dn = new LdapDN( "ou=syntaxCheckers,cn=" + schemaName + ",ou=schema" );
-        dn.normalize( this.attrRegistry.getNormalizerMapping() );
+        dn.normalize( atRegistry.getNormalizerMapping() );
         staticSyntaxCheckersDNs.put( schemaName, dn );
 
         // Initialize Syntaxes Dns
         dn = new LdapDN( "ou=syntaxes,cn=" + schemaName + ",ou=schema" );
-        dn.normalize( this.attrRegistry.getNormalizerMapping() );
+        dn.normalize( atRegistry.getNormalizerMapping() );
         staticSyntaxesDNs.put( schemaName, dn );
 
     }
@@ -190,10 +197,11 @@
          * OID registry.  To prevent this we need to load all the OID's in advance
          * regardless of whether they are used or not.
          */
-        NamingEnumeration ne = dao.listAllNames();
+        NamingEnumeration<SearchResult> ne = dao.listAllNames();
+        
         while ( ne.hasMore() )
         {
-            Attributes attrs = ( ( SearchResult ) ne.next() ).getAttributes();
+            Attributes attrs = ne.next().getAttributes();
             String oid = ( String ) AttributeUtils.getAttribute( attrs, mOidAT ).get();
             Attribute names = AttributeUtils.getAttribute( attrs, mNameAT );
             targetRegistries.getOidRegistry().register( oid, oid );
@@ -404,24 +412,25 @@
         if ( dn == null )
         {
             dn = new LdapDN( "ou=objectClasses,cn=" + schema.getSchemaName() + ",ou=schema" );
-            dn.normalize( this.attrRegistry.getNormalizerMapping() );
+            dn.normalize( atRegistry.getNormalizerMapping() );
             staticObjectClassesDNs.put( schema.getSchemaName(), dn );
         }
         
-        if ( ! partition.hasEntry( new EntryOperationContext( dn ) ) )
+        if ( ! partition.hasEntry( new EntryOperationContext( registries, dn ) ) )
         {
             return;
         }
         
         LOG.debug( "{} schema: loading objectClasses", schema.getSchemaName() );
         
-        NamingEnumeration list = partition.list( new ListOperationContext( dn ) );
+        NamingEnumeration<SearchResult> list = partition.list( new ListOperationContext( registries, dn ) );
+        
         while ( list.hasMore() )
         {
-            SearchResult result = ( SearchResult ) list.next();
+            SearchResult result = list.next();
             LdapDN resultDN = new LdapDN( result.getName() );
-            resultDN.normalize( attrRegistry.getNormalizerMapping() );
-            Attributes attrs = partition.lookup( new LookupOperationContext( resultDN ) );
+            resultDN.normalize( atRegistry.getNormalizerMapping() );
+            Attributes attrs = partition.lookup( new LookupOperationContext( registries, resultDN ) );
             ObjectClass oc = factory.getObjectClass( attrs, targetRegistries, schema.getSchemaName() );
             
             try
@@ -504,24 +513,25 @@
         if ( dn == null )
         {
             dn = new LdapDN( "ou=attributeTypes,cn=" + schema.getSchemaName() + ",ou=schema" );
-            dn.normalize( this.attrRegistry.getNormalizerMapping() );
+            dn.normalize( atRegistry.getNormalizerMapping() );
             staticAttributeTypeDNs.put( schema.getSchemaName(), dn );
         }
         
-        if ( ! partition.hasEntry( new EntryOperationContext( dn ) ) )
+        if ( ! partition.hasEntry( new EntryOperationContext( registries, dn ) ) )
         {
             return;
         }
         
         LOG.debug( "{} schema: loading attributeTypes", schema.getSchemaName() );
         
-        NamingEnumeration list = partition.list( new ListOperationContext( dn ) );
+        NamingEnumeration<SearchResult> list = partition.list( new ListOperationContext( registries, dn ) );
+        
         while ( list.hasMore() )
         {
-            SearchResult result = ( SearchResult ) list.next();
+            SearchResult result = list.next();
             LdapDN resultDN = new LdapDN( result.getName() );
-            resultDN.normalize( attrRegistry.getNormalizerMapping() );
-            Attributes attrs = partition.lookup( new LookupOperationContext( resultDN ) );
+            resultDN.normalize( atRegistry.getNormalizerMapping() );
+            Attributes attrs = partition.lookup( new LookupOperationContext( registries, resultDN ) );
             AttributeType at = factory.getAttributeType( attrs, targetRegistries, schema.getSchemaName() );
             try
             {
@@ -601,24 +611,25 @@
         if ( dn == null )
         {
             dn = new LdapDN( "ou=matchingRules,cn=" + schema.getSchemaName() + ",ou=schema" );
-            dn.normalize( this.attrRegistry.getNormalizerMapping() );
+            dn.normalize( atRegistry.getNormalizerMapping() );
             staticMatchingRulesDNs.put( schema.getSchemaName(), dn );
         }
         
-        if ( ! partition.hasEntry( new EntryOperationContext( dn ) ) )
+        if ( ! partition.hasEntry( new EntryOperationContext( registries, dn ) ) )
         {
             return;
         }
         
         LOG.debug( "{} schema: loading matchingRules", schema.getSchemaName() );
         
-        NamingEnumeration list = partition.list( new ListOperationContext( dn ) );
+        NamingEnumeration<SearchResult> list = partition.list( new ListOperationContext( registries, dn ) );
+        
         while ( list.hasMore() )
         {
-            SearchResult result = ( SearchResult ) list.next();
+            SearchResult result = list.next();
             LdapDN resultDN = new LdapDN( result.getName() );
-            resultDN.normalize( attrRegistry.getNormalizerMapping() );
-            Attributes attrs = partition.lookup( new LookupOperationContext( resultDN ) );
+            resultDN.normalize( atRegistry.getNormalizerMapping() );
+            Attributes attrs = partition.lookup( new LookupOperationContext( registries, resultDN ) );
             MatchingRule mrule = factory.getMatchingRule( attrs, targetRegistries, schema.getSchemaName() );
             targetRegistries.getMatchingRuleRegistry().register( mrule );
 
@@ -633,24 +644,25 @@
         if ( dn == null )
         {
             dn = new LdapDN( "ou=syntaxes,cn=" + schema.getSchemaName() + ",ou=schema" );
-            dn.normalize( this.attrRegistry.getNormalizerMapping() );
+            dn.normalize( atRegistry.getNormalizerMapping() );
             staticSyntaxesDNs.put( schema.getSchemaName(), dn );
         }
         
-        if ( ! partition.hasEntry( new EntryOperationContext( dn ) ) )
+        if ( ! partition.hasEntry( new EntryOperationContext( registries, dn ) ) )
         {
             return;
         }
         
         LOG.debug( "{} schema: loading syntaxes", schema.getSchemaName() );
         
-        NamingEnumeration list = partition.list( new ListOperationContext( dn ) );
+        NamingEnumeration<SearchResult> list = partition.list( new ListOperationContext( registries, dn ) );
+        
         while ( list.hasMore() )
         {
-            SearchResult result = ( SearchResult ) list.next();
+            SearchResult result = list.next();
             LdapDN resultDN = new LdapDN( result.getName() );
-            resultDN.normalize( attrRegistry.getNormalizerMapping() );
-            Attributes attrs = partition.lookup( new LookupOperationContext( resultDN ) );
+            resultDN.normalize( atRegistry.getNormalizerMapping() );
+            Attributes attrs = partition.lookup( new LookupOperationContext( registries, resultDN ) );
             Syntax syntax = factory.getSyntax( attrs, targetRegistries, schema.getSchemaName() );
             targetRegistries.getSyntaxRegistry().register( syntax );
         }
@@ -664,24 +676,25 @@
         if ( dn == null )
         {
             dn = new LdapDN( "ou=syntaxCheckers,cn=" + schema.getSchemaName() + ",ou=schema" );
-            dn.normalize( this.attrRegistry.getNormalizerMapping() );
+            dn.normalize( atRegistry.getNormalizerMapping() );
             staticSyntaxCheckersDNs.put( schema.getSchemaName(), dn );
         }
         
-        if ( ! partition.hasEntry( new EntryOperationContext( dn ) ) )
+        if ( ! partition.hasEntry( new EntryOperationContext( registries, dn ) ) )
         {
             return;
         }
         
         LOG.debug( "{} schema: loading syntaxCheckers", schema.getSchemaName() );
         
-        NamingEnumeration list = partition.list( new ListOperationContext( dn ) );
+        NamingEnumeration<SearchResult> list = partition.list( new ListOperationContext( registries, dn ) );
+        
         while ( list.hasMore() )
         {
-            SearchResult result = ( SearchResult ) list.next();
+            SearchResult result = list.next();
             LdapDN resultDN = new LdapDN( result.getName() );
-            resultDN.normalize( attrRegistry.getNormalizerMapping() );
-            Attributes attrs = partition.lookup( new LookupOperationContext( resultDN ) );
+            resultDN.normalize( atRegistry.getNormalizerMapping() );
+            Attributes attrs = partition.lookup( new LookupOperationContext( registries, resultDN ) );
             SyntaxChecker sc = factory.getSyntaxChecker( attrs, targetRegistries );
             SyntaxCheckerDescription syntaxCheckerDescription = 
                 getSyntaxCheckerDescription( schema.getSchemaName(), attrs );
@@ -697,24 +710,25 @@
         if ( dn == null )
         {
             dn = new LdapDN( "ou=normalizers,cn=" + schema.getSchemaName() + ",ou=schema" );
-            dn.normalize( this.attrRegistry.getNormalizerMapping() );
+            dn.normalize( atRegistry.getNormalizerMapping() );
             staticNormalizersDNs.put( schema.getSchemaName(), dn );
         }
         
-        if ( ! partition.hasEntry( new EntryOperationContext( dn ) ) )
+        if ( ! partition.hasEntry( new EntryOperationContext( registries, dn ) ) )
         {
             return;
         }
         
         LOG.debug( "{} schema: loading normalizers", schema.getSchemaName() );
         
-        NamingEnumeration list = partition.list( new ListOperationContext( dn ) );
+        NamingEnumeration<SearchResult> list = partition.list( new ListOperationContext( registries, dn ) );
+        
         while ( list.hasMore() )
         {
-            SearchResult result = ( SearchResult ) list.next();
+            SearchResult result = list.next();
             LdapDN resultDN = new LdapDN( result.getName() );
-            resultDN.normalize( attrRegistry.getNormalizerMapping() );
-            Attributes attrs = partition.lookup( new LookupOperationContext( resultDN ) );
+            resultDN.normalize( atRegistry.getNormalizerMapping() );
+            Attributes attrs = partition.lookup( new LookupOperationContext( registries, resultDN ) );
             Normalizer normalizer = factory.getNormalizer( attrs, targetRegistries );
             NormalizerDescription normalizerDescription = getNormalizerDescription( schema.getSchemaName(), attrs );
             targetRegistries.getNormalizerRegistry().register( normalizerDescription, normalizer );
@@ -766,24 +780,25 @@
         if ( dn == null )
         {
             dn = new LdapDN( "ou=comparators,cn=" + schema.getSchemaName() + ",ou=schema" );
-            dn.normalize( this.attrRegistry.getNormalizerMapping() );
+            dn.normalize( atRegistry.getNormalizerMapping() );
             staticComparatorsDNs.put( schema.getSchemaName(), dn );
         }
 
-        if ( ! partition.hasEntry( new EntryOperationContext( dn ) ) )
+        if ( ! partition.hasEntry( new EntryOperationContext( registries, dn ) ) )
         {
             return;
         }
         
         LOG.debug( "{} schema: loading comparators", schema.getSchemaName() );
         
-        NamingEnumeration list = partition.list( new ListOperationContext( dn ) );
+        NamingEnumeration<SearchResult> list = partition.list( new ListOperationContext( registries, dn ) );
+        
         while ( list.hasMore() )
         {
-            SearchResult result = ( SearchResult ) list.next();
+            SearchResult result = list.next();
             LdapDN resultDN = new LdapDN( result.getName() );
-            resultDN.normalize( attrRegistry.getNormalizerMapping() );
-            Attributes attrs = partition.lookup( new LookupOperationContext( resultDN ) );
+            resultDN.normalize( atRegistry.getNormalizerMapping() );
+            Attributes attrs = partition.lookup( new LookupOperationContext( registries, resultDN ) );
             Comparator comparator = factory.getComparator( attrs, targetRegistries );
             ComparatorDescription comparatorDescription = getComparatorDescription( schema.getSchemaName(), attrs );
             targetRegistries.getComparatorRegistry().register( comparatorDescription, comparator );

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java?rev=607412&r1=607411&r2=607412&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java Sat Dec 29 03:42:29 2007
@@ -1078,7 +1078,7 @@
     {
         LdapDN oriChildName = opContext.getDn();
 
-        Attributes entry = nexus.lookup( new LookupOperationContext( oriChildName ) );
+        Attributes entry = nexus.lookup( new LookupOperationContext( registries, oriChildName ) );
 
         if ( oriChildName.startsWith( schemaBaseDN ) )
         {
@@ -1097,7 +1097,7 @@
     {
         LdapDN oriChildName = opContext.getDn();
         
-        Attributes entry = nexus.lookup( new LookupOperationContext( oriChildName ) );
+        Attributes entry = nexus.lookup( new LookupOperationContext( registries, oriChildName ) );
 
         if ( oriChildName.startsWith( schemaBaseDN ) )
         {
@@ -1115,7 +1115,7 @@
         Rdn newRdn = opContext.getNewRdn();
         boolean deleteOldRn = opContext.getDelOldDn();
         
-        Attributes entry = nexus.lookup( new LookupOperationContext( name ) );
+        Attributes entry = nexus.lookup( new LookupOperationContext( registries, name ) );
 
         if ( name.startsWith( schemaBaseDN ) )
         {
@@ -1141,7 +1141,7 @@
         }
         else
         {
-            entry = nexus.lookup( new LookupOperationContext( name ) );
+            entry = nexus.lookup( new LookupOperationContext( registries, name ) );
         }
         
         // First, we get the entry from the backend. If it does not exist, then we throw an exception
@@ -1694,7 +1694,7 @@
     public void delete( NextInterceptor next, DeleteOperationContext opContext ) throws NamingException
     {
     	LdapDN name = opContext.getDn();
-        Attributes entry = nexus.lookup( new LookupOperationContext( name ) );
+        Attributes entry = nexus.lookup( new LookupOperationContext( registries, name ) );
         
         if ( name.startsWith( schemaBaseDN ) )
         {

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/SchemaOperationControl.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/SchemaOperationControl.java?rev=607412&r1=607411&r2=607412&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/SchemaOperationControl.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/SchemaOperationControl.java Sat Dec 29 03:42:29 2007
@@ -660,7 +660,7 @@
                 for ( ComparatorDescription comparatorDescription : comparatorDescriptions )
                 {
                     comparatorHandler.delete( comparatorDescription.getNumericOid(), doCascadeModify );
-                    subentryModifier.delete( comparatorDescription );
+                    subentryModifier.delete( registries, comparatorDescription );
                 }
                 break;
             case( NORMALIZER_INDEX ):
@@ -670,7 +670,7 @@
                 for ( NormalizerDescription normalizerDescription : normalizerDescriptions )
                 {
                     normalizerHandler.delete( normalizerDescription.getNumericOid(), doCascadeModify );
-                    subentryModifier.delete( normalizerDescription );
+                    subentryModifier.delete( registries, normalizerDescription );
                 }
                 break;
             case( SYNTAX_CHECKER_INDEX ):
@@ -680,7 +680,7 @@
                 for ( SyntaxCheckerDescription syntaxCheckerDescription : syntaxCheckerDescriptions )
                 {
                     syntaxCheckerHandler.delete( syntaxCheckerDescription.getNumericOid(), doCascadeModify );
-                    subentryModifier.delete( syntaxCheckerDescription );
+                    subentryModifier.delete( registries, syntaxCheckerDescription );
                 }
                 break;
             case( SYNTAX_INDEX ):
@@ -690,7 +690,7 @@
                 for ( Syntax syntax : syntaxes )
                 {
                     syntaxHandler.delete( syntax, doCascadeModify );
-                    subentryModifier.deleteSchemaObject( syntax );
+                    subentryModifier.deleteSchemaObject( registries, syntax );
                 }
                 break;
             case( MATCHING_RULE_INDEX ):
@@ -700,7 +700,7 @@
                 for ( MatchingRule mr : mrs )
                 {
                     matchingRuleHandler.delete( mr, doCascadeModify );
-                    subentryModifier.deleteSchemaObject( mr );
+                    subentryModifier.deleteSchemaObject( registries, mr );
                 }
                 break;
             case( ATTRIBUTE_TYPE_INDEX ):
@@ -710,7 +710,7 @@
                 for ( AttributeType at : ats )
                 {
                     atHandler.delete( at, doCascadeModify );
-                    subentryModifier.deleteSchemaObject( at );
+                    subentryModifier.deleteSchemaObject( registries, at );
                 }
                 break;
             case( OBJECT_CLASS_INDEX ):
@@ -720,7 +720,7 @@
                 for ( ObjectClass oc : ocs )
                 {
                     ocHandler.delete( oc, doCascadeModify );
-                    subentryModifier.deleteSchemaObject( oc );
+                    subentryModifier.deleteSchemaObject( registries, oc );
                 }
                 break;
             case( MATCHING_RULE_USE_INDEX ):
@@ -730,7 +730,7 @@
                 for ( MatchingRuleUse mru : mrus )
                 {
                     mruHandler.delete( mru, doCascadeModify );
-                    subentryModifier.deleteSchemaObject( mru );
+                    subentryModifier.deleteSchemaObject( registries, mru );
                 }
                 break;
             case( DIT_STRUCTURE_RULE_INDEX ):
@@ -740,7 +740,7 @@
                 for ( DITStructureRule dsr : dsrs )
                 {
                     dsrHandler.delete( dsr, doCascadeModify );
-                    subentryModifier.deleteSchemaObject( dsr );
+                    subentryModifier.deleteSchemaObject( registries, dsr );
                 }
                 break;
             case( DIT_CONTENT_RULE_INDEX ):
@@ -750,7 +750,7 @@
                 for ( DITContentRule dcr : dcrs )
                 {
                     dcrHandler.delete( dcr, doCascadeModify );
-                    subentryModifier.deleteSchemaObject( dcr );
+                    subentryModifier.deleteSchemaObject( registries, dcr );
                 }
                 break;
             case( NAME_FORM_INDEX ):
@@ -760,7 +760,7 @@
                 for ( NameForm nf : nfs )
                 {
                     nfHandler.delete( nf, doCascadeModify );
-                    subentryModifier.deleteSchemaObject( nf );
+                    subentryModifier.deleteSchemaObject( registries, nf );
                 }
                 break;
             default:

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/SchemaPartitionDao.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/SchemaPartitionDao.java?rev=607412&r1=607411&r2=607412&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/SchemaPartitionDao.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/SchemaPartitionDao.java Sat Dec 29 03:42:29 2007
@@ -161,10 +161,11 @@
     public Map<String,Schema> getSchemas() throws NamingException
     {
         Map<String,Schema> schemas = new HashMap<String,Schema>();
-        NamingEnumeration list = listSchemas();
+        NamingEnumeration<SearchResult> list = listSchemas();
+        
         while( list.hasMore() )
         {
-            SearchResult sr = ( SearchResult ) list.next();
+            SearchResult sr = list.next();
             Schema schema = factory.getSchema( sr.getAttributes() ); 
             schemas.put( schema.getSchemaName(), schema );
         }
@@ -176,10 +177,11 @@
     public Set<String> getSchemaNames() throws NamingException
     {
         Set<String> schemaNames = new HashSet<String>();
-        NamingEnumeration list = listSchemas();
+        NamingEnumeration<SearchResult> list = listSchemas();
+        
         while( list.hasMore() )
         {
-            SearchResult sr = ( SearchResult ) list.next();
+            SearchResult sr = list.next();
             schemaNames.add( ( String ) sr.getAttributes().get( SchemaConstants.CN_AT ).get() );
         }
         
@@ -187,7 +189,7 @@
     }
     
 
-    private NamingEnumeration listSchemas() throws NamingException
+    private NamingEnumeration<SearchResult> listSchemas() throws NamingException
     {
         LdapDN base = new LdapDN( ServerDNConstants.OU_SCHEMA_DN );
         base.normalize( attrRegistry.getNormalizerMapping() );
@@ -196,7 +198,7 @@
         searchControls.setSearchScope( SearchControls.ONELEVEL_SCOPE );
         searchControls.setReturningAttributes( SCHEMA_ATTRIBUTES );
         return partition.search( 
-            new SearchOperationContext( base, AliasDerefMode.DEREF_ALWAYS, filter, searchControls ) );
+            new SearchOperationContext( registries, base, AliasDerefMode.DEREF_ALWAYS, filter, searchControls ) );
     }
 
 
@@ -204,7 +206,7 @@
     {
         LdapDN dn = new LdapDN( "cn=" + schemaName + ",ou=schema" );
         dn.normalize( attrRegistry.getNormalizerMapping() );
-        return factory.getSchema( partition.lookup( new LookupOperationContext( dn ) ) );
+        return factory.getSchema( partition.lookup( new LookupOperationContext( registries, dn ) ) );
     }
 
 
@@ -228,7 +230,7 @@
 
         try
         {
-            ne = partition.search( new SearchOperationContext( partition.getSuffixDn(),
+            ne = partition.search( new SearchOperationContext( registries, partition.getSuffixDn(),
                     AliasDerefMode.DEREF_ALWAYS, filter, searchControls ) );
             
             if ( ! ne.hasMore() )
@@ -275,7 +277,7 @@
         try
         {
             ne = partition.search( new SearchOperationContext(
-                    partition.getSuffixDn(), AliasDerefMode.DEREF_ALWAYS, filter, searchControls ) );
+                registries, partition.getSuffixDn(), AliasDerefMode.DEREF_ALWAYS, filter, searchControls ) );
             
             if ( ! ne.hasMore() )
             {
@@ -320,7 +322,7 @@
 
         try
         {
-            ne = partition.search( new SearchOperationContext( partition.getSuffixDn(),
+            ne = partition.search( new SearchOperationContext( registries, partition.getSuffixDn(),
                     AliasDerefMode.DEREF_ALWAYS, filter, searchControls ) );
             
             if ( ! ne.hasMore() )
@@ -366,7 +368,7 @@
 
         try
         {
-            ne = partition.search( new SearchOperationContext( partition.getSuffixDn(),
+            ne = partition.search( new SearchOperationContext( registries, partition.getSuffixDn(),
                     AliasDerefMode.DEREF_ALWAYS, filter, searchControls ) );
             
             if ( ! ne.hasMore() )
@@ -412,7 +414,7 @@
 
         try
         {
-            ne = partition.search( new SearchOperationContext( partition.getSuffixDn(), AliasDerefMode.DEREF_ALWAYS,
+            ne = partition.search( new SearchOperationContext( registries, partition.getSuffixDn(), AliasDerefMode.DEREF_ALWAYS,
                         filter, searchControls ) );
             
             if ( ! ne.hasMore() )
@@ -507,7 +509,7 @@
         
         try
         {
-            ne = partition.search( new SearchOperationContext( partition.getSuffixDn(),
+            ne = partition.search( new SearchOperationContext( registries, partition.getSuffixDn(),
                     AliasDerefMode.DEREF_ALWAYS, filter, searchControls ) );
             
             if ( ! ne.hasMore() )
@@ -567,7 +569,7 @@
     {
         LdapDN dn = new LdapDN( "cn=" + schemaName + ",ou=schema" );
         dn.normalize( attrRegistry.getNormalizerMapping() );
-        Attributes entry = partition.lookup( new LookupOperationContext( dn ) );
+        Attributes entry = partition.lookup( new LookupOperationContext( registries, dn ) );
         Attribute disabledAttr = AttributeUtils.getAttribute( entry, disabledAttributeType );
         List<ModificationItemImpl> mods = new ArrayList<ModificationItemImpl>( 3 );
         
@@ -626,7 +628,7 @@
         
         try
         {
-            ne = partition.search( new SearchOperationContext( partition.getSuffixDn(),
+            ne = partition.search( new SearchOperationContext( registries, partition.getSuffixDn(),
                     AliasDerefMode.DEREF_ALWAYS, filter, searchControls ) );
             while( ne.hasMore() )
             {
@@ -675,7 +677,7 @@
         
         try
         {
-            ne = partition.search( new SearchOperationContext( partition.getSuffixDn(),
+            ne = partition.search( new SearchOperationContext( registries, partition.getSuffixDn(),
                      AliasDerefMode.DEREF_ALWAYS, filter, searchControls ) );
             while( ne.hasMore() )
             {
@@ -703,7 +705,7 @@
         // (& (m-oid=*) (m-name=*) )
         filter.addNode( new PresenceNode( M_OID_OID ) );
         filter.addNode( new PresenceNode( M_NAME_OID ) );
-        return partition.search( new SearchOperationContext( partition.getSuffixDn(),
+        return partition.search( new SearchOperationContext( registries, partition.getSuffixDn(),
                  AliasDerefMode.DEREF_ALWAYS, filter, searchControls ) );
     }
 
@@ -752,7 +754,7 @@
         
         try
         {
-            ne = partition.search( new SearchOperationContext( partition.getSuffixDn(),
+            ne = partition.search( new SearchOperationContext( registries, partition.getSuffixDn(),
                     AliasDerefMode.DEREF_ALWAYS, filter, searchControls ) );
             while( ne.hasMore() )
             {
@@ -800,7 +802,7 @@
         
         try
         {
-            ne = partition.search( new SearchOperationContext( partition.getSuffixDn(),
+            ne = partition.search( new SearchOperationContext( registries, partition.getSuffixDn(),
                     AliasDerefMode.DEREF_ALWAYS, filter, searchControls ) );
             while( ne.hasMore() )
             {
@@ -842,7 +844,7 @@
         
         try
         {
-            ne = partition.search( new SearchOperationContext( partition.getSuffixDn(),
+            ne = partition.search( new SearchOperationContext( registries, partition.getSuffixDn(),
                      AliasDerefMode.DEREF_ALWAYS, filter, searchControls ) );
             while( ne.hasMore() )
             {
@@ -922,7 +924,7 @@
         
         try
         {
-            ne = partition.search( new SearchOperationContext( partition.getSuffixDn(),
+            ne = partition.search( new SearchOperationContext( registries, partition.getSuffixDn(),
                     AliasDerefMode.DEREF_ALWAYS, filter, searchControls ) );
             while( ne.hasMore() )
             {

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/SchemaService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/SchemaService.java?rev=607412&r1=607411&r2=607412&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/SchemaService.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/SchemaService.java Sat Dec 29 03:42:29 2007
@@ -373,7 +373,7 @@
         if ( schemaSubentry == null )
         {
             generateSchemaSubentry( schemaPartition.lookup(
-                    new LookupOperationContext( schemaModificationAttributesDN ) ) );
+                    new LookupOperationContext( registries, schemaModificationAttributesDN ) ) );
         }
 
         return new ImmutableAttributesWrapper( schemaSubentry );
@@ -391,7 +391,7 @@
         if ( schemaSubentry == null )
         {
             generateSchemaSubentry( schemaPartition.lookup(
-                    new LookupOperationContext( schemaModificationAttributesDN ) ) );
+                    new LookupOperationContext( registries, schemaModificationAttributesDN ) ) );
         }
 
         return ( Attributes ) schemaSubentry.clone();
@@ -423,14 +423,13 @@
             // Check if we need an update by looking at timestamps on disk
             // ---------------------------------------------------------------
 
-            Attributes mods = schemaPartition.lookup( new LookupOperationContext( schemaModificationAttributesDN ) );
-            Attribute modifyTimeDisk = mods.get( SchemaConstants.MODIFY_TIMESTAMP_AT );
-
-            Attribute modifyTimeMemory = null;
-
-            // @todo enable this optimization at some point but for now it
-            // is causing some problems so I will just turn it off
-
+            Attributes mods = schemaPartition.lookup( new LookupOperationContext( registries, schemaModificationAttributesDN ) );
+// @todo enable this optimization at some point but for now it
+// is causing some problems so I will just turn it off
+//          Attribute modifyTimeDisk = mods.get( SchemaConstants.MODIFY_TIMESTAMP_AT );
+//
+//          Attribute modifyTimeMemory = null;
+//
 //            if ( schemaSubentry != null )
 //            {
 //                modifyTimeMemory = schemaSubentry.get( SchemaConstants.MODIFY_TIMESTAMP_AT );

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/SchemaSubentryModifier.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/SchemaSubentryModifier.java?rev=607412&r1=607411&r2=607412&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/SchemaSubentryModifier.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/SchemaSubentryModifier.java Sat Dec 29 03:42:29 2007
@@ -155,41 +155,41 @@
     }
 
 
-    public void deleteSchemaObject( SchemaObject obj ) throws NamingException
+    public void deleteSchemaObject( Registries registries, SchemaObject obj ) throws NamingException
     {
         PartitionNexusProxy proxy = InvocationStack.getInstance().peek().getProxy();
         LdapDN dn = getDn( obj );
-        proxy.delete( new DeleteOperationContext( dn, true ), BYPASS );
+        proxy.delete( new DeleteOperationContext( registries, dn, true ), BYPASS );
     }
 
     
-    public void delete( NormalizerDescription normalizerDescription ) throws NamingException
+    public void delete( Registries registries, NormalizerDescription normalizerDescription ) throws NamingException
     {
         String schemaName = getSchema( normalizerDescription );
         PartitionNexusProxy proxy = InvocationStack.getInstance().peek().getProxy();
         LdapDN dn = new LdapDN( "m-oid=" + normalizerDescription.getNumericOid() + ",ou=normalizers,cn=" 
             + schemaName + ",ou=schema" );
-        proxy.delete( new DeleteOperationContext( dn, true ), BYPASS );
+        proxy.delete( new DeleteOperationContext( registries, dn, true ), BYPASS );
     }
 
 
-    public void delete( SyntaxCheckerDescription syntaxCheckerDescription ) throws NamingException
+    public void delete( Registries registries, SyntaxCheckerDescription syntaxCheckerDescription ) throws NamingException
     {
         String schemaName = getSchema( syntaxCheckerDescription );
         PartitionNexusProxy proxy = InvocationStack.getInstance().peek().getProxy();
         LdapDN dn = new LdapDN( "m-oid=" + syntaxCheckerDescription.getNumericOid() + ",ou=syntaxCheckers,cn=" 
             + schemaName + ",ou=schema" );
-        proxy.delete( new DeleteOperationContext( dn, true ), BYPASS );
+        proxy.delete( new DeleteOperationContext( registries, dn, true ), BYPASS );
     }
 
 
-    public void delete( ComparatorDescription comparatorDescription ) throws NamingException
+    public void delete( Registries registries, ComparatorDescription comparatorDescription ) throws NamingException
     {
         String schemaName = getSchema( comparatorDescription );
         PartitionNexusProxy proxy = InvocationStack.getInstance().peek().getProxy();
         LdapDN dn = new LdapDN( "m-oid=" + comparatorDescription.getNumericOid() + ",ou=comparators,cn=" 
             + schemaName + ",ou=schema" );
-        proxy.delete( new DeleteOperationContext( dn, true ), BYPASS );
+        proxy.delete( new DeleteOperationContext( registries, dn, true ), BYPASS );
     }
 
 

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java?rev=607412&r1=607411&r2=607412&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java Sat Dec 29 03:42:29 2007
@@ -124,8 +124,14 @@
     private SubtreeSpecificationParser ssParser;
     private SubtreeEvaluator evaluator;
     private PartitionNexus nexus;
+
+    /** The global registries */
     private Registries registries;
-    private AttributeTypeRegistry attrRegistry;
+    
+    /** The AttributeType registry */
+    private AttributeTypeRegistry atRegistry;
+    
+    /** The OID registry */
     private OidRegistry oidRegistry;
     
     private AttributeType objectClassType;
@@ -136,20 +142,20 @@
         super.init( directoryService );
         nexus = directoryService.getPartitionNexus();
         registries = directoryService.getRegistries();
-        attrRegistry = registries.getAttributeTypeRegistry();
+        atRegistry = registries.getAttributeTypeRegistry();
         oidRegistry = registries.getOidRegistry();
         
         // setup various attribute type values
-        objectClassType = attrRegistry.lookup( oidRegistry.getOid( SchemaConstants.OBJECT_CLASS_AT ) );
+        objectClassType = atRegistry.lookup( oidRegistry.getOid( SchemaConstants.OBJECT_CLASS_AT ) );
         
         ssParser = new SubtreeSpecificationParser( new NormalizerMappingResolver()
         {
             public Map<String, OidNormalizer> getNormalizerMapping() throws NamingException
             {
-                return attrRegistry.getNormalizerMapping();
+                return atRegistry.getNormalizerMapping();
             }
-        }, attrRegistry.getNormalizerMapping() );
-        evaluator = new SubtreeEvaluator( oidRegistry, attrRegistry );
+        }, atRegistry.getNormalizerMapping() );
+        evaluator = new SubtreeEvaluator( oidRegistry, atRegistry );
 
         // prepare to find all subentries in all namingContexts
         Iterator<String> suffixes = this.nexus.listSuffixes( null );
@@ -163,9 +169,9 @@
         {
             LdapDN suffix = new LdapDN( suffixes.next() );
             //suffix = LdapDN.normalize( suffix, registry.getNormalizerMapping() );
-            suffix.normalize( attrRegistry.getNormalizerMapping() );
+            suffix.normalize( atRegistry.getNormalizerMapping() );
             NamingEnumeration<SearchResult> subentries = nexus.search( 
-                new SearchOperationContext( suffix, AliasDerefMode.NEVER_DEREF_ALIASES, filter, controls ) );
+                new SearchOperationContext( registries, suffix, AliasDerefMode.NEVER_DEREF_ALIASES, filter, controls ) );
             
             while ( subentries.hasMore() )
             {
@@ -186,7 +192,7 @@
                 }
 
                 LdapDN dnName = new LdapDN( dn );
-                dnName.normalize( attrRegistry.getNormalizerMapping() );
+                dnName.normalize( atRegistry.getNormalizerMapping() );
                 subentryCache.setSubentry( dnName.toString(), ss, getSubentryTypes( subentry ) );
             }
         }
@@ -394,7 +400,7 @@
             // get the name of the administrative point and its administrativeRole attributes
             LdapDN apName = ( LdapDN ) name.clone();
             apName.remove( name.size() - 1 );
-            Attributes ap = nexus.lookup( new LookupOperationContext( apName ) );
+            Attributes ap = nexus.lookup( new LookupOperationContext( registries, apName ) );
             Attribute administrativeRole = ap.get( "administrativeRole" );
 
             // check that administrativeRole has something valid in it for us
@@ -461,14 +467,14 @@
                 { SchemaConstants.ALL_OPERATIONAL_ATTRIBUTES, SchemaConstants.ALL_USER_ATTRIBUTES } );
 
             NamingEnumeration<SearchResult> subentries = nexus.search(
-                    new SearchOperationContext( baseDn, AliasDerefMode.NEVER_DEREF_ALIASES, filter, controls ) );
+                    new SearchOperationContext( registries, baseDn, AliasDerefMode.NEVER_DEREF_ALIASES, filter, controls ) );
 
             while ( subentries.hasMore() )
             {
                 SearchResult result = subentries.next();
                 Attributes candidate = result.getAttributes();
                 LdapDN dn = new LdapDN( result.getName() );
-                dn.normalize( attrRegistry.getNormalizerMapping() );
+                dn.normalize( atRegistry.getNormalizerMapping() );
 
                 if ( evaluator.evaluate( ss, apName, dn, candidate ) )
                 {
@@ -563,7 +569,7 @@
     public void delete( NextInterceptor next, DeleteOperationContext opContext ) throws NamingException
     {
     	LdapDN name = opContext.getDn();
-        Attributes entry = nexus.lookup( new LookupOperationContext( name ) );
+        Attributes entry = nexus.lookup( new LookupOperationContext( registries, name ) );
         Attribute objectClasses = AttributeUtils.getAttribute( entry, objectClassType );
 
         if ( AttributeUtils.containsValueCaseIgnore( objectClasses, SchemaConstants.SUBENTRY_OC ) )
@@ -591,14 +597,14 @@
                 { SchemaConstants.ALL_OPERATIONAL_ATTRIBUTES, SchemaConstants.ALL_USER_ATTRIBUTES } );
 
             NamingEnumeration<SearchResult> subentries = nexus.search(
-                    new SearchOperationContext( baseDn, AliasDerefMode.NEVER_DEREF_ALIASES, filter, controls ) );
+                    new SearchOperationContext( registries, baseDn, AliasDerefMode.NEVER_DEREF_ALIASES, filter, controls ) );
             
             while ( subentries.hasMore() )
             {
                 SearchResult result = subentries.next();
                 Attributes candidate = result.getAttributes();
                 LdapDN dn = new LdapDN( result.getName() );
-                dn.normalize( attrRegistry.getNormalizerMapping() );
+                dn.normalize( atRegistry.getNormalizerMapping() );
 
                 if ( evaluator.evaluate( ss, apName, dn, candidate ) )
                 {
@@ -632,7 +638,7 @@
         SearchControls controls = new SearchControls();
         controls.setSearchScope( SearchControls.SUBTREE_SCOPE );
         NamingEnumeration<SearchResult> aps = nexus.search(
-                new SearchOperationContext( name, AliasDerefMode.NEVER_DEREF_ALIASES, filter, controls ) );
+                new SearchOperationContext( registries, name, AliasDerefMode.NEVER_DEREF_ALIASES, filter, controls ) );
 
         if ( aps.hasMore() )
         {
@@ -721,7 +727,7 @@
     {
         LdapDN name = opContext.getDn();
 
-        Attributes entry = nexus.lookup( new LookupOperationContext( name ) );
+        Attributes entry = nexus.lookup( new LookupOperationContext( registries, name ) );
         Attribute objectClasses = AttributeUtils.getAttribute( entry, objectClassType );
 
         if ( AttributeUtils.containsValueCaseIgnore( objectClasses, SchemaConstants.SUBENTRY_OC ) )
@@ -747,14 +753,14 @@
             controls.setSearchScope( SearchControls.SUBTREE_SCOPE );
             controls.setReturningAttributes( new String[] { SchemaConstants.ALL_OPERATIONAL_ATTRIBUTES, SchemaConstants.ALL_USER_ATTRIBUTES } );
             NamingEnumeration<SearchResult> subentries = nexus.search(
-                    new SearchOperationContext( baseDn, AliasDerefMode.NEVER_DEREF_ALIASES, filter, controls ) );
+                    new SearchOperationContext( registries, baseDn, AliasDerefMode.NEVER_DEREF_ALIASES, filter, controls ) );
             
             while ( subentries.hasMore() )
             {
                 SearchResult result = subentries.next();
                 Attributes candidate = result.getAttributes();
                 LdapDN dn = new LdapDN( result.getName() );
-                dn.normalize( attrRegistry.getNormalizerMapping() );
+                dn.normalize( atRegistry.getNormalizerMapping() );
 
                 if ( evaluator.evaluate( ss, apName, dn, candidate ) )
                 {
@@ -778,7 +784,7 @@
             LdapDN newName = ( LdapDN ) name.clone();
             newName.remove( newName.size() - 1 );
             newName.add( opContext.getNewRdn() );
-            newName.normalize( attrRegistry.getNormalizerMapping() );
+            newName.normalize( atRegistry.getNormalizerMapping() );
             List<ModificationItemImpl> mods = getModsOnEntryRdnChange( name, newName, entry );
 
             if ( mods.size() > 0 )
@@ -796,7 +802,7 @@
         LdapDN parent = opContext.getParent();
 
         
-        Attributes entry = nexus.lookup( new LookupOperationContext( oriChildName ) );
+        Attributes entry = nexus.lookup( new LookupOperationContext( registries, oriChildName ) );
         Attribute objectClasses = AttributeUtils.getAttribute( entry, objectClassType );
 
         if ( AttributeUtils.containsValueCaseIgnore( objectClasses, SchemaConstants.SUBENTRY_OC ) )
@@ -823,14 +829,14 @@
             controls.setSearchScope( SearchControls.SUBTREE_SCOPE );
             controls.setReturningAttributes( new String[] { SchemaConstants.ALL_OPERATIONAL_ATTRIBUTES, SchemaConstants.ALL_USER_ATTRIBUTES } );
             NamingEnumeration<SearchResult> subentries = nexus.search(
-                    new SearchOperationContext( baseDn, AliasDerefMode.NEVER_DEREF_ALIASES, filter, controls ) );
+                    new SearchOperationContext( registries, baseDn, AliasDerefMode.NEVER_DEREF_ALIASES, filter, controls ) );
             
             while ( subentries.hasMore() )
             {
                 SearchResult result = subentries.next();
                 Attributes candidate = result.getAttributes();
                 LdapDN dn = new LdapDN( result.getName() );
-                dn.normalize( attrRegistry.getNormalizerMapping() );
+                dn.normalize( atRegistry.getNormalizerMapping() );
 
                 if ( evaluator.evaluate( ss, apName, dn, candidate ) )
                 {
@@ -854,7 +860,7 @@
             // attributes contained within this regular entry with name changes
             LdapDN newName = ( LdapDN ) parent.clone();
             newName.add( opContext.getNewRdn() );
-            newName.normalize( attrRegistry.getNormalizerMapping() );
+            newName.normalize( atRegistry.getNormalizerMapping() );
             List<ModificationItemImpl> mods = getModsOnEntryRdnChange( oriChildName, newName, entry );
 
             if ( mods.size() > 0 )
@@ -870,7 +876,7 @@
         LdapDN oriChildName = opContext.getDn();
         LdapDN newParentName = opContext.getParent();
         
-        Attributes entry = nexus.lookup( new LookupOperationContext( oriChildName ) );
+        Attributes entry = nexus.lookup( new LookupOperationContext( registries, oriChildName ) );
         Attribute objectClasses = entry.get( SchemaConstants.OBJECT_CLASS_AT );
 
         if ( AttributeUtils.containsValueCaseIgnore( objectClasses, SchemaConstants.SUBENTRY_OC ) )
@@ -897,14 +903,14 @@
             controls.setReturningAttributes( new String[]
                 { SchemaConstants.ALL_OPERATIONAL_ATTRIBUTES, SchemaConstants.ALL_USER_ATTRIBUTES } );
             NamingEnumeration<SearchResult> subentries = nexus.search(
-                    new SearchOperationContext( baseDn, AliasDerefMode.NEVER_DEREF_ALIASES, filter, controls ) );
+                    new SearchOperationContext( registries, baseDn, AliasDerefMode.NEVER_DEREF_ALIASES, filter, controls ) );
             
             while ( subentries.hasMore() )
             {
                 SearchResult result = subentries.next();
                 Attributes candidate = result.getAttributes();
                 LdapDN dn = new LdapDN( result.getName() );
-                dn.normalize( attrRegistry.getNormalizerMapping() );
+                dn.normalize( atRegistry.getNormalizerMapping() );
 
                 if ( evaluator.evaluate( ss, apName, dn, candidate ) )
                 {
@@ -983,7 +989,7 @@
         LdapDN name = opContext.getDn();
         List<ModificationItemImpl> mods = opContext.getModItems();
         
-        Attributes entry = nexus.lookup( new LookupOperationContext( name ) );
+        Attributes entry = nexus.lookup( new LookupOperationContext( registries, name ) );
         Attributes oldEntry = (Attributes) entry.clone();
         Attribute objectClasses = AttributeUtils.getAttribute( entry, objectClassType );
         boolean isSubtreeSpecificationModification = false;
@@ -1028,14 +1034,14 @@
             controls.setReturningAttributes( new String[]
                 { SchemaConstants.ALL_OPERATIONAL_ATTRIBUTES, SchemaConstants.ALL_USER_ATTRIBUTES } );
             NamingEnumeration<SearchResult> subentries = nexus.search(
-                    new SearchOperationContext( oldBaseDn, AliasDerefMode.NEVER_DEREF_ALIASES, filter, controls ) );
+                    new SearchOperationContext( registries, oldBaseDn, AliasDerefMode.NEVER_DEREF_ALIASES, filter, controls ) );
             
             while ( subentries.hasMore() )
             {
                 SearchResult result = subentries.next();
                 Attributes candidate = result.getAttributes();
                 LdapDN dn = new LdapDN( result.getName() );
-                dn.normalize( attrRegistry.getNormalizerMapping() );
+                dn.normalize( atRegistry.getNormalizerMapping() );
 
                 if ( evaluator.evaluate( ssOld, apName, dn, candidate ) )
                 {
@@ -1049,13 +1055,13 @@
             LdapDN newBaseDn = ( LdapDN ) apName.clone();
             newBaseDn.addAll( ssNew.getBase() );
             subentries = nexus.search(
-                    new SearchOperationContext( newBaseDn, AliasDerefMode.NEVER_DEREF_ALIASES, filter, controls ) );
+                    new SearchOperationContext( registries, newBaseDn, AliasDerefMode.NEVER_DEREF_ALIASES, filter, controls ) );
             while ( subentries.hasMore() )
             {
                 SearchResult result = subentries.next();
                 Attributes candidate = result.getAttributes();
                 LdapDN dn = new LdapDN( result.getName() );
-                dn.normalize( attrRegistry.getNormalizerMapping() );
+                dn.normalize( atRegistry.getNormalizerMapping() );
 
                 if ( evaluator.evaluate( ssNew, apName, dn, candidate ) )
                 {
@@ -1069,7 +1075,7 @@
             
             if ( !AttributeUtils.containsValueCaseIgnore( objectClasses, SchemaConstants.SUBENTRY_OC ) )
             {
-	            Attributes newEntry = nexus.lookup( new LookupOperationContext( name ) );
+	            Attributes newEntry = nexus.lookup( new LookupOperationContext( registries, name ) );
 	            
 	            List<ModificationItemImpl> subentriesOpAttrMods = getModsOnEntryModification( name, oldEntry, newEntry );
                 
@@ -1362,16 +1368,16 @@
             if ( !result.isRelative() )
             {
                 LdapDN ndn = new LdapDN( dn );
-                ndn.normalize( attrRegistry.getNormalizerMapping() );
+                ndn.normalize( atRegistry.getNormalizerMapping() );
                 String normalizedDn = ndn.toString();
                 return !subentryCache.hasSubentry( normalizedDn );
             }
 
             LdapDN name = new LdapDN( invocation.getCaller().getNameInNamespace() );
-            name.normalize( attrRegistry.getNormalizerMapping() );
+            name.normalize( atRegistry.getNormalizerMapping() );
 
             LdapDN rest = new LdapDN( result.getName() );
-            rest.normalize( attrRegistry.getNormalizerMapping() );
+            rest.normalize( atRegistry.getNormalizerMapping() );
             name.addAll( rest );
             return !subentryCache.hasSubentry( name.toString() );
         }
@@ -1423,15 +1429,15 @@
             if ( !result.isRelative() )
             {
                 LdapDN ndn = new LdapDN( dn );
-                ndn.normalize( attrRegistry.getNormalizerMapping() );
+                ndn.normalize( atRegistry.getNormalizerMapping() );
                 return subentryCache.hasSubentry( ndn.toNormName() );
             }
 
             LdapDN name = new LdapDN( invocation.getCaller().getNameInNamespace() );
-            name.normalize( attrRegistry.getNormalizerMapping() );
+            name.normalize( atRegistry.getNormalizerMapping() );
 
             LdapDN rest = new LdapDN( result.getName() );
-            rest.normalize( attrRegistry.getNormalizerMapping() );
+            rest.normalize( atRegistry.getNormalizerMapping() );
             name.addAll( rest );
             return subentryCache.hasSubentry( name.toNormName() );
         }

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/trigger/AbstractStoredProcedureParameterInjector.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/trigger/AbstractStoredProcedureParameterInjector.java?rev=607412&r1=607411&r2=607412&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/trigger/AbstractStoredProcedureParameterInjector.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/trigger/AbstractStoredProcedureParameterInjector.java Sat Dec 29 03:42:29 2007
@@ -33,6 +33,7 @@
 import org.apache.directory.server.core.invocation.Invocation;
 import org.apache.directory.server.core.jndi.ServerContext;
 import org.apache.directory.server.core.jndi.ServerLdapContext;
+import org.apache.directory.server.schema.registries.Registries;
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.trigger.StoredProcedureParameter;
 import org.apache.directory.shared.ldap.trigger.StoredProcedureParameter.Generic_LDAP_CONTEXT;
@@ -40,12 +41,12 @@
 public abstract class AbstractStoredProcedureParameterInjector implements StoredProcedureParameterInjector
 {
     private Invocation invocation;
-    private Map<Class, MicroInjector> injectors;
+    private Map<Class<?>, MicroInjector> injectors;
     
     public AbstractStoredProcedureParameterInjector( Invocation invocation )
     {
         this.invocation = invocation;
-        injectors = new HashMap<Class, MicroInjector>();
+        injectors = new HashMap<Class<?>, MicroInjector>();
         injectors.put( StoredProcedureParameter.Generic_OPERATION_PRINCIPAL.class, $operationPrincipalInjector );
         injectors.put( StoredProcedureParameter.Generic_LDAP_CONTEXT.class, $ldapContextInjector );
     }
@@ -57,7 +58,7 @@
         return userName;
     }
     
-    protected Map<Class, MicroInjector> getInjectors()
+    protected Map<Class<?>, MicroInjector> getInjectors()
     {
         return injectors;
     }
@@ -72,16 +73,17 @@
         this.invocation = invocation;
     }
     
-    public final List<Object> getArgumentsToInject( List<StoredProcedureParameter> parameterList ) throws NamingException
+    public final List<Object> getArgumentsToInject( Registries registries, List<StoredProcedureParameter> parameterList ) throws NamingException
     {
         List<Object> arguments = new ArrayList<Object>();
         
         Iterator<StoredProcedureParameter> it = parameterList.iterator();
+        
         while ( it.hasNext() )
         {
             StoredProcedureParameter spParameter = it.next();
             MicroInjector injector = injectors.get( spParameter.getClass() );
-            arguments.add( injector.inject( spParameter ) );
+            arguments.add( injector.inject( registries, spParameter ) );
         }
         
         return arguments;
@@ -89,7 +91,7 @@
     
     MicroInjector $operationPrincipalInjector = new MicroInjector()
     {
-        public Object inject( StoredProcedureParameter param ) throws NamingException
+        public Object inject( Registries registries, StoredProcedureParameter param ) throws NamingException
         {
             return getOperationPrincipal();
         }
@@ -97,7 +99,7 @@
     
     MicroInjector $ldapContextInjector = new MicroInjector()
     {
-        public Object inject( StoredProcedureParameter param ) throws NamingException
+        public Object inject(  Registries registries, StoredProcedureParameter param ) throws NamingException
         {
             Generic_LDAP_CONTEXT ldapCtxParam = ( Generic_LDAP_CONTEXT ) param;
             LdapDN ldapCtxName = ldapCtxParam.getCtxName();

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/trigger/AddStoredProcedureParameterInjector.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/trigger/AddStoredProcedureParameterInjector.java?rev=607412&r1=607411&r2=607412&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/trigger/AddStoredProcedureParameterInjector.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/trigger/AddStoredProcedureParameterInjector.java Sat Dec 29 03:42:29 2007
@@ -26,6 +26,7 @@
 import javax.naming.directory.Attributes;
 
 import org.apache.directory.server.core.invocation.Invocation;
+import org.apache.directory.server.schema.registries.Registries;
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.trigger.StoredProcedureParameter;
 
@@ -39,14 +40,14 @@
         super( invocation );
         this.addedEntryName = addedEntryName;
         this.addedEntry = addedEntry;
-        Map<Class, MicroInjector> injectors = super.getInjectors();
+        Map<Class<?>, MicroInjector> injectors = super.getInjectors();
         injectors.put( StoredProcedureParameter.Add_ENTRY.class, $entryInjector );
         injectors.put( StoredProcedureParameter.Add_ATTRIBUTES.class, $attributesInjector );
     }
     
     MicroInjector $entryInjector = new MicroInjector()
     {
-        public Object inject( StoredProcedureParameter param ) throws NamingException
+        public Object inject( Registries registries, StoredProcedureParameter param ) throws NamingException
         {
             // Return a safe copy constructed with user provided name.
             return new LdapDN( addedEntryName.getUpName() );
@@ -55,7 +56,7 @@
     
     MicroInjector $attributesInjector = new MicroInjector()
     {
-        public Object inject( StoredProcedureParameter param ) throws NamingException
+        public Object inject( Registries registries, StoredProcedureParameter param ) throws NamingException
         {
             return addedEntry.clone();
         }

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/trigger/DeleteStoredProcedureParameterInjector.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/trigger/DeleteStoredProcedureParameterInjector.java?rev=607412&r1=607411&r2=607412&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/trigger/DeleteStoredProcedureParameterInjector.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/trigger/DeleteStoredProcedureParameterInjector.java Sat Dec 29 03:42:29 2007
@@ -29,6 +29,7 @@
 import org.apache.directory.server.core.interceptor.context.LookupOperationContext;
 import org.apache.directory.server.core.invocation.Invocation;
 import org.apache.directory.server.core.partition.PartitionNexusProxy;
+import org.apache.directory.server.schema.registries.Registries;
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.trigger.StoredProcedureParameter;
 
@@ -38,19 +39,19 @@
     private LdapDN deletedEntryName;
     private Attributes deletedEntry;
     
-    public DeleteStoredProcedureParameterInjector( Invocation invocation, LdapDN deletedEntryName ) throws NamingException
+    public DeleteStoredProcedureParameterInjector( Registries registries, Invocation invocation, LdapDN deletedEntryName ) throws NamingException
     {
         super( invocation );
         this.deletedEntryName = deletedEntryName;
-        this.deletedEntry = getDeletedEntry();
-        Map<Class, MicroInjector> injectors = super.getInjectors();
+        this.deletedEntry = getDeletedEntry( registries );
+        Map<Class<?>, MicroInjector> injectors = super.getInjectors();
         injectors.put( StoredProcedureParameter.Delete_NAME.class, $nameInjector );
         injectors.put( StoredProcedureParameter.Delete_DELETED_ENTRY.class, $deletedEntryInjector );
     }
     
     MicroInjector $nameInjector = new MicroInjector()
     {
-        public Object inject( StoredProcedureParameter param ) throws NamingException
+        public Object inject( Registries registries, StoredProcedureParameter param ) throws NamingException
         {
             // Return a safe copy constructed with user provided name.
             return new LdapDN( deletedEntryName.getUpName() );
@@ -59,20 +60,20 @@
     
     MicroInjector $deletedEntryInjector = new MicroInjector()
     {
-        public Object inject( StoredProcedureParameter param ) throws NamingException
+        public Object inject( Registries registries, StoredProcedureParameter param ) throws NamingException
         {
             return deletedEntry;
         }
     };
     
-    private Attributes getDeletedEntry() throws NamingException
+    private Attributes getDeletedEntry( Registries registries ) throws NamingException
     {
         PartitionNexusProxy proxy = getInvocation().getProxy();
         /**
          * Using LOOKUP_EXCLUDING_OPR_ATTRS_BYPASS here to exclude operational attributes
          * especially subentry related ones like "triggerExecutionSubentries".
          */
-        Attributes deletedEntry = proxy.lookup( new LookupOperationContext( deletedEntryName ), PartitionNexusProxy.LOOKUP_EXCLUDING_OPR_ATTRS_BYPASS );
+        Attributes deletedEntry = proxy.lookup( new LookupOperationContext( registries, deletedEntryName ), PartitionNexusProxy.LOOKUP_EXCLUDING_OPR_ATTRS_BYPASS );
         return deletedEntry;
     }
 }

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/trigger/ModifyDNStoredProcedureParameterInjector.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/trigger/ModifyDNStoredProcedureParameterInjector.java?rev=607412&r1=607411&r2=607412&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/trigger/ModifyDNStoredProcedureParameterInjector.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/trigger/ModifyDNStoredProcedureParameterInjector.java Sat Dec 29 03:42:29 2007
@@ -21,6 +21,7 @@
 package org.apache.directory.server.core.trigger;
 
 import org.apache.directory.server.core.invocation.Invocation;
+import org.apache.directory.server.schema.registries.Registries;
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.name.Rdn;
 import org.apache.directory.shared.ldap.trigger.StoredProcedureParameter;
@@ -51,7 +52,7 @@
 		this.oldDN = oldDN;
 		this.newDN = newDN;
 		
-		Map<Class, MicroInjector> injectors = super.getInjectors();
+		Map<Class<?>, MicroInjector> injectors = super.getInjectors();
 		injectors.put( StoredProcedureParameter.ModifyDN_ENTRY.class, $entryInjector );
 		injectors.put( StoredProcedureParameter.ModifyDN_NEW_RDN.class, $newrdnInjector );
 		injectors.put( StoredProcedureParameter.ModifyDN_DELETE_OLD_RDN.class, $deleteoldrdnInjector );
@@ -66,7 +67,7 @@
 	 */
 	MicroInjector $entryInjector = new MicroInjector()
     {
-        public Object inject( StoredProcedureParameter param ) throws NamingException
+        public Object inject( Registries registries, StoredProcedureParameter param ) throws NamingException
         {
             // Return a safe copy constructed with user provided name.
             return new LdapDN( oldDN.getUpName() );
@@ -78,7 +79,7 @@
      */
     MicroInjector $newrdnInjector = new MicroInjector()
     {
-        public Object inject( StoredProcedureParameter param ) throws NamingException
+        public Object inject( Registries registries, StoredProcedureParameter param ) throws NamingException
         {
             // Return a safe copy constructed with user provided name.
             return new LdapDN( newRDN.getUpName() );
@@ -90,7 +91,7 @@
      */
     MicroInjector $deleteoldrdnInjector = new MicroInjector()
     {
-        public Object inject( StoredProcedureParameter param ) throws NamingException
+        public Object inject( Registries registries, StoredProcedureParameter param ) throws NamingException
         {
             // Return a safe copy constructed with user provided name.
             return deleteOldRn;
@@ -102,7 +103,7 @@
      */
     MicroInjector $newSuperiorInjector = new MicroInjector()
     {
-        public Object inject( StoredProcedureParameter param ) throws NamingException
+        public Object inject( Registries registries, StoredProcedureParameter param ) throws NamingException
         {
             // Return a safe copy constructed with user provided name.
             return new LdapDN( newSuperiorDN.getUpName() );
@@ -114,7 +115,7 @@
      */
     MicroInjector $oldRDNInjector = new MicroInjector()
     {
-        public Object inject( StoredProcedureParameter param ) throws NamingException
+        public Object inject( Registries registries, StoredProcedureParameter param ) throws NamingException
         {
             // Return a safe copy constructed with user provided name.
             return new LdapDN( oldRDN.getUpName() );
@@ -126,7 +127,7 @@
      */
     MicroInjector $oldSuperiorDNInjector = new MicroInjector()
     {
-        public Object inject( StoredProcedureParameter param ) throws NamingException
+        public Object inject( Registries registries, StoredProcedureParameter param ) throws NamingException
         {
             // Return a safe copy constructed with user provided name.
             return new LdapDN( oldSuperiorDN.getUpName() );
@@ -138,7 +139,7 @@
      */
     MicroInjector $newDNInjector = new MicroInjector()
     {
-        public Object inject( StoredProcedureParameter param ) throws NamingException
+        public Object inject( Registries registries, StoredProcedureParameter param ) throws NamingException
         {
             // Return a safe copy constructed with user provided name.
             return new LdapDN( newDN.getUpName() );

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/trigger/ModifyStoredProcedureParameterInjector.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/trigger/ModifyStoredProcedureParameterInjector.java?rev=607412&r1=607411&r2=607412&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/trigger/ModifyStoredProcedureParameterInjector.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/trigger/ModifyStoredProcedureParameterInjector.java Sat Dec 29 03:42:29 2007
@@ -32,6 +32,7 @@
 import org.apache.directory.server.core.interceptor.context.ModifyOperationContext;
 import org.apache.directory.server.core.invocation.Invocation;
 import org.apache.directory.server.core.partition.PartitionNexusProxy;
+import org.apache.directory.server.schema.registries.Registries;
 import org.apache.directory.shared.ldap.message.ModificationItemImpl;
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.trigger.StoredProcedureParameter;
@@ -48,8 +49,8 @@
         super( invocation );
         modifiedEntryName = opContext.getDn();
         modifications = opContext.getModItems();
-        this.oldEntry = getEntry();
-        Map<Class, MicroInjector> injectors = super.getInjectors();
+        this.oldEntry = getEntry( opContext.getRegistries() );
+        Map<Class<?>, MicroInjector> injectors = super.getInjectors();
         injectors.put( StoredProcedureParameter.Modify_OBJECT.class, $objectInjector );
         injectors.put( StoredProcedureParameter.Modify_MODIFICATION.class, $modificationInjector );
         injectors.put( StoredProcedureParameter.Modify_OLD_ENTRY.class, $oldEntryInjector );
@@ -58,7 +59,7 @@
     
     MicroInjector $objectInjector = new MicroInjector()
     {
-        public Object inject( StoredProcedureParameter param ) throws NamingException
+        public Object inject( Registries registries, StoredProcedureParameter param ) throws NamingException
         {
             // Return a safe copy constructed with user provided name.
             return new LdapDN( modifiedEntryName.getUpName() );
@@ -67,7 +68,7 @@
     
     MicroInjector $modificationInjector = new MicroInjector()
     {
-        public Object inject( StoredProcedureParameter param ) throws NamingException
+        public Object inject( Registries registries, StoredProcedureParameter param ) throws NamingException
         {
             List<ModificationItem> newMods = new ArrayList<ModificationItem>();
             
@@ -89,7 +90,7 @@
     
     MicroInjector $oldEntryInjector = new MicroInjector()
     {
-        public Object inject( StoredProcedureParameter param ) throws NamingException
+        public Object inject( Registries registries, StoredProcedureParameter param ) throws NamingException
         {
             return oldEntry;
         }
@@ -97,20 +98,20 @@
     
     MicroInjector $newEntryInjector = new MicroInjector()
     {
-        public Object inject( StoredProcedureParameter param ) throws NamingException
+        public Object inject( Registries registries, StoredProcedureParameter param ) throws NamingException
         {
-            return getEntry();
+            return getEntry( registries );
         }
     };
     
-    private Attributes getEntry() throws NamingException
+    private Attributes getEntry( Registries registries ) throws NamingException
     {
         PartitionNexusProxy proxy = getInvocation().getProxy();
         /**
          * Using LOOKUP_EXCLUDING_OPR_ATTRS_BYPASS here to exclude operational attributes
          * especially subentry related ones like "triggerExecutionSubentries".
          */
-        return proxy.lookup( new LookupOperationContext( modifiedEntryName ), PartitionNexusProxy.LOOKUP_EXCLUDING_OPR_ATTRS_BYPASS );
+        return proxy.lookup( new LookupOperationContext( registries, modifiedEntryName ), PartitionNexusProxy.LOOKUP_EXCLUDING_OPR_ATTRS_BYPASS );
     }
 
 }

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/trigger/StoredProcedureParameterInjector.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/trigger/StoredProcedureParameterInjector.java?rev=607412&r1=607411&r2=607412&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/trigger/StoredProcedureParameterInjector.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/trigger/StoredProcedureParameterInjector.java Sat Dec 29 03:42:29 2007
@@ -24,14 +24,15 @@
 
 import javax.naming.NamingException;
 
+import org.apache.directory.server.schema.registries.Registries;
 import org.apache.directory.shared.ldap.trigger.StoredProcedureParameter;
 
 public interface StoredProcedureParameterInjector
 {
-    List<Object> getArgumentsToInject( List<StoredProcedureParameter> parameterList ) throws NamingException;
+    List<Object> getArgumentsToInject( Registries registries, List<StoredProcedureParameter> parameterList ) throws NamingException;
     
     public interface MicroInjector
     {
-        Object inject( StoredProcedureParameter param ) throws NamingException;
+        Object inject( Registries registries, StoredProcedureParameter param ) throws NamingException;
     }
 }

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/trigger/TriggerInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/trigger/TriggerInterceptor.java?rev=607412&r1=607411&r2=607412&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/trigger/TriggerInterceptor.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/trigger/TriggerInterceptor.java Sat Dec 29 03:42:29 2007
@@ -43,12 +43,14 @@
 import org.apache.directory.server.core.sp.java.JavaStoredProcEngineConfig;
 import org.apache.directory.server.core.subtree.SubentryInterceptor;
 import org.apache.directory.server.schema.registries.AttributeTypeRegistry;
+import org.apache.directory.server.schema.registries.Registries;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.exception.LdapNamingException;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.name.Rdn;
 import org.apache.directory.shared.ldap.schema.NormalizerMappingResolver;
+import org.apache.directory.shared.ldap.schema.OidNormalizer;
 import org.apache.directory.shared.ldap.trigger.ActionTime;
 import org.apache.directory.shared.ldap.trigger.LdapOperation;
 import org.apache.directory.shared.ldap.trigger.TriggerSpecification;
@@ -80,17 +82,22 @@
 {
     /** the logger for this class */
     private static final Logger LOG = LoggerFactory.getLogger( TriggerInterceptor.class );
+    
     /** the entry trigger attribute string: entryTrigger */
     private static final String ENTRY_TRIGGER_ATTR = "entryTriggerSpecification";
 
     /** a triggerSpecCache that responds to add, delete, and modify attempts */
     private TriggerSpecCache triggerSpecCache;
+    
     /** a normalizing Trigger Specification parser */
     private TriggerSpecificationParser triggerParser;
-    /** the attribute type registry */
-//    private AttributeTypeRegistry attrRegistry;
+    
+    /** the global registries */
+    private Registries registries;
+    
     /** */
     private InterceptorChain chain;
+    
     /** whether or not this interceptor is activated */
     private boolean enabled = true;
 
@@ -131,7 +138,7 @@
         {
             LdapDN parentDn = ( LdapDN ) dn.clone();
             parentDn.remove( dn.size() - 1 );
-            entry = proxy.lookup( new LookupOperationContext( parentDn ), PartitionNexusProxy.LOOKUP_BYPASS );
+            entry = proxy.lookup( new LookupOperationContext( registries, parentDn ), PartitionNexusProxy.LOOKUP_BYPASS );
         }
 
         Attribute subentries = entry.get( SchemaConstants.TRIGGER_EXECUTION_SUBENTRIES_AT );
@@ -224,12 +231,14 @@
     public void init( DirectoryService directoryService ) throws NamingException
     {
         super.init( directoryService );
+        registries = directoryService.getRegistries();
+        
         triggerSpecCache = new TriggerSpecCache( directoryService );
         final AttributeTypeRegistry attrRegistry = directoryService.getRegistries().getAttributeTypeRegistry();
         triggerParser = new TriggerSpecificationParser
             ( new NormalizerMappingResolver()
                 {
-                    public Map getNormalizerMapping() throws NamingException
+                    public Map<String, OidNormalizer> getNormalizerMapping() throws NamingException
                     {
                         return attrRegistry.getNormalizerMapping();
                     }
@@ -298,9 +307,9 @@
         // Gather supplementary data.
         Invocation invocation = InvocationStack.getInstance().peek();
         PartitionNexusProxy proxy = invocation.getProxy();
-        Attributes deletedEntry = proxy.lookup( new LookupOperationContext( name ), PartitionNexusProxy.LOOKUP_BYPASS );
+        Attributes deletedEntry = proxy.lookup( new LookupOperationContext( registries, name ), PartitionNexusProxy.LOOKUP_BYPASS );
         ServerLdapContext callerRootCtx = ( ServerLdapContext ) ( ( ServerLdapContext ) invocation.getCaller() ).getRootContext();
-        StoredProcedureParameterInjector injector = new DeleteStoredProcedureParameterInjector( invocation, name );
+        StoredProcedureParameterInjector injector = new DeleteStoredProcedureParameterInjector( registries, invocation, name );
 
         // Gather Trigger Specifications which apply to the entry being deleted.
         List<TriggerSpecification> triggerSpecs = new ArrayList<TriggerSpecification>();
@@ -331,7 +340,7 @@
         // Gather supplementary data.
         Invocation invocation = InvocationStack.getInstance().peek();
         PartitionNexusProxy proxy = invocation.getProxy();
-        Attributes modifiedEntry = proxy.lookup( new LookupOperationContext( normName ), PartitionNexusProxy.LOOKUP_BYPASS );
+        Attributes modifiedEntry = proxy.lookup( new LookupOperationContext( registries, normName ), PartitionNexusProxy.LOOKUP_BYPASS );
         ServerLdapContext callerRootCtx = ( ServerLdapContext ) ( ( ServerLdapContext ) invocation.getCaller() ).getRootContext();
         StoredProcedureParameterInjector injector = new ModifyStoredProcedureParameterInjector( invocation, opContext );
 
@@ -367,7 +376,7 @@
         // Gather supplementary data.        
         Invocation invocation = InvocationStack.getInstance().peek();
         PartitionNexusProxy proxy = invocation.getProxy();
-        Attributes renamedEntry = proxy.lookup( new LookupOperationContext( name ), PartitionNexusProxy.LOOKUP_BYPASS );
+        Attributes renamedEntry = proxy.lookup( new LookupOperationContext( registries, name ), PartitionNexusProxy.LOOKUP_BYPASS );
         ServerLdapContext callerRootCtx = ( ServerLdapContext ) ( ( ServerLdapContext ) invocation.getCaller() ).getRootContext();
         
         LdapDN oldRDN = new LdapDN( name.getRdn().getUpName() );
@@ -413,7 +422,7 @@
         // Gather supplementary data.        
         Invocation invocation = InvocationStack.getInstance().peek();
         PartitionNexusProxy proxy = invocation.getProxy();
-        Attributes movedEntry = proxy.lookup( new LookupOperationContext( oriChildName ), PartitionNexusProxy.LOOKUP_BYPASS );
+        Attributes movedEntry = proxy.lookup( new LookupOperationContext( registries, oriChildName ), PartitionNexusProxy.LOOKUP_BYPASS );
         ServerLdapContext callerRootCtx = ( ServerLdapContext ) ( ( ServerLdapContext ) invocation.getCaller() ).getRootContext();
         
         LdapDN oldRDN = new LdapDN( oriChildName.getRdn().getUpName() );
@@ -437,7 +446,7 @@
         // will not be valid at the new location.
         // This will certainly be fixed by the SubentryInterceptor,
         // but after this service.
-        Attributes importedEntry = proxy.lookup( new LookupOperationContext( oriChildName ), PartitionNexusProxy.LOOKUP_EXCLUDING_OPR_ATTRS_BYPASS );
+        Attributes importedEntry = proxy.lookup( new LookupOperationContext( registries, oriChildName ), PartitionNexusProxy.LOOKUP_EXCLUDING_OPR_ATTRS_BYPASS );
         // As the target entry does not exist yet and so
         // its subentry operational attributes are not there,
         // we need to construct an entry to represent it
@@ -445,10 +454,11 @@
         // and access control subentry operational attributes.
         SubentryInterceptor subentryInterceptor = ( SubentryInterceptor ) chain.get( SubentryInterceptor.class.getName() );
         Attributes fakeImportedEntry = subentryInterceptor.getSubentryAttributes( newDN, importedEntry );
-        NamingEnumeration attrList = importedEntry.getAll();
+        NamingEnumeration<? extends Attribute> attrList = importedEntry.getAll();
+        
         while ( attrList.hasMore() )
         {
-            fakeImportedEntry.put( ( Attribute ) attrList.next() );
+            fakeImportedEntry.put( attrList.next() );
         }
         
         // Gather Trigger Specifications which apply to the entry being imported.
@@ -486,7 +496,7 @@
         // Gather supplementary data.        
         Invocation invocation = InvocationStack.getInstance().peek();
         PartitionNexusProxy proxy = invocation.getProxy();
-        Attributes movedEntry = proxy.lookup( new LookupOperationContext( oriChildName ), PartitionNexusProxy.LOOKUP_BYPASS );
+        Attributes movedEntry = proxy.lookup( new LookupOperationContext( registries, oriChildName ), PartitionNexusProxy.LOOKUP_BYPASS );
         ServerLdapContext callerRootCtx = ( ServerLdapContext ) ( ( ServerLdapContext ) invocation.getCaller() ).getRootContext();
         
         LdapDN oldRDN = new LdapDN( oriChildName.getRdn().getUpName() );
@@ -511,7 +521,7 @@
         // will not be valid at the new location.
         // This will certainly be fixed by the SubentryInterceptor,
         // but after this service.
-        Attributes importedEntry = proxy.lookup( new LookupOperationContext( oriChildName ), PartitionNexusProxy.LOOKUP_EXCLUDING_OPR_ATTRS_BYPASS );
+        Attributes importedEntry = proxy.lookup( new LookupOperationContext( registries, oriChildName ), PartitionNexusProxy.LOOKUP_EXCLUDING_OPR_ATTRS_BYPASS );
         // As the target entry does not exist yet and so
         // its subentry operational attributes are not there,
         // we need to construct an entry to represent it
@@ -519,11 +529,11 @@
         // and access control subentry operational attributes.
         SubentryInterceptor subentryInterceptor = ( SubentryInterceptor ) chain.get( SubentryInterceptor.class.getName() );
         Attributes fakeImportedEntry = subentryInterceptor.getSubentryAttributes( newDN, importedEntry );
-        NamingEnumeration attrList = importedEntry.getAll();
+        NamingEnumeration <? extends Attribute> attrList = importedEntry.getAll();
         
         while ( attrList.hasMore() )
         {
-            fakeImportedEntry.put( ( Attribute ) attrList.next() );
+            fakeImportedEntry.put( attrList.next() );
         }
         
         // Gather Trigger Specifications which apply to the entry being imported.
@@ -580,7 +590,7 @@
         for ( SPSpec spSpec : spSpecs )
         {
         	List<Object> arguments = new ArrayList<Object>();
-        	arguments.addAll( injector.getArgumentsToInject( spSpec.getParameters() ) );
+        	arguments.addAll( injector.getArgumentsToInject( registries, spSpec.getParameters() ) );
             Object[] values = arguments.toArray();
             Object returnValue = executeProcedure( callerRootCtx, spSpec.getName(), values );
             returnValues.add( returnValue );



Mime
View raw message