directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From erodrig...@apache.org
Subject svn commit: r539993 [2/2] - in /directory/apacheds/branches/kerberos-encryption-types: btree-base/src/main/java/org/apache/directory/server/core/partition/impl/btree/ constants/src/main/java/org/apache/directory/server/constants/ core-unit/src/test/jav...
Date Mon, 21 May 2007 01:53:10 GMT
Modified: directory/apacheds/branches/kerberos-encryption-types/core/src/main/java/org/apache/directory/server/core/schema/SchemaService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/kerberos-encryption-types/core/src/main/java/org/apache/directory/server/core/schema/SchemaService.java?view=diff&rev=539993&r1=539992&r2=539993
==============================================================================
--- directory/apacheds/branches/kerberos-encryption-types/core/src/main/java/org/apache/directory/server/core/schema/SchemaService.java (original)
+++ directory/apacheds/branches/kerberos-encryption-types/core/src/main/java/org/apache/directory/server/core/schema/SchemaService.java Sun May 20 18:53:07 2007
@@ -78,6 +78,7 @@
 import org.apache.directory.shared.ldap.message.AttributesImpl;
 import org.apache.directory.shared.ldap.message.ModificationItemImpl;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
+import org.apache.directory.shared.ldap.message.ServerSearchResult;
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.schema.AttributeType;
 import org.apache.directory.shared.ldap.schema.DITContentRule;
@@ -524,7 +525,7 @@
                 {
                     // call.setBypass( true );
                     Attributes attrs = getSubschemaEntry( searchCtls.getReturningAttributes() );
-                    SearchResult result = new SearchResult( base.toString(), null, attrs );
+                    SearchResult result = new ServerSearchResult( base.toString(), null, attrs );
                     return new SingletonEnumeration( result );
                 }
                 else
@@ -541,7 +542,7 @@
                 {
                     // call.setBypass( true );
                     Attributes attrs = getSubschemaEntry( searchCtls.getReturningAttributes() );
-                    SearchResult result = new SearchResult( base.toString(), null, attrs, false );
+                    SearchResult result = new ServerSearchResult( base.toString(), null, attrs, false );
                     return new SingletonEnumeration( result );
                 }
             }

Modified: directory/apacheds/branches/kerberos-encryption-types/core/src/main/java/org/apache/directory/server/core/trigger/AbstractStoredProcedureParameterInjector.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/kerberos-encryption-types/core/src/main/java/org/apache/directory/server/core/trigger/AbstractStoredProcedureParameterInjector.java?view=diff&rev=539993&r1=539992&r2=539993
==============================================================================
--- directory/apacheds/branches/kerberos-encryption-types/core/src/main/java/org/apache/directory/server/core/trigger/AbstractStoredProcedureParameterInjector.java (original)
+++ directory/apacheds/branches/kerberos-encryption-types/core/src/main/java/org/apache/directory/server/core/trigger/AbstractStoredProcedureParameterInjector.java Sun May 20 18:53:07 2007
@@ -72,14 +72,14 @@
         this.invocation = invocation;
     }
     
-    public final List getArgumentsToInject( List parameterList ) throws NamingException
+    public final List<Object> getArgumentsToInject( List<StoredProcedureParameter> parameterList ) throws NamingException
     {
-        List arguments = new ArrayList();
+        List<Object> arguments = new ArrayList<Object>();
         
-        Iterator it = parameterList.iterator();
+        Iterator<StoredProcedureParameter> it = parameterList.iterator();
         while ( it.hasNext() )
         {
-            StoredProcedureParameter spParameter = ( StoredProcedureParameter ) it.next();
+            StoredProcedureParameter spParameter = it.next();
             MicroInjector injector = injectors.get( spParameter.getClass() );
             arguments.add( injector.inject( spParameter ) );
         }
@@ -101,7 +101,7 @@
         {
             Generic_LDAP_CONTEXT ldapCtxParam = ( Generic_LDAP_CONTEXT ) param;
             LdapDN ldapCtxName = ldapCtxParam.getCtxName();
-            return (( ServerLdapContext ) ( ( ServerLdapContext ) invocation.getCaller() ).getRootContext()).lookup( ldapCtxName );
+            return ( ( ServerLdapContext ) ( ( ServerLdapContext ) invocation.getCaller() ).getRootContext()).lookup( ldapCtxName );
         };
     };
 

Modified: directory/apacheds/branches/kerberos-encryption-types/core/src/main/java/org/apache/directory/server/core/trigger/AddStoredProcedureParameterInjector.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/kerberos-encryption-types/core/src/main/java/org/apache/directory/server/core/trigger/AddStoredProcedureParameterInjector.java?view=diff&rev=539993&r1=539992&r2=539993
==============================================================================
--- directory/apacheds/branches/kerberos-encryption-types/core/src/main/java/org/apache/directory/server/core/trigger/AddStoredProcedureParameterInjector.java (original)
+++ directory/apacheds/branches/kerberos-encryption-types/core/src/main/java/org/apache/directory/server/core/trigger/AddStoredProcedureParameterInjector.java Sun May 20 18:53:07 2007
@@ -34,14 +34,12 @@
     private LdapDN addedEntryName;
     private Attributes addedEntry;
     
-    private Map injectors;
-    
     public AddStoredProcedureParameterInjector( Invocation invocation, LdapDN addedEntryName, Attributes addedEntry ) throws NamingException
     {
         super( invocation );
         this.addedEntryName = addedEntryName;
         this.addedEntry = addedEntry;
-        injectors = super.getInjectors();
+        Map<Class, MicroInjector> injectors = super.getInjectors();
         injectors.put( StoredProcedureParameter.Add_ENTRY.class, $entryInjector );
         injectors.put( StoredProcedureParameter.Add_ATTRIBUTES.class, $attributesInjector );
     }

Modified: directory/apacheds/branches/kerberos-encryption-types/core/src/main/java/org/apache/directory/server/core/trigger/DeleteStoredProcedureParameterInjector.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/kerberos-encryption-types/core/src/main/java/org/apache/directory/server/core/trigger/DeleteStoredProcedureParameterInjector.java?view=diff&rev=539993&r1=539992&r2=539993
==============================================================================
--- directory/apacheds/branches/kerberos-encryption-types/core/src/main/java/org/apache/directory/server/core/trigger/DeleteStoredProcedureParameterInjector.java (original)
+++ directory/apacheds/branches/kerberos-encryption-types/core/src/main/java/org/apache/directory/server/core/trigger/DeleteStoredProcedureParameterInjector.java Sun May 20 18:53:07 2007
@@ -38,14 +38,12 @@
     private LdapDN deletedEntryName;
     private Attributes deletedEntry;
     
-    private Map injectors;
-    
     public DeleteStoredProcedureParameterInjector( Invocation invocation, LdapDN deletedEntryName ) throws NamingException
     {
         super( invocation );
         this.deletedEntryName = deletedEntryName;
         this.deletedEntry = getDeletedEntry();
-        injectors = super.getInjectors();
+        Map<Class, MicroInjector> injectors = super.getInjectors();
         injectors.put( StoredProcedureParameter.Delete_NAME.class, $nameInjector );
         injectors.put( StoredProcedureParameter.Delete_DELETED_ENTRY.class, $deletedEntryInjector );
     }

Modified: directory/apacheds/branches/kerberos-encryption-types/core/src/main/java/org/apache/directory/server/core/trigger/ModifyDNStoredProcedureParameterInjector.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/kerberos-encryption-types/core/src/main/java/org/apache/directory/server/core/trigger/ModifyDNStoredProcedureParameterInjector.java?view=diff&rev=539993&r1=539992&r2=539993
==============================================================================
--- directory/apacheds/branches/kerberos-encryption-types/core/src/main/java/org/apache/directory/server/core/trigger/ModifyDNStoredProcedureParameterInjector.java (original)
+++ directory/apacheds/branches/kerberos-encryption-types/core/src/main/java/org/apache/directory/server/core/trigger/ModifyDNStoredProcedureParameterInjector.java Sun May 20 18:53:07 2007
@@ -26,35 +26,123 @@
 
 import org.apache.directory.server.core.invocation.Invocation;
 import org.apache.directory.shared.ldap.name.LdapDN;
+import org.apache.directory.shared.ldap.trigger.StoredProcedureParameter;
 
 
 public class ModifyDNStoredProcedureParameterInjector extends AbstractStoredProcedureParameterInjector
 {
-    private LdapDN oldName;
-    private String newRn;
     private boolean deleteOldRn;
-    
-    private Map injectors;
-    
-    public ModifyDNStoredProcedureParameterInjector( Invocation invocation, boolean deleteOldRn,
+    private LdapDN oldRDN;
+    private LdapDN newRDN;
+    private LdapDN oldSuperiorDN;
+    private LdapDN newSuperiorDN;
+    private LdapDN oldDN;
+    private LdapDN newDN;
+
+	public ModifyDNStoredProcedureParameterInjector( Invocation invocation, boolean deleteOldRn,
         LdapDN oldRDN, LdapDN newRDN, LdapDN oldSuperiorDN, LdapDN newSuperiorDN, LdapDN oldDN, LdapDN newDN) throws NamingException
     {
         super( invocation );
-        init( oldName, newRn, deleteOldRn );
-    }
-    
-    private void init( LdapDN oldName, String newRn, boolean deleteOldRn ) throws NamingException
-    {
-        this.oldName = oldName;
-        this.newRn = newRn;
         this.deleteOldRn = deleteOldRn;
-        injectors = super.getInjectors();
-        /*
-        injectors.put( ModDNStoredProcedureParameter.ENTRY, $entryInjector.inject() );
-        injectors.put( ModDNStoredProcedureParameter.NEW_RDN, $newRdnInjector.inject() );
-        injectors.put( ModDNStoredProcedureParameter.NEW_SUPERIOR, $newSuperior.inject() );
-        injectors.put( ModDNStoredProcedureParameter.DELETE_OLD_RDN, $deleteOldRdnInjector.inject() );
-        */
+		this.oldRDN = oldRDN;
+		this.newRDN = newRDN;
+		this.oldSuperiorDN = oldSuperiorDN;
+		this.newSuperiorDN = newSuperiorDN;
+		this.oldDN = oldDN;
+		this.newDN = newDN;
+		
+		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 );
+		injectors.put( StoredProcedureParameter.ModifyDN_NEW_SUPERIOR.class, $newSuperiorInjector );
+		injectors.put( StoredProcedureParameter.ModifyDN_OLD_RDN.class, $oldRDNInjector );
+		injectors.put( StoredProcedureParameter.ModifyDN_OLD_SUPERIOR_DN.class, $oldSuperiorDNInjector );
+		injectors.put( StoredProcedureParameter.ModifyDN_NEW_DN.class, $newDNInjector );
+		
     }
+	/**
+	 * Injector for 'entry' parameter of ModifyDNRequest as in RFC4511.
+	 */
+	MicroInjector $entryInjector = new MicroInjector()
+    {
+        public Object inject( StoredProcedureParameter param ) throws NamingException
+        {
+            // Return a safe copy constructed with user provided name.
+            return new LdapDN( oldDN.getUpName() );
+        };
+    };
 
+    /**
+     * Injector for 'newrdn' parameter of ModifyDNRequest as in RFC4511.
+     */
+    MicroInjector $newrdnInjector = new MicroInjector()
+    {
+        public Object inject( StoredProcedureParameter param ) throws NamingException
+        {
+            // Return a safe copy constructed with user provided name.
+            return new LdapDN( newRDN.getUpName() );
+        };
+    };
+    
+    /**
+     * Injector for 'newrdn' parameter of ModifyDNRequest as in RFC4511.
+     */
+    MicroInjector $deleteoldrdnInjector = new MicroInjector()
+    {
+        public Object inject( StoredProcedureParameter param ) throws NamingException
+        {
+            // Return a safe copy constructed with user provided name.
+            return new Boolean( deleteOldRn );
+        };
+    };
+    
+    /**
+     * Injector for 'newSuperior' parameter of ModifyDNRequest as in RFC4511.
+     */
+    MicroInjector $newSuperiorInjector = new MicroInjector()
+    {
+        public Object inject( StoredProcedureParameter param ) throws NamingException
+        {
+            // Return a safe copy constructed with user provided name.
+            return new LdapDN( newSuperiorDN.getUpName() );
+        };
+    };
+    
+    /**
+     * Extra injector for 'oldRDN' which can be derived from parameters specified for ModifyDNRequest as in RFC4511.
+     */
+    MicroInjector $oldRDNInjector = new MicroInjector()
+    {
+        public Object inject( StoredProcedureParameter param ) throws NamingException
+        {
+            // Return a safe copy constructed with user provided name.
+            return new LdapDN( oldRDN.getUpName() );
+        };
+    };
+    
+    /**
+     * Extra injector for 'oldRDN' which can be derived from parameters specified for ModifyDNRequest as in RFC4511.
+     */
+    MicroInjector $oldSuperiorDNInjector = new MicroInjector()
+    {
+        public Object inject( StoredProcedureParameter param ) throws NamingException
+        {
+            // Return a safe copy constructed with user provided name.
+            return new LdapDN( oldSuperiorDN.getUpName() );
+        };
+    };
+    
+    /**
+     * Extra injector for 'newDN' which can be derived from parameters specified for ModifyDNRequest as in RFC4511.
+     */
+    MicroInjector $newDNInjector = new MicroInjector()
+    {
+        public Object inject( StoredProcedureParameter param ) throws NamingException
+        {
+            // Return a safe copy constructed with user provided name.
+            return new LdapDN( newDN.getUpName() );
+        };
+    };
+    
 }

Modified: directory/apacheds/branches/kerberos-encryption-types/core/src/main/java/org/apache/directory/server/core/trigger/ModifyStoredProcedureParameterInjector.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/kerberos-encryption-types/core/src/main/java/org/apache/directory/server/core/trigger/ModifyStoredProcedureParameterInjector.java?view=diff&rev=539993&r1=539992&r2=539993
==============================================================================
--- directory/apacheds/branches/kerberos-encryption-types/core/src/main/java/org/apache/directory/server/core/trigger/ModifyStoredProcedureParameterInjector.java (original)
+++ directory/apacheds/branches/kerberos-encryption-types/core/src/main/java/org/apache/directory/server/core/trigger/ModifyStoredProcedureParameterInjector.java Sun May 20 18:53:07 2007
@@ -37,12 +37,9 @@
 public class ModifyStoredProcedureParameterInjector extends AbstractStoredProcedureParameterInjector
 {
     private LdapDN modifiedEntryName;
-    
     private ModificationItemImpl[] modifications;
-    
     private Attributes oldEntry;
     
-    private Map<Class, MicroInjector> injectors;
     
     public ModifyStoredProcedureParameterInjector( Invocation invocation, OperationContext opContext ) throws NamingException
     {
@@ -50,7 +47,7 @@
         modifiedEntryName = opContext.getDn();
         modifications = ((ModifyOperationContext)opContext).getModItems();
         this.oldEntry = getEntry();
-        injectors = super.getInjectors();
+        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 );

Modified: directory/apacheds/branches/kerberos-encryption-types/core/src/main/java/org/apache/directory/server/core/trigger/StoredProcedureParameterInjector.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/kerberos-encryption-types/core/src/main/java/org/apache/directory/server/core/trigger/StoredProcedureParameterInjector.java?view=diff&rev=539993&r1=539992&r2=539993
==============================================================================
--- directory/apacheds/branches/kerberos-encryption-types/core/src/main/java/org/apache/directory/server/core/trigger/StoredProcedureParameterInjector.java (original)
+++ directory/apacheds/branches/kerberos-encryption-types/core/src/main/java/org/apache/directory/server/core/trigger/StoredProcedureParameterInjector.java Sun May 20 18:53:07 2007
@@ -28,7 +28,7 @@
 
 public interface StoredProcedureParameterInjector
 {
-    List getArgumentsToInject( List parameterList ) throws NamingException;
+    List<Object> getArgumentsToInject( List<StoredProcedureParameter> parameterList ) throws NamingException;
     
     public interface MicroInjector
     {

Modified: directory/apacheds/branches/kerberos-encryption-types/core/src/main/java/org/apache/directory/server/core/trigger/TriggerService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/kerberos-encryption-types/core/src/main/java/org/apache/directory/server/core/trigger/TriggerService.java?view=diff&rev=539993&r1=539992&r2=539993
==============================================================================
--- directory/apacheds/branches/kerberos-encryption-types/core/src/main/java/org/apache/directory/server/core/trigger/TriggerService.java (original)
+++ directory/apacheds/branches/kerberos-encryption-types/core/src/main/java/org/apache/directory/server/core/trigger/TriggerService.java Sun May 20 18:53:07 2007
@@ -24,7 +24,6 @@
 import java.lang.reflect.Method;
 import java.text.ParseException;
 import java.util.ArrayList;
-import java.util.Collection;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
@@ -42,11 +41,10 @@
 import org.apache.directory.server.core.interceptor.NextInterceptor;
 import org.apache.directory.server.core.interceptor.context.AddOperationContext;
 import org.apache.directory.server.core.interceptor.context.LookupOperationContext;
-import org.apache.directory.server.core.interceptor.context.ModifyOperationContext;
-import org.apache.directory.server.core.interceptor.context.RenameOperationContext;
 import org.apache.directory.server.core.interceptor.context.MoveAndRenameOperationContext;
 import org.apache.directory.server.core.interceptor.context.MoveOperationContext;
 import org.apache.directory.server.core.interceptor.context.OperationContext;
+import org.apache.directory.server.core.interceptor.context.RenameOperationContext;
 import org.apache.directory.server.core.invocation.Invocation;
 import org.apache.directory.server.core.invocation.InvocationStack;
 import org.apache.directory.server.core.jndi.ServerLdapContext;
@@ -56,7 +54,6 @@
 import org.apache.directory.server.schema.registries.AttributeTypeRegistry;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.exception.LdapNamingException;
-import org.apache.directory.shared.ldap.message.ModificationItemImpl;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.schema.NormalizerMappingResolver;
@@ -122,7 +119,7 @@
      * @param entry the target entry that is considered as the trigger source
      * @throws NamingException if there are problems accessing attribute values
      */
-    private void addPrescriptiveTriggerSpecs( List triggerSpecs, PartitionNexusProxy proxy,
+    private void addPrescriptiveTriggerSpecs( List<TriggerSpecification> triggerSpecs, PartitionNexusProxy proxy,
         LdapDN dn, Attributes entry ) throws NamingException
     {
         
@@ -163,7 +160,7 @@
      * @param entry the target entry that is considered as the trigger source
      * @throws NamingException if there are problems accessing attribute values
      */
-    private void addEntryTriggerSpecs( Collection triggerSpecs, Attributes entry ) throws NamingException
+    private void addEntryTriggerSpecs( List<TriggerSpecification> triggerSpecs, Attributes entry ) throws NamingException
     {
         Attribute entryTrigger = entry.get( ENTRY_TRIGGER_ATTR );
         if ( entryTrigger == null )
@@ -191,15 +188,23 @@
         }
     }
     
-    public Map getActionTimeMappedTriggerSpecsForOperation( List triggerSpecs, LdapOperation ldapOperation )
+    /**
+     * Return a selection of trigger specifications for a certain type of trigger action time.
+     * 
+     * @NOTE: This method serves as an extion point for new Action Time types.
+     * 
+     * @param triggerSpecs
+     * @param ldapOperation
+     */
+    public Map<ActionTime, List<TriggerSpecification>> getActionTimeMappedTriggerSpecsForOperation( List<TriggerSpecification> triggerSpecs, LdapOperation ldapOperation )
     {
-        List afterTriggerSpecs = new ArrayList();
-        Map triggerSpecMap = new HashMap();
+        List<TriggerSpecification> afterTriggerSpecs = new ArrayList<TriggerSpecification>();
+        Map<ActionTime, List<TriggerSpecification>> triggerSpecMap = new HashMap<ActionTime, List<TriggerSpecification>>();
         
-        Iterator it = triggerSpecs.iterator();
+        Iterator<TriggerSpecification> it = triggerSpecs.iterator();
         while ( it.hasNext() )
         {
-            TriggerSpecification triggerSpec = ( TriggerSpecification ) it.next();
+            TriggerSpecification triggerSpec = it.next();
             if ( triggerSpec.getLdapOperation().equals( ldapOperation ) )
             {
                 if ( triggerSpec.getActionTime().equals( ActionTime.AFTER ) )
@@ -208,7 +213,7 @@
                 }
                 else
                 {
-                    // TODO
+                	
                 }    
             }
         }
@@ -259,7 +264,7 @@
         StoredProcedureParameterInjector injector = new AddStoredProcedureParameterInjector( invocation, name, entry );
 
         // Gather Trigger Specifications which apply to the entry being deleted.
-        List triggerSpecs = new ArrayList();
+        List<TriggerSpecification> triggerSpecs = new ArrayList<TriggerSpecification>();
         addPrescriptiveTriggerSpecs( triggerSpecs, proxy, name, entry );
 
         /**
@@ -267,13 +272,13 @@
          */
         
         // Gather a Map<ActionTime,TriggerSpecification> where TriggerSpecification.ldapOperation = LdapOperation.ADD.
-        Map triggerMap = getActionTimeMappedTriggerSpecsForOperation( triggerSpecs, LdapOperation.ADD );
+        Map<ActionTime, List<TriggerSpecification>> triggerMap = getActionTimeMappedTriggerSpecsForOperation( triggerSpecs, LdapOperation.ADD );
         
         next.add( addContext );
         triggerSpecCache.subentryAdded( name, entry );
         
         // Fire AFTER Triggers.
-        List afterTriggerSpecs = ( List ) triggerMap.get( ActionTime.AFTER );
+        List<TriggerSpecification> afterTriggerSpecs = triggerMap.get( ActionTime.AFTER );
         executeTriggers( afterTriggerSpecs, injector, callerRootCtx );
     }
 
@@ -296,18 +301,18 @@
         StoredProcedureParameterInjector injector = new DeleteStoredProcedureParameterInjector( invocation, name );
 
         // Gather Trigger Specifications which apply to the entry being deleted.
-        List triggerSpecs = new ArrayList();
+        List<TriggerSpecification> triggerSpecs = new ArrayList<TriggerSpecification>();
         addPrescriptiveTriggerSpecs( triggerSpecs, proxy, name, deletedEntry );
         addEntryTriggerSpecs( triggerSpecs, deletedEntry );
         
         // Gather a Map<ActionTime,TriggerSpecification> where TriggerSpecification.ldapOperation = LdapOperation.DELETE.
-        Map triggerMap = getActionTimeMappedTriggerSpecsForOperation( triggerSpecs, LdapOperation.DELETE );
+        Map<ActionTime, List<TriggerSpecification>> triggerMap = getActionTimeMappedTriggerSpecsForOperation( triggerSpecs, LdapOperation.DELETE );
         
         next.delete( deleteContext );
         triggerSpecCache.subentryDeleted( name, deletedEntry );
         
         // Fire AFTER Triggers.
-        List afterTriggerSpecs = ( List ) triggerMap.get( ActionTime.AFTER );
+        List<TriggerSpecification> afterTriggerSpecs = triggerMap.get( ActionTime.AFTER );
         executeTriggers( afterTriggerSpecs, injector, callerRootCtx );
     }
     
@@ -321,7 +326,6 @@
         }
         
         LdapDN normName = opContext.getDn();
-        ModificationItemImpl[] mods = ((ModifyOperationContext)opContext).getModItems();
         
         // Gather supplementary data.
         Invocation invocation = InvocationStack.getInstance().peek();
@@ -331,18 +335,18 @@
         StoredProcedureParameterInjector injector = new ModifyStoredProcedureParameterInjector( invocation, opContext );
 
         // Gather Trigger Specifications which apply to the entry being modified.
-        List triggerSpecs = new ArrayList();
+        List<TriggerSpecification> triggerSpecs = new ArrayList<TriggerSpecification>();
         addPrescriptiveTriggerSpecs( triggerSpecs, proxy, normName, modifiedEntry );
         addEntryTriggerSpecs( triggerSpecs, modifiedEntry );
         
         // Gather a Map<ActionTime,TriggerSpecification> where TriggerSpecification.ldapOperation = LdapOperation.MODIFY.
-        Map triggerMap = getActionTimeMappedTriggerSpecsForOperation( triggerSpecs, LdapOperation.MODIFY );
+        Map<ActionTime, List<TriggerSpecification>> triggerMap = getActionTimeMappedTriggerSpecsForOperation( triggerSpecs, LdapOperation.MODIFY );
         
         next.modify( opContext );
         triggerSpecCache.subentryModified( opContext, modifiedEntry );
         
         // Fire AFTER Triggers.
-        List afterTriggerSpecs = ( List ) triggerMap.get( ActionTime.AFTER );
+        List<TriggerSpecification> afterTriggerSpecs = triggerMap.get( ActionTime.AFTER );
         executeTriggers( afterTriggerSpecs, injector, callerRootCtx );
     }
     
@@ -379,18 +383,18 @@
             invocation, deleteOldRn, oldRDN, newRDN, oldSuperiorDN, newSuperiorDN, oldDN, newDN );
         
         // Gather Trigger Specifications which apply to the entry being renamed.
-        List triggerSpecs = new ArrayList();
+        List<TriggerSpecification> triggerSpecs = new ArrayList<TriggerSpecification>();
         addPrescriptiveTriggerSpecs( triggerSpecs, proxy, name, renamedEntry );
         addEntryTriggerSpecs( triggerSpecs, renamedEntry );
         
         // Gather a Map<ActionTime,TriggerSpecification> where TriggerSpecification.ldapOperation = LdapOperation.MODIFYDN_RENAME.
-        Map triggerMap = getActionTimeMappedTriggerSpecsForOperation( triggerSpecs, LdapOperation.MODIFYDN_RENAME );
+        Map<ActionTime, List<TriggerSpecification>> triggerMap = getActionTimeMappedTriggerSpecsForOperation( triggerSpecs, LdapOperation.MODIFYDN_RENAME );
         
         next.rename( renameContext );
         triggerSpecCache.subentryRenamed( name, newDN );
         
         // Fire AFTER Triggers.
-        List afterTriggerSpecs = ( List ) triggerMap.get( ActionTime.AFTER );
+        List<TriggerSpecification> afterTriggerSpecs = triggerMap.get( ActionTime.AFTER );
         executeTriggers( afterTriggerSpecs, injector, callerRootCtx );
     }
     
@@ -427,7 +431,7 @@
             invocation, deleteOldRn, oldRDN, newRDN, oldSuperiorDN, newSuperiorDN, oldDN, newDN );
 
         // Gather Trigger Specifications which apply to the entry being exported.
-        List exportTriggerSpecs = new ArrayList();
+        List<TriggerSpecification> exportTriggerSpecs = new ArrayList<TriggerSpecification>();
         addPrescriptiveTriggerSpecs( exportTriggerSpecs, proxy, oriChildName, movedEntry );
         addEntryTriggerSpecs( exportTriggerSpecs, movedEntry );
         
@@ -452,21 +456,21 @@
         
         // Gather Trigger Specifications which apply to the entry being imported.
         // Note: Entry Trigger Specifications are not valid for Import.
-        List importTriggerSpecs = new ArrayList();
+        List<TriggerSpecification> importTriggerSpecs = new ArrayList<TriggerSpecification>();
         addPrescriptiveTriggerSpecs( importTriggerSpecs, proxy, newDN, fakeImportedEntry );
         
         // Gather a Map<ActionTime,TriggerSpecification> where TriggerSpecification.ldapOperation = LdapOperation.MODIFYDN_EXPORT.
-        Map exportTriggerMap = getActionTimeMappedTriggerSpecsForOperation( exportTriggerSpecs, LdapOperation.MODIFYDN_EXPORT );
+        Map<ActionTime, List<TriggerSpecification>> exportTriggerMap = getActionTimeMappedTriggerSpecsForOperation( exportTriggerSpecs, LdapOperation.MODIFYDN_EXPORT );
         
         // Gather a Map<ActionTime,TriggerSpecification> where TriggerSpecification.ldapOperation = LdapOperation.MODIFYDN_IMPORT.
-        Map importTriggerMap = getActionTimeMappedTriggerSpecsForOperation( importTriggerSpecs, LdapOperation.MODIFYDN_IMPORT );
+        Map<ActionTime, List<TriggerSpecification>> importTriggerMap = getActionTimeMappedTriggerSpecsForOperation( importTriggerSpecs, LdapOperation.MODIFYDN_IMPORT );
         
         next.moveAndRename( moveAndRenameContext );
         triggerSpecCache.subentryRenamed( oldDN, newDN );
         
         // Fire AFTER Triggers.
-        List afterExportTriggerSpecs = ( List ) exportTriggerMap.get( ActionTime.AFTER );
-        List afterImportTriggerSpecs = ( List ) importTriggerMap.get( ActionTime.AFTER );
+        List<TriggerSpecification> afterExportTriggerSpecs = exportTriggerMap.get( ActionTime.AFTER );
+        List<TriggerSpecification> afterImportTriggerSpecs = importTriggerMap.get( ActionTime.AFTER );
         executeTriggers( afterExportTriggerSpecs, injector, callerRootCtx );
         executeTriggers( afterImportTriggerSpecs, injector, callerRootCtx );
     }
@@ -503,7 +507,7 @@
             invocation, false, oldRDN, newRDN, oldSuperiorDN, newSuperiorDN, oldDN, newDN );
 
         // Gather Trigger Specifications which apply to the entry being exported.
-        List exportTriggerSpecs = new ArrayList();
+        List<TriggerSpecification> exportTriggerSpecs = new ArrayList<TriggerSpecification>();
         addPrescriptiveTriggerSpecs( exportTriggerSpecs, proxy, oriChildName, movedEntry );
         addEntryTriggerSpecs( exportTriggerSpecs, movedEntry );
         
@@ -529,21 +533,21 @@
         
         // Gather Trigger Specifications which apply to the entry being imported.
         // Note: Entry Trigger Specifications are not valid for Import.
-        List importTriggerSpecs = new ArrayList();
+        List<TriggerSpecification> importTriggerSpecs = new ArrayList<TriggerSpecification>();
         addPrescriptiveTriggerSpecs( importTriggerSpecs, proxy, newDN, fakeImportedEntry );
         
         // Gather a Map<ActionTime,TriggerSpecification> where TriggerSpecification.ldapOperation = LdapOperation.MODIFYDN_EXPORT.
-        Map exportTriggerMap = getActionTimeMappedTriggerSpecsForOperation( exportTriggerSpecs, LdapOperation.MODIFYDN_EXPORT );
+        Map<ActionTime, List<TriggerSpecification>> exportTriggerMap = getActionTimeMappedTriggerSpecsForOperation( exportTriggerSpecs, LdapOperation.MODIFYDN_EXPORT );
         
         // Gather a Map<ActionTime,TriggerSpecification> where TriggerSpecification.ldapOperation = LdapOperation.MODIFYDN_IMPORT.
-        Map importTriggerMap = getActionTimeMappedTriggerSpecsForOperation( importTriggerSpecs, LdapOperation.MODIFYDN_IMPORT );
+        Map<ActionTime, List<TriggerSpecification>> importTriggerMap = getActionTimeMappedTriggerSpecsForOperation( importTriggerSpecs, LdapOperation.MODIFYDN_IMPORT );
         
         next.move( moveContext );
         triggerSpecCache.subentryRenamed( oldDN, newDN );
         
         // Fire AFTER Triggers.
-        List afterExportTriggerSpecs = ( List ) exportTriggerMap.get( ActionTime.AFTER );
-        List afterImportTriggerSpecs = ( List ) importTriggerMap.get( ActionTime.AFTER );
+        List<TriggerSpecification> afterExportTriggerSpecs = exportTriggerMap.get( ActionTime.AFTER );
+        List<TriggerSpecification> afterImportTriggerSpecs = importTriggerMap.get( ActionTime.AFTER );
         executeTriggers( afterExportTriggerSpecs, injector, callerRootCtx );
         executeTriggers( afterImportTriggerSpecs, injector, callerRootCtx );
     }
@@ -552,15 +556,15 @@
     // Utility Methods
     ////////////////////////////////////////////////////////////////////////////
     
-    private Object executeTriggers( List triggerSpecs, StoredProcedureParameterInjector injector, ServerLdapContext callerRootCtx ) throws NamingException
+    private Object executeTriggers( List<TriggerSpecification> triggerSpecs, StoredProcedureParameterInjector injector, ServerLdapContext callerRootCtx ) throws NamingException
     {
         Object result = null;
         
-        Iterator it = triggerSpecs.iterator();
+        Iterator<TriggerSpecification> it = triggerSpecs.iterator();
         
         while( it.hasNext() )
         {
-            TriggerSpecification tsec = ( TriggerSpecification ) it.next();
+            TriggerSpecification tsec = it.next();
             
             // TODO: Replace the Authorization Code with a REAL one.
             if ( triggerExecutionAuthorizer.hasPermission() )
@@ -582,10 +586,11 @@
 
     private Object executeTrigger( TriggerSpecification tsec, StoredProcedureParameterInjector injector, ServerLdapContext callerRootCtx ) throws NamingException
     {
-    	List returnValues = new ArrayList();
+    	List<Object> returnValues = new ArrayList<Object>();
     	List<SPSpec> spSpecs = tsec.getSPSpecs();
-        for (SPSpec spSpec : spSpecs) {
-        	List arguments = new ArrayList();
+        for ( SPSpec spSpec : spSpecs )
+        {
+        	List<Object> arguments = new ArrayList<Object>();
         	arguments.addAll( injector.getArgumentsToInject( spSpec.getParameters() ) );
         	List<Class> typeList = new ArrayList<Class>();
             typeList.addAll( getTypesFromValues( arguments ) );

Modified: directory/apacheds/branches/kerberos-encryption-types/core/src/main/java/org/apache/directory/server/core/trigger/TriggerSpecCache.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/kerberos-encryption-types/core/src/main/java/org/apache/directory/server/core/trigger/TriggerSpecCache.java?view=diff&rev=539993&r1=539992&r2=539993
==============================================================================
--- directory/apacheds/branches/kerberos-encryption-types/core/src/main/java/org/apache/directory/server/core/trigger/TriggerSpecCache.java (original)
+++ directory/apacheds/branches/kerberos-encryption-types/core/src/main/java/org/apache/directory/server/core/trigger/TriggerSpecCache.java Sun May 20 18:53:07 2007
@@ -78,7 +78,7 @@
     /** cloned startup environment properties we use for subentry searching */
     private final Hashtable env;
     /** a map of strings to TriggerSpecification collections */
-    private final Map triggerSpecs = new HashMap();
+    private final Map<String, List<TriggerSpecification>> triggerSpecs = new HashMap<String, List<TriggerSpecification>>();
     /** a handle on the partition nexus */
     private final PartitionNexus nexus;
     /** a normalizing TriggerSpecification parser */
@@ -170,7 +170,7 @@
             return;
         }
         
-        List subentryTriggerSpecs = new ArrayList();
+        List<TriggerSpecification> subentryTriggerSpecs = new ArrayList<TriggerSpecification>();
         
         for ( int ii = 0; ii < triggerSpec.size(); ii++ )
         {
@@ -179,14 +179,14 @@
             try
             {
                 item = triggerSpecParser.parse( ( String ) triggerSpec.get( ii ) );
+                subentryTriggerSpecs.add( item );
             }
             catch ( ParseException e )
             {
                 String msg = "TriggerSpecification parser failure on '" + item + "'. Cannnot add Trigger Specificaitons to TriggerSpecCache.";
                 log.error( msg, e );
             }
-
-            subentryTriggerSpecs.add( item );
+            
         }
         
         triggerSpecs.put( normName.toString(), subentryTriggerSpecs );
@@ -229,12 +229,12 @@
     }
 
 
-    public List getSubentryTriggerSpecs( String subentryDn )
+    public List<TriggerSpecification> getSubentryTriggerSpecs( String subentryDn )
     {
-        List subentryTriggerSpecs = ( List ) triggerSpecs.get( subentryDn );
+        List<TriggerSpecification> subentryTriggerSpecs = triggerSpecs.get( subentryDn );
         if ( subentryTriggerSpecs == null )
         {
-            return Collections.EMPTY_LIST;
+            return Collections.emptyList();
         }
         return Collections.unmodifiableList( subentryTriggerSpecs );
     }

Modified: directory/apacheds/branches/kerberos-encryption-types/core/src/test/java/org/apache/directory/server/core/authz/support/MaxImmSubFilterTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/kerberos-encryption-types/core/src/test/java/org/apache/directory/server/core/authz/support/MaxImmSubFilterTest.java?view=diff&rev=539993&r1=539992&r2=539993
==============================================================================
--- directory/apacheds/branches/kerberos-encryption-types/core/src/test/java/org/apache/directory/server/core/authz/support/MaxImmSubFilterTest.java (original)
+++ directory/apacheds/branches/kerberos-encryption-types/core/src/test/java/org/apache/directory/server/core/authz/support/MaxImmSubFilterTest.java Sun May 20 18:53:07 2007
@@ -154,7 +154,7 @@
         final int count;
 
 
-        public MockProxy(int count)
+        public MockProxy(int count) throws NamingException 
         {
             super( new DeadContext(), new MockDirectoryService() );
             this.count = count;

Modified: directory/apacheds/branches/kerberos-encryption-types/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmIndex.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/kerberos-encryption-types/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmIndex.java?view=diff&rev=539993&r1=539992&r2=539993
==============================================================================
--- directory/apacheds/branches/kerberos-encryption-types/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmIndex.java (original)
+++ directory/apacheds/branches/kerberos-encryption-types/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmIndex.java Sun May 20 18:53:07 2007
@@ -30,7 +30,6 @@
 import javax.naming.directory.Attributes;
 
 import jdbm.RecordManager;
-import jdbm.helper.LongSerializer;
 import jdbm.helper.MRU;
 import jdbm.recman.BaseRecordManager;
 import jdbm.recman.CacheRecordManager;
@@ -482,6 +481,11 @@
      */
     public Object getNormalized( Object attrVal ) throws NamingException
     {
+        if ( attrVal instanceof Long )
+        {
+            return attrVal;
+        }
+        
         Object normalized = keyCache.get( attrVal );
 
         if ( null == normalized )

Modified: directory/apacheds/branches/kerberos-encryption-types/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmMasterTable.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/kerberos-encryption-types/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmMasterTable.java?view=diff&rev=539993&r1=539992&r2=539993
==============================================================================
--- directory/apacheds/branches/kerberos-encryption-types/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmMasterTable.java (original)
+++ directory/apacheds/branches/kerberos-encryption-types/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmMasterTable.java Sun May 20 18:53:07 2007
@@ -25,14 +25,10 @@
 
 import jdbm.RecordManager;
 import jdbm.helper.LongSerializer;
-import jdbm.helper.Serializer;
 import jdbm.helper.StringComparator;
 
 import org.apache.directory.server.core.partition.impl.btree.MasterTable;
 import org.apache.directory.server.schema.SerializableComparator;
-//import org.apache.directory.shared.ldap.util.BigIntegerComparator;
-import org.apache.directory.shared.ldap.util.AttributesSerializerUtils;
-import org.apache.directory.shared.ldap.util.LongComparator;
 
 
 /**
@@ -52,7 +48,23 @@
 
         public int compare( Object o1, Object o2 )
         {
-            return LongComparator.INSTANCE.compare( o1, o2 );
+        	try
+        	{
+	        	long thisVal = (Long)o1;
+	        	long anotherVal = (Long)o2;
+	        	return ( thisVal < anotherVal ? -1 : ( thisVal == anotherVal ? 0 : 1 ) );
+        	}
+        	catch ( NullPointerException npe )
+        	{
+    	        if ( o1 == null )
+    	        {
+    	            throw new IllegalArgumentException( "Argument 'obj1' is null" );
+    	        }
+    	        else
+    	        {
+    	            throw new IllegalArgumentException( "Argument 'obj2' is null" );
+    	        }
+        	}
         }
     };
     private static final SerializableComparator STRING_COMPARATOR = new SerializableComparator(

Modified: directory/apacheds/branches/kerberos-encryption-types/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/BindHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/kerberos-encryption-types/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/BindHandler.java?view=diff&rev=539993&r1=539992&r2=539993
==============================================================================
--- directory/apacheds/branches/kerberos-encryption-types/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/BindHandler.java (original)
+++ directory/apacheds/branches/kerberos-encryption-types/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/BindHandler.java Sun May 20 18:53:07 2007
@@ -24,16 +24,16 @@
 
 import javax.naming.Context;
 import javax.naming.NamingException;
-import javax.naming.ldap.InitialLdapContext;
 import javax.naming.ldap.LdapContext;
 import javax.naming.spi.InitialContextFactory;
 
+import org.apache.directory.server.core.DirectoryService;
 import org.apache.directory.server.core.configuration.StartupConfiguration;
 import org.apache.directory.server.core.jndi.PropertyKeys;
+import org.apache.directory.server.core.jndi.ServerLdapContext;
 import org.apache.directory.server.ldap.SessionRegistry;
 import org.apache.directory.shared.ldap.exception.LdapException;
 import org.apache.directory.shared.ldap.message.BindRequest;
-import org.apache.directory.shared.ldap.message.Control;
 import org.apache.directory.shared.ldap.message.LdapResult;
 import org.apache.directory.shared.ldap.message.ManageDsaITControl;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
@@ -54,7 +54,6 @@
 public class BindHandler implements LdapMessageHandler
 {
     private static final Logger log = LoggerFactory.getLogger( BindHandler.class );
-    private static final Control[] EMPTY = new Control[0];
 
     /** Speedup for logs */
     private static final boolean IS_DEBUG = log.isDebugEnabled();
@@ -115,8 +114,7 @@
             }
             else
             {
-                Control[] connCtls = ( Control[] ) req.getControls().values().toArray( EMPTY );
-                ctx = new InitialLdapContext( env, connCtls );
+                ctx = new ServerLdapContext( DirectoryService.getInstance(), env );
             }
         }
         catch ( NamingException e )

Modified: directory/apacheds/branches/kerberos-encryption-types/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/SearchResponseIterator.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/kerberos-encryption-types/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/SearchResponseIterator.java?view=diff&rev=539993&r1=539992&r2=539993
==============================================================================
--- directory/apacheds/branches/kerberos-encryption-types/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/SearchResponseIterator.java (original)
+++ directory/apacheds/branches/kerberos-encryption-types/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/SearchResponseIterator.java Sun May 20 18:53:07 2007
@@ -44,6 +44,7 @@
 import org.apache.directory.shared.ldap.message.SearchResponseEntryImpl;
 import org.apache.directory.shared.ldap.message.SearchResponseReference;
 import org.apache.directory.shared.ldap.message.SearchResponseReferenceImpl;
+import org.apache.directory.shared.ldap.message.ServerSearchResult;
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.util.ExceptionUtils;
 import org.apache.mina.common.IoSession;
@@ -94,28 +95,22 @@
         {
             if ( underlying.hasMore() )
             {
-                SearchResult result = ( SearchResult ) underlying.next();
+                ServerSearchResult result = ( ServerSearchResult ) underlying.next();
 
                 /*
                  * Now we have to build the prefetched object from the 'result'
                  * local variable for the following call to next()
                  */
                 Attribute ref = result.getAttributes().get( "ref" );
-                if ( !ctx.isReferral( result.getName() )
+                
+                if ( !ctx.isReferral( result.getDn() )
                     || req.getControls().containsKey( ManageDsaITControl.CONTROL_OID ) )
                 {
                     SearchResponseEntry respEntry;
                     respEntry = new SearchResponseEntryImpl( req.getMessageId() );
                     respEntry.setAttributes( result.getAttributes() );
-                    try
-                    {
-                        respEntry.setObjectName( new LdapDN( result.getName() ) );
-                    }
-                    catch ( InvalidNameException ine )
-                    {
-                        log.error( "Invalid object name : " + result.getName(), ine);
-                        throw new RuntimeException( ine );
-                    }
+                    
+                    respEntry.setObjectName( result.getDn() );
                     
                     prefetched = respEntry;
                 }

Modified: directory/apacheds/branches/kerberos-encryption-types/schema-bootstrap/src/main/schema/apache.schema
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/kerberos-encryption-types/schema-bootstrap/src/main/schema/apache.schema?view=diff&rev=539993&r1=539992&r2=539993
==============================================================================
--- directory/apacheds/branches/kerberos-encryption-types/schema-bootstrap/src/main/schema/apache.schema (original)
+++ directory/apacheds/branches/kerberos-encryption-types/schema-bootstrap/src/main/schema/apache.schema Sun May 20 18:53:07 2007
@@ -104,19 +104,22 @@
     STRUCTURAL
     MUST prefNodeName )
 
-attributetype ( 1.3.6.1.4.1.18060.0.4.1.2.12 NAME 'prescriptiveACI'
+#attributetype ( 1.3.6.1.4.1.18060.0.4.1.2.12 NAME 'prescriptiveACI'
+attributetype ( 2.5.24.4 NAME 'prescriptiveACI'
   DESC 'Access control information that applies to a set of entries'
   EQUALITY directoryStringFirstComponentMatch
   SYNTAX 1.3.6.1.4.1.1466.115.121.1.1
   USAGE directoryOperation )
 
-attributetype ( 1.3.6.1.4.1.18060.0.4.1.2.13 NAME 'entryACI'
+# was attributetype ( 1.3.6.1.4.1.18060.0.4.1.2.13 NAME 'entryACI' ...
+attributetype ( 2.5.24.5 NAME 'entryACI'
   DESC 'Access control information that applies to a single entry'
   EQUALITY directoryStringFirstComponentMatch
   SYNTAX 1.3.6.1.4.1.1466.115.121.1.1
   USAGE directoryOperation )
 
-attributetype ( 1.3.6.1.4.1.18060.0.4.1.2.14 NAME 'subentryACI'
+#attributetype ( 1.3.6.1.4.1.18060.0.4.1.2.14 NAME 'subentryACI'
+attributetype ( 2.5.24.6 NAME 'subentryACI'
   DESC 'Access control information that applies to a single subentry'
   EQUALITY directoryStringFirstComponentMatch
   SYNTAX 1.3.6.1.4.1.1466.115.121.1.1

Modified: directory/apacheds/branches/kerberos-encryption-types/schema-bootstrap/src/main/schema/apachemeta.schema
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/kerberos-encryption-types/schema-bootstrap/src/main/schema/apachemeta.schema?view=diff&rev=539993&r1=539992&r2=539993
==============================================================================
--- directory/apacheds/branches/kerberos-encryption-types/schema-bootstrap/src/main/schema/apachemeta.schema (original)
+++ directory/apacheds/branches/kerberos-encryption-types/schema-bootstrap/src/main/schema/apachemeta.schema Sun May 20 18:53:07 2007
@@ -70,7 +70,7 @@
 #         | 1.3.6.1.4.1.18060.0.4.0.2.31 | m-matchingRuleSyntax        |
 #         | 1.3.6.1.4.1.18060.0.4.0.2.32 | m-fqcn                      |
 #         | 1.3.6.1.4.1.18060.0.4.0.2.33 | m-bytecode                  |
-#         | 1.3.6.1.4.1.18060.0.4.0.2.34 | x-humanReadible             |
+#         | 1.3.6.1.4.1.18060.0.4.0.2.34 | x-humanReadable             |
 #         | 1.3.6.1.4.1.18060.0.4.0.2.37 | m-disabled                  |
 #         | 1.3.6.1.4.1.18060.0.4.0.2.38 | m-dependencies              |
 #         | 1.3.6.1.4.1.18060.0.4.0.2.39 | m-length                    |
@@ -542,9 +542,9 @@
     SINGLE-VALUE
 )
 
-# --- x-humanReadible AttributeType ------------------------------------------------
-attributetype ( 1.3.6.1.4.1.18060.0.4.0.2.34 NAME 'x-humanReadible'
-    DESC 'whether or not a syntax is human readible'
+# --- x-humanReadable AttributeType ------------------------------------------------
+attributetype ( 1.3.6.1.4.1.18060.0.4.0.2.34 NAME 'x-humanReadable'
+    DESC 'whether or not a syntax is human readable'
     EQUALITY booleanMatch
     SYNTAX 1.3.6.1.4.1.1466.115.121.1.7
     SINGLE-VALUE

Modified: directory/apacheds/branches/kerberos-encryption-types/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultAttributeTypeRegistry.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/kerberos-encryption-types/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultAttributeTypeRegistry.java?view=diff&rev=539993&r1=539992&r2=539993
==============================================================================
--- directory/apacheds/branches/kerberos-encryption-types/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultAttributeTypeRegistry.java (original)
+++ directory/apacheds/branches/kerberos-encryption-types/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultAttributeTypeRegistry.java Sun May 20 18:53:07 2007
@@ -50,6 +50,9 @@
     /** static class logger */
     private final static Logger log = LoggerFactory.getLogger( DefaultAttributeTypeRegistry.class );
 
+    /** Speedup for DEBUG mode */
+    private static final boolean IS_DEBUG = log.isDebugEnabled();
+    
     /** maps an OID to an AttributeType */
     private final Map<String,AttributeType> byOid;
     /** maps OIDs to a Set of descendants for that OID */
@@ -98,7 +101,8 @@
 
         registerDescendants( attributeType );
         byOid.put( attributeType.getOid(), attributeType );
-        if ( log.isDebugEnabled() )
+        
+        if ( IS_DEBUG )
         {
             log.debug( "registed attributeType: " + attributeType );
         }
@@ -158,10 +162,12 @@
         }
 
         AttributeType attributeType = ( AttributeType ) byOid.get( id );
-        if ( log.isDebugEnabled() )
+        
+        if ( IS_DEBUG )
         {
             log.debug( "lookup with id" + id + "' of attributeType: " + attributeType );
         }
+        
         return attributeType;
     }
 

Modified: directory/apacheds/branches/kerberos-encryption-types/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultObjectClassRegistry.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/kerberos-encryption-types/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultObjectClassRegistry.java?view=diff&rev=539993&r1=539992&r2=539993
==============================================================================
--- directory/apacheds/branches/kerberos-encryption-types/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultObjectClassRegistry.java (original)
+++ directory/apacheds/branches/kerberos-encryption-types/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultObjectClassRegistry.java Sun May 20 18:53:07 2007
@@ -41,6 +41,10 @@
 {
     /** static class logger */
     private final static Logger log = LoggerFactory.getLogger( DefaultObjectClassRegistry.class );
+    
+    /** Speedup for DEBUG mode */
+    private static final boolean IS_DEBUG = log.isDebugEnabled();
+    
     /** maps an OID to an ObjectClass */
     private final Map<String,ObjectClass> byOid;
     /** the registry used to resolve names to OIDs */
@@ -85,7 +89,8 @@
         }
         
         byOid.put( objectClass.getOid(), objectClass );
-        if ( log.isDebugEnabled() )
+        
+        if ( IS_DEBUG )
         {
             log.debug( "registered objectClass: " + objectClass );
         }
@@ -103,7 +108,8 @@
         }
 
         ObjectClass objectClass = ( ObjectClass ) byOid.get( id );
-        if ( log.isDebugEnabled() )
+        
+        if ( IS_DEBUG )
         {
             log.debug( "looked objectClass with OID '" + id + "' and got back " + objectClass );
         }

Modified: directory/apacheds/branches/kerberos-encryption-types/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultOidRegistry.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/kerberos-encryption-types/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultOidRegistry.java?view=diff&rev=539993&r1=539992&r2=539993
==============================================================================
--- directory/apacheds/branches/kerberos-encryption-types/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultOidRegistry.java (original)
+++ directory/apacheds/branches/kerberos-encryption-types/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultOidRegistry.java Sun May 20 18:53:07 2007
@@ -45,8 +45,13 @@
 {
     /** static class logger */
     private final static Logger log = LoggerFactory.getLogger( DefaultOidRegistry.class );
+    
+    /** Speedup for DEBUG mode */
+    private static final boolean IS_DEBUG = log.isDebugEnabled();
+    
     /** Maps OID to a name or a list of names if more than one name exists */
     private Map byOid = new HashMap();
+    
     /** Maps several names to an OID */
     private Map<String,String> byName = new HashMap<String,String>();
 
@@ -73,7 +78,8 @@
         if ( byName.containsKey( name ) )
         {
             String oid = ( String ) byName.get( name );
-            if ( log.isDebugEnabled() )
+            
+            if ( IS_DEBUG )
             {
                 log.debug( "looked up OID '" + oid + "' with id '" + name + "'" );
             }
@@ -91,7 +97,8 @@
         if ( !name.equals( lowerCase ) && byName.containsKey( lowerCase ) )
         {
             String oid = ( String ) byName.get( lowerCase );
-            if ( log.isDebugEnabled() )
+            
+            if ( IS_DEBUG )
             {
                 log.debug( "looked up OID '" + oid + "' with id '" + name + "'" );
             }
@@ -137,18 +144,21 @@
 
         if ( value instanceof String )
         {
-            if ( log.isDebugEnabled() )
+            if ( IS_DEBUG )
             {
                 log.debug( "looked up primary name '" + value + "' with OID '" + oid + "'" );
             }
+            
             return ( String ) value;
         }
 
         String name = ( String ) ( ( List ) value ).get( 0 );
-        if ( log.isDebugEnabled() )
+        
+        if ( IS_DEBUG )
         {
             log.debug( "looked up primary name '" + name + "' with OID '" + oid + "'" );
         }
+        
         return name;
     }
 
@@ -169,17 +179,20 @@
         if ( value instanceof String )
         {
             List list = Collections.singletonList( value );
-            if ( log.isDebugEnabled() )
+            
+            if ( IS_DEBUG )
             {
                 log.debug( "looked up names '" + list + "' for OID '" + oid + "'" );
             }
+            
             return list;
         }
 
-        if ( log.isDebugEnabled() )
+        if ( IS_DEBUG )
         {
             log.debug( "looked up names '" + value + "' for OID '" + oid + "'" );
         }
+        
         return ( List ) value;
     }
 
@@ -292,7 +305,8 @@
         }
 
         byOid.put( oid, value );
-        if ( log.isDebugEnabled() )
+        
+        if ( IS_DEBUG )
         {
             log.debug( "registed name '" + name + "' with OID: " + oid );
         }

Modified: directory/apacheds/branches/kerberos-encryption-types/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultSyntaxRegistry.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/kerberos-encryption-types/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultSyntaxRegistry.java?view=diff&rev=539993&r1=539992&r2=539993
==============================================================================
--- directory/apacheds/branches/kerberos-encryption-types/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultSyntaxRegistry.java (original)
+++ directory/apacheds/branches/kerberos-encryption-types/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultSyntaxRegistry.java Sun May 20 18:53:07 2007
@@ -42,6 +42,10 @@
 {
     /** static class logger */
     private final static Logger log = LoggerFactory.getLogger( DefaultSyntaxRegistry.class );
+    
+    /** Speedup for DEBUG mode */
+    private static final boolean IS_DEBUG = log.isDebugEnabled();
+    
     /** a map of entries using an OID for the key and a Syntax for the value */
     private final Map<String,Syntax> byOid;
     /** the OID oidRegistry this oidRegistry uses to register new syntax OIDs */
@@ -74,10 +78,12 @@
         if ( byOid.containsKey( id ) )
         {
             Syntax syntax = ( Syntax ) byOid.get( id );
-            if ( log.isDebugEnabled() )
+            
+            if ( IS_DEBUG )
             {
                 log.debug( "looked up using id '" + id + "': " + syntax );
             }
+            
             return syntax;
         }
 
@@ -105,7 +111,8 @@
         }
 
         byOid.put( syntax.getOid(), syntax );
-        if ( log.isDebugEnabled() )
+        
+        if ( IS_DEBUG )
         {
             log.debug( "registered syntax: " + syntax );
         }

Modified: directory/apacheds/branches/kerberos-encryption-types/server-jndi/src/main/java/org/apache/directory/server/jndi/ServerContextFactory.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/kerberos-encryption-types/server-jndi/src/main/java/org/apache/directory/server/jndi/ServerContextFactory.java?view=diff&rev=539993&r1=539992&r2=539993
==============================================================================
--- directory/apacheds/branches/kerberos-encryption-types/server-jndi/src/main/java/org/apache/directory/server/jndi/ServerContextFactory.java (original)
+++ directory/apacheds/branches/kerberos-encryption-types/server-jndi/src/main/java/org/apache/directory/server/jndi/ServerContextFactory.java Sun May 20 18:53:07 2007
@@ -57,6 +57,7 @@
 import org.apache.directory.shared.ldap.exception.LdapNamingException;
 import org.apache.directory.shared.ldap.message.AttributesImpl;
 import org.apache.directory.shared.ldap.message.extended.NoticeOfDisconnect;
+import org.apache.directory.shared.ldap.util.StringTools;
 import org.apache.mina.common.DefaultIoFilterChainBuilder;
 import org.apache.mina.common.ExecutorThreadModel;
 import org.apache.mina.common.IoAcceptor;
@@ -87,6 +88,7 @@
  */
 public class ServerContextFactory extends CoreContextFactory
 {
+	/** Logger for this class */
     private static final Logger log = LoggerFactory.getLogger( ServerContextFactory.class.getName() );
     private static final String LDIF_FILES_DN = "ou=loadedLdifFiles,ou=configuration,ou=system";
 
@@ -105,7 +107,12 @@
     private static NtpServer udpNtpServer;
     private DirectoryService directoryService;
 
-
+    /**
+     * Initialize the SocketAcceptor so that the server can accept
+     * incomming requests.
+     * 
+     * We will start N threads, spreaded on the available CPUs.
+     */
     public void beforeStartup( DirectoryService service )
     {
         int maxThreads = service.getConfiguration().getStartupConfiguration().getMaxThreads();
@@ -141,60 +148,72 @@
         if ( tcpKdcServer != null )
         {
             tcpKdcServer.destroy();
+            
             if ( log.isInfoEnabled() )
             {
                 log.info( "Unbind of KRB5 Service (TCP) complete: " + tcpKdcServer );
             }
+            
             tcpKdcServer = null;
         }
 
         if ( udpKdcServer != null )
         {
             udpKdcServer.destroy();
+            
             if ( log.isInfoEnabled() )
             {
                 log.info( "Unbind of KRB5 Service (UDP) complete: " + udpKdcServer );
             }
+            
             udpKdcServer = null;
         }
 
         if ( tcpChangePasswordServer != null )
         {
             tcpChangePasswordServer.destroy();
+            
             if ( log.isInfoEnabled() )
             {
                 log.info( "Unbind of Change Password Service (TCP) complete: " + tcpChangePasswordServer );
             }
+            
             tcpChangePasswordServer = null;
         }
 
         if ( udpChangePasswordServer != null )
         {
             udpChangePasswordServer.destroy();
+            
             if ( log.isInfoEnabled() )
             {
                 log.info( "Unbind of Change Password Service (UDP) complete: " + udpChangePasswordServer );
             }
+            
             udpChangePasswordServer = null;
         }
 
         if ( tcpNtpServer != null )
         {
             tcpNtpServer.destroy();
+    
             if ( log.isInfoEnabled() )
             {
                 log.info( "Unbind of NTP Service (TCP) complete: " + tcpNtpServer );
             }
+            
             tcpNtpServer = null;
         }
 
         if ( udpNtpServer != null )
         {
             udpNtpServer.destroy();
+            
             if ( log.isInfoEnabled() )
             {
                 log.info( "Unbind of NTP Service complete: " + udpNtpServer );
             }
+            
             udpNtpServer = null;
         }
     }
@@ -224,6 +243,7 @@
         Attributes entry = new AttributesImpl( SchemaConstants.OU_AT, "loadedLdifFiles", true );
         entry.put( SchemaConstants.OBJECT_CLASS_AT, SchemaConstants.TOP_OC );
         entry.get( SchemaConstants.OBJECT_CLASS_AT ).add( SchemaConstants.ORGANIZATIONAL_UNIT_OC );
+        
         try
         {
             root.createSubcontext( LDIF_FILES_DN, entry );
@@ -240,38 +260,38 @@
     private final static String WINDOWSFILE_OC = "windowsFile";
     private final static String UNIXFILE_OC = "unixFile";
 
-
-    private void addFileEntry( DirContext root, File ldif ) throws NamingException
+    private String buildProtectedFileEntry( File ldif )
     {
-        String rdnAttr = File.separatorChar == '\\' ? WINDOWSFILE_ATTR : UNIXFILE_ATTR;
-        String oc = File.separatorChar == '\\' ? WINDOWSFILE_OC : UNIXFILE_OC;
         StringBuffer buf = new StringBuffer();
-        buf.append( rdnAttr );
+
+        buf.append( File.separatorChar == '\\' ? WINDOWSFILE_ATTR : UNIXFILE_ATTR );
         buf.append( "=" );
-        buf.append( getCanonical( ldif ) );
+        
+        buf.append( StringTools.dumpHexPairs( StringTools.getBytesUtf8( getCanonical( ldif ) ) ) );
+        
         buf.append( "," );
         buf.append( LDIF_FILES_DN );
 
+        return buf.toString();
+    }
+
+    private void addFileEntry( DirContext root, File ldif ) throws NamingException
+    {
+		String rdnAttr = File.separatorChar == '\\' ? WINDOWSFILE_ATTR : UNIXFILE_ATTR;    
+        String oc = File.separatorChar == '\\' ? WINDOWSFILE_OC : UNIXFILE_OC;
+
         Attributes entry = new AttributesImpl( rdnAttr, getCanonical( ldif ), true );
         entry.put( SchemaConstants.OBJECT_CLASS_AT, SchemaConstants.TOP_OC );
         entry.get( SchemaConstants.OBJECT_CLASS_AT ).add( oc );
-        root.createSubcontext( buf.toString(), entry );
+        root.createSubcontext( buildProtectedFileEntry( ldif ), entry );
     }
 
 
     private Attributes getLdifFileEntry( DirContext root, File ldif )
     {
-        String rdnAttr = File.separatorChar == '\\' ? WINDOWSFILE_ATTR : UNIXFILE_ATTR;
-        StringBuffer buf = new StringBuffer();
-        buf.append( rdnAttr );
-        buf.append( "=" );
-        buf.append( getCanonical( ldif ) );
-        buf.append( "," );
-        buf.append( LDIF_FILES_DN );
-
         try
         {
-            return root.getAttributes( buf.toString(), new String[]
+            return root.getAttributes( buildProtectedFileEntry( ldif ), new String[]
                 { SchemaConstants.CREATE_TIMESTAMP_AT } );
         }
         catch ( NamingException e )
@@ -284,6 +304,7 @@
     private String getCanonical( File file )
     {
         String canonical = null;
+        
         try
         {
             canonical = file.getCanonicalPath();
@@ -329,16 +350,27 @@
         // if ldif directory is a file try to load it
         if ( !cfg.getLdifDirectory().isDirectory() )
         {
-            log.info( "LDIF load directory '" + getCanonical( cfg.getLdifDirectory() )
-                + "' is a file.  Will attempt to load as LDIF." );
+            if ( log.isInfoEnabled() )
+            {
+                log.info( "LDIF load directory '" + getCanonical( cfg.getLdifDirectory() )
+                    + "' is a file.  Will attempt to load as LDIF." );
+            }
+            
             Attributes fileEntry = getLdifFileEntry( root, cfg.getLdifDirectory() );
+            
             if ( fileEntry != null )
             {
                 String time = ( String ) fileEntry.get( SchemaConstants.CREATE_TIMESTAMP_AT ).get();
-                log.info( "Load of LDIF file '" + getCanonical( cfg.getLdifDirectory() )
-                    + "' skipped.  It has already been loaded on " + time + "." );
+                
+                if ( log.isInfoEnabled() )
+                {
+                    log.info( "Load of LDIF file '" + getCanonical( cfg.getLdifDirectory() )
+                        + "' skipped.  It has already been loaded on " + time + "." );
+                }
+                
                 return;
             }
+            
             LdifFileLoader loader = new LdifFileLoader( root, cfg.getLdifDirectory(), cfg.getLdifFilters() );
             loader.execute();
 
@@ -395,6 +427,7 @@
     {
         // Skip if disabled
         int port = cfg.getLdapPort();
+        
         if ( port < 0 )
         {
             return;
@@ -419,6 +452,7 @@
 
         // We use the reflection API in case this is not running on JDK 1.5+.
         IoFilterChainBuilder chain;
+        
         try
         {
             chain = ( IoFilterChainBuilder ) Class.forName( "org.apache.directory.server.ssl.LdapsInitializer", true,
@@ -596,6 +630,7 @@
             // is not bound - this is ok because the GracefulShutdown has already
             // sent notices to to the existing active sessions
             List sessions = null;
+        
             try
             {
                 sessions = new ArrayList( tcpAcceptor.getManagedSessions( new InetSocketAddress( port ) ) );
@@ -607,6 +642,7 @@
             }
 
             tcpAcceptor.unbind( new InetSocketAddress( port ) );
+            
             if ( log.isInfoEnabled() )
             {
                 log.info( "Unbind of an LDAP service (" + port + ") is complete." );
@@ -625,6 +661,7 @@
 
             // And close the connections when the NoDs are sent.
             Iterator sessionIt = sessions.iterator();
+            
             for ( Iterator i = writeFutures.iterator(); i.hasNext(); )
             {
                 WriteFuture future = ( WriteFuture ) i.next();

Modified: directory/apacheds/branches/kerberos-encryption-types/server-unit/src/test/java/org/apache/directory/server/DefaultServerTriggerServiceTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/kerberos-encryption-types/server-unit/src/test/java/org/apache/directory/server/DefaultServerTriggerServiceTest.java?view=diff&rev=539993&r1=539992&r2=539993
==============================================================================
--- directory/apacheds/branches/kerberos-encryption-types/server-unit/src/test/java/org/apache/directory/server/DefaultServerTriggerServiceTest.java (original)
+++ directory/apacheds/branches/kerberos-encryption-types/server-unit/src/test/java/org/apache/directory/server/DefaultServerTriggerServiceTest.java Sun May 20 18:53:07 2007
@@ -32,9 +32,13 @@
 import javax.naming.ldap.LdapContext;
 
 import org.apache.directory.server.ldap.support.extended.StoredProcedureExtendedOperationHandler;
+import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.message.AttributeImpl;
 import org.apache.directory.shared.ldap.message.AttributesImpl;
+import org.apache.directory.shared.ldap.name.LdapDN;
+import org.apache.directory.shared.ldap.name.Rdn;
 import org.apache.directory.shared.ldap.sp.JavaStoredProcedureUtils;
+import org.apache.directory.shared.ldap.util.AttributeUtils;
 
 
 /**
@@ -72,10 +76,65 @@
         super.tearDown();
     }
     
+    public void testAfterAddSubscribeUserToSomeGroups() throws NamingException
+    {
+        // Load the stored procedure unit which has the stored procedure to be triggered.
+        JavaStoredProcedureUtils.loadStoredProcedureClass( ctx, ListUtilsSP.class );
+        
+        // Create a group to be subscribed to.
+        Attributes staffGroupEntry = new AttributesImpl( SchemaConstants.CN_AT, "staff", true );
+        Attribute objectClass = new AttributeImpl( SchemaConstants.OBJECT_CLASS_AT );
+        staffGroupEntry.put( objectClass );
+        objectClass.add( SchemaConstants.TOP_OC );
+        objectClass.add( SchemaConstants.GROUP_OF_UNIQUE_NAMES_OC );
+        staffGroupEntry.put( SchemaConstants.UNIQUE_MEMBER_AT , "cn=dummy" );
+        Rdn staffRdn = new Rdn(SchemaConstants.CN_AT + "=" + "staff" );
+        sysRoot.createSubcontext( staffRdn.getUpName(), staffGroupEntry );
+        
+        // Create another group to be subscribed to.
+        Attributes teachersGroupEntry = new AttributesImpl( SchemaConstants.CN_AT, "teachers", true );
+        objectClass = new AttributeImpl( SchemaConstants.OBJECT_CLASS_AT );
+        teachersGroupEntry.put( objectClass );
+        objectClass.add( SchemaConstants.TOP_OC );
+        objectClass.add( SchemaConstants.GROUP_OF_UNIQUE_NAMES_OC );
+        teachersGroupEntry.put( SchemaConstants.UNIQUE_MEMBER_AT , "cn=dummy" );
+        Rdn teachersRdn = new Rdn( SchemaConstants.CN_AT + "=" + "teachers" );
+        sysRoot.createSubcontext( teachersRdn.getUpName(), teachersGroupEntry );
+        
+        // Create the Triger Specification within a Trigger Subentry.
+        String staffDN = staffRdn.getUpName() + "," + sysRoot.getNameInNamespace();
+        String teachersDN = teachersRdn.getUpName() + "," + sysRoot.getNameInNamespace();
+        createTriggerSubentry( ctx, "triggerSubentry1",
+            "AFTER Add " +
+            "CALL \"" + ListUtilsSP.class.getName() + ".subscribeToGroup\" ( $entry , $ldapContext \"" + staffDN + "\" ); " +
+            "CALL \"" + ListUtilsSP.class.getName() + ".subscribeToGroup\" ( $entry , $ldapContext \"" + teachersDN + "\" );" );
+        
+        // Create a test entry which is selected by the Trigger Subentry.
+        Attributes testEntry = new AttributesImpl( SchemaConstants.CN_AT, "The Teacher of All Times", true );
+        objectClass = new AttributeImpl( SchemaConstants.OBJECT_CLASS_AT );
+        testEntry.put( objectClass );
+        objectClass.add( SchemaConstants.TOP_OC );
+        objectClass.add( SchemaConstants.INET_ORG_PERSON_OC );
+        testEntry.put( SchemaConstants.SN_AT, "The Teacher" );
+        Rdn testEntryRdn = new Rdn( SchemaConstants.CN_AT + "=" + "The Teacher of All Times" );
+        sysRoot.createSubcontext( testEntryRdn.getUpName(), testEntry );
+                
+        // ------------------------------------------
+        // The trigger should be fired at this point.
+        // ------------------------------------------
+        
+        // Check if the Trigger really worked (subscribed the user to give grpups).
+        Attributes staff = sysRoot.getAttributes( "cn=staff" );
+        Attributes teachers = sysRoot.getAttributes( "cn=teachers" );
+        String testEntryName = ( ( LdapContext )sysRoot.lookup( testEntryRdn.getUpName() ) ).getNameInNamespace();
+        assertTrue( AttributeUtils.containsValueCaseIgnore( staff.get(SchemaConstants.UNIQUE_MEMBER_AT), testEntryName ) );
+        assertTrue( AttributeUtils.containsValueCaseIgnore( teachers.get(SchemaConstants.UNIQUE_MEMBER_AT), testEntryName ) );
+    }
+    
     public void testAfterDeleteBackupDeletedEntry() throws NamingException
     {
         // Load the stored procedure unit which has the stored procedure to be triggered.
-        JavaStoredProcedureUtils.loadStoredProcedureClass( ctx, BackupUtilities.class );
+        JavaStoredProcedureUtils.loadStoredProcedureClass( ctx, BackupUtilitiesSP.class );
         
         // Create a container for backing up deleted entries.
         Attributes backupContext = new AttributesImpl( "ou", "backupContext", true );
@@ -87,7 +146,7 @@
         
         // Create the Triger Specification within a Trigger Subentry.
         createTriggerSubentry( ctx, "triggerSubentry1",
-            "AFTER Delete CALL \"" + BackupUtilities.class.getName() + ".backupDeleted\" ( $ldapContext \"\", $name, $operationPrincipal, $deletedEntry );" );
+            "AFTER Delete CALL \"" + BackupUtilitiesSP.class.getName() + ".backupDeleted\" ( $ldapContext \"\", $name, $operationPrincipal, $deletedEntry );" );
         
         // Create a test entry which is selected by the Trigger Subentry.
         Attributes testEntry = new AttributesImpl( "ou", "testou", true );



Mime
View raw message