directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ersi...@apache.org
Subject svn commit: r440458 [1/2] - in /directory/trunks: apacheds/core-unit/src/test/java/org/apache/directory/server/core/trigger/ apacheds/core/src/main/java/org/apache/directory/server/core/subtree/ apacheds/core/src/main/java/org/apache/directory/server/c...
Date Tue, 05 Sep 2006 19:35:35 GMT
Author: ersiner
Date: Tue Sep  5 12:35:34 2006
New Revision: 440458

URL: http://svn.apache.org/viewvc?view=rev&rev=440458
Log:
Update Trigger code in order to complete Basic Trigger Execution Scheme.
Renamed some Trigger related operational attributes.
Removed BEFORE and INSTEAD OF Triggers.
Removed non-change-inducing operations support.
Added/Updated utilities in TriggerUtils.
Updated parameter injection mechanism. Eats more memory now. (Can be refactored.)
Updated all related tests.

And also upgraded deamon dependency version for some apacheds projects.

Added:
    directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/trigger/ModifyDNStoredProcedureParameterInjector.java
      - copied, changed from r440188, directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/trigger/ModDNStoredProcedureParameterInjector.java
    directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/trigger/StoredProcedureLanguageSchemeOption.java
      - copied, changed from r440188, directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/trigger/StoredProcedureLanguageOption.java
Removed:
    directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/trigger/ModDNStoredProcedureParameterInjector.java
    directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/trigger/StoredProcedureLanguageOption.java
Modified:
    directory/trunks/apacheds/core-unit/src/test/java/org/apache/directory/server/core/trigger/AbstractTriggerServiceTest.java
    directory/trunks/apacheds/core-unit/src/test/java/org/apache/directory/server/core/trigger/DefaulTriggerServiceTest.java
    directory/trunks/apacheds/core-unit/src/test/java/org/apache/directory/server/core/trigger/SubentryServiceForTriggersTest.java
    directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/subtree/SubentryService.java
    directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/trigger/AbstractStoredProcedureParameterInjector.java
    directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/trigger/AddStoredProcedureParameterInjector.java
    directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/trigger/DeleteStoredProcedureParameterInjector.java
    directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/trigger/ModifyStoredProcedureParameterInjector.java
    directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/trigger/StoredProcedureParameterInjector.java
    directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/trigger/TriggerService.java
    directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/trigger/TriggerSpecCache.java
    directory/trunks/apacheds/core/src/main/schema/apache.schema
    directory/trunks/apacheds/server-sar/pom.xml
    directory/trunks/apacheds/server-tools/pom.xml
    directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/AbstractServerTriggerServiceTest.java
    directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/DefaultServerTriggerServiceTest.java
    directory/trunks/shared/ldap/src/main/antlr/TriggerSpecification.g
    directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/trigger/ActionTime.java
    directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/trigger/LdapOperation.java
    directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/trigger/StoredProcedureParameter.java
    directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/trigger/TriggerSpecification.java
    directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/trigger/TriggerUtils.java
    directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/trigger/TriggerSpecificationParserTest.java

Modified: directory/trunks/apacheds/core-unit/src/test/java/org/apache/directory/server/core/trigger/AbstractTriggerServiceTest.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/core-unit/src/test/java/org/apache/directory/server/core/trigger/AbstractTriggerServiceTest.java?view=diff&rev=440458&r1=440457&r2=440458
==============================================================================
--- directory/trunks/apacheds/core-unit/src/test/java/org/apache/directory/server/core/trigger/AbstractTriggerServiceTest.java (original)
+++ directory/trunks/apacheds/core-unit/src/test/java/org/apache/directory/server/core/trigger/AbstractTriggerServiceTest.java Tue Sep  5 12:35:34 2006
@@ -170,9 +170,9 @@
         subentry.put( objectClass );
         objectClass.add( "top" );
         objectClass.add( "subentry" );
-        objectClass.add( "triggerSubentry" );
+        objectClass.add( "triggerExecutionSubentry" );
         subentry.put( "subtreeSpecification", subtree );
-        subentry.put( "prescriptiveTrigger", triggerSpec );
+        subentry.put( "prescriptiveTriggerSpecification", triggerSpec );
         adminCtx.createSubcontext( "cn=" + cn, subentry );
     }
 

Modified: directory/trunks/apacheds/core-unit/src/test/java/org/apache/directory/server/core/trigger/DefaulTriggerServiceTest.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/core-unit/src/test/java/org/apache/directory/server/core/trigger/DefaulTriggerServiceTest.java?view=diff&rev=440458&r1=440457&r2=440458
==============================================================================
--- directory/trunks/apacheds/core-unit/src/test/java/org/apache/directory/server/core/trigger/DefaulTriggerServiceTest.java (original)
+++ directory/trunks/apacheds/core-unit/src/test/java/org/apache/directory/server/core/trigger/DefaulTriggerServiceTest.java Tue Sep  5 12:35:34 2006
@@ -54,7 +54,7 @@
         
         // Create the Triger Specification within a Trigger Subentry.
         createTriggerSubentry( "triggerSubentry1",
-            "AFTER delete CALL \"" + BackupUtilities.class.getName() + ".backupDeleted\" ( $rootDSE, $name, $operationPrincipal, $deletedEntry )" );
+            "AFTER Delete CALL \"" + BackupUtilities.class.getName() + ".backupDeleted\" ( $ldapContext \"\", $name, $operationPrincipal, $deletedEntry )" );
         
         // Create a test entry which is selected by the Trigger Subentry.
         Attributes testEntry = new BasicAttributes( "ou", "testou", true );
@@ -75,7 +75,7 @@
         assertNotNull( sysRoot.lookup( "ou=testou,ou=backupContext" ) );
     }
     
-    public void testBeforeDeleteLogWarning() throws NamingException
+    /*public void testBeforeDeleteLogWarning() throws NamingException
     {
         // Load the stored procedure unit which has the stored procedure to be triggered.
         JavaStoredProcedureUtils.loadStoredProcedureClass( sysRoot, LoggingUtilities.class );
@@ -98,6 +98,6 @@
         // ------------------------------------------
         // The trigger should be fired at this point.
         // ------------------------------------------        
-    }
+    }*/
     
 }

Modified: directory/trunks/apacheds/core-unit/src/test/java/org/apache/directory/server/core/trigger/SubentryServiceForTriggersTest.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/core-unit/src/test/java/org/apache/directory/server/core/trigger/SubentryServiceForTriggersTest.java?view=diff&rev=440458&r1=440457&r2=440458
==============================================================================
--- directory/trunks/apacheds/core-unit/src/test/java/org/apache/directory/server/core/trigger/SubentryServiceForTriggersTest.java (original)
+++ directory/trunks/apacheds/core-unit/src/test/java/org/apache/directory/server/core/trigger/SubentryServiceForTriggersTest.java Tue Sep  5 12:35:34 2006
@@ -67,10 +67,10 @@
         Attribute objectClass = new LockableAttributeImpl( "objectClass" );
         objectClass.add( "top" );
         objectClass.add( "subentry" );
-        objectClass.add( "triggerSubentry" );
+        objectClass.add( "triggerExecutionSubentry" );
         subentry.put( objectClass );
         subentry.put( "subtreeSpecification", "{ base \"ou=configuration\" }" );
-        subentry.put( "prescriptiveTrigger", "BEFORE bind CALL \"AuthUtilities.beforeBind\"($name)" );
+        subentry.put( "prescriptiveTriggerSpecification", "AFTER Delete CALL \"LogUtils.logDelete\"($name)" );
         subentry.put( "cn", "testsubentry" );
         return subentry;
     }
@@ -81,11 +81,11 @@
         Attribute objectClass = new LockableAttributeImpl( "objectClass" );
         objectClass.add( "top" );
         objectClass.add( "subentry" );
-        objectClass.add( "triggerSubentry" );
+        objectClass.add( "triggerExecutionSubentry" );
         subentry.put( objectClass );
         String spec = "{ base \"ou=configuration\", specificExclusions { chopBefore:\"cn=unmarked\" } }";
         subentry.put( "subtreeSpecification", spec );
-        subentry.put( "prescriptiveTrigger", "BEFORE bind CALL \"AuthUtilities.beforeBind\"($name)" );
+        subentry.put( "prescriptiveTriggerSpecification", "AFTER Delete CALL \"LogUtils.logDelete\"($name)" );
         subentry.put( "cn", "testsubentry" );
         return subentry;
     }

Modified: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/subtree/SubentryService.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/subtree/SubentryService.java?view=diff&rev=440458&r1=440457&r2=440458
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/subtree/SubentryService.java (original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/subtree/SubentryService.java Tue Sep  5 12:35:34 2006
@@ -89,9 +89,9 @@
     public static final String COLLECTIVE_INNERAREA = "collectiveAttributeInnerArea";
     public static final String COLLECTIVE_ATTRIBUTE_SUBENTRIES = "collectiveAttributeSubentries";
     
-    public static final String TRIGGER_AREA = "triggerSpecificArea";
-    public static final String TRIGGER_INNERAREA = "triggerInnerArea";
-    public static final String TRIGGER_SUBENTRIES = "triggerSubentries";
+    public static final String TRIGGER_AREA = "triggerExecutionSpecificArea";
+    public static final String TRIGGER_INNERAREA = "triggerExecutionInnerArea";
+    public static final String TRIGGER_SUBENTRIES = "triggerExecutionSubentries";
 
     public static final String[] SUBENTRY_OPATTRS =
         { AC_SUBENTRIES, SCHEMA_SUBENTRY, COLLECTIVE_ATTRIBUTE_SUBENTRIES, TRIGGER_SUBENTRIES };
@@ -199,7 +199,7 @@
             types |= Subentry.COLLECTIVE_SUBENTRY;
         }
         
-        if ( oc.contains( "triggerSubentry" ) )
+        if ( oc.contains( "triggerExecutionSubentry" ) )
         {
             types |= Subentry.TRIGGER_SUBENTRY;
         }

Modified: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/trigger/AbstractStoredProcedureParameterInjector.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/trigger/AbstractStoredProcedureParameterInjector.java?view=diff&rev=440458&r1=440457&r2=440458
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/trigger/AbstractStoredProcedureParameterInjector.java (original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/trigger/AbstractStoredProcedureParameterInjector.java Tue Sep  5 12:35:34 2006
@@ -22,7 +22,6 @@
 
 import java.security.Principal;
 import java.util.ArrayList;
-import java.util.Date;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
@@ -36,6 +35,7 @@
 import org.apache.directory.server.core.jndi.ServerLdapContext;
 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;
 
 public abstract class AbstractStoredProcedureParameterInjector implements StoredProcedureParameterInjector
 {
@@ -46,9 +46,8 @@
     {
         this.invocation = invocation;
         injectors = new HashMap();
-        injectors.put( StoredProcedureParameter.OPERATION_PRINCIPAL, $operationPrincipalInjector.inject() );
-        injectors.put( StoredProcedureParameter.OPERATION_TIME, $operationTimeInjector.inject() );
-        injectors.put( StoredProcedureParameter.ROOT_DSE, $rootDSE.inject() );
+        injectors.put( StoredProcedureParameter.Generic_OPERATION_PRINCIPAL.class, $operationPrincipalInjector );
+        injectors.put( StoredProcedureParameter.Generic_LDAP_CONTEXT.class, $ldapContextInjector );
     }
     
     protected Name getOperationPrincipal() throws NamingException
@@ -58,11 +57,6 @@
         return userName;
     }
     
-    protected Date getOperationTime()
-    {
-        return new Date();
-    }
-    
     protected Map getInjectors()
     {
         return injectors;
@@ -78,7 +72,7 @@
         this.invocation = invocation;
     }
     
-    public final List getArgumentsToInject( List parameterList )
+    public final List getArgumentsToInject( List parameterList ) throws NamingException
     {
         List arguments = new ArrayList();
         
@@ -86,7 +80,8 @@
         while ( it.hasNext() )
         {
             StoredProcedureParameter spParameter = ( StoredProcedureParameter ) it.next();
-            arguments.add( injectors.get( spParameter ) );
+            MicroInjector injector = ( MicroInjector ) injectors.get( spParameter.getClass() );
+            arguments.add( injector.inject( spParameter ) );
         }
         
         return arguments;
@@ -94,25 +89,19 @@
     
     MicroInjector $operationPrincipalInjector = new MicroInjector()
     {
-        public Object inject() throws NamingException
+        public Object inject( StoredProcedureParameter param ) throws NamingException
         {
             return getOperationPrincipal();
         };
     };
     
-    MicroInjector $operationTimeInjector = new MicroInjector()
-    {
-        public Object inject() throws NamingException
-        {
-            return getOperationTime();
-        };
-    };
-
-    MicroInjector $rootDSE = new MicroInjector()
+    MicroInjector $ldapContextInjector = new MicroInjector()
     {
-        public Object inject() throws NamingException
+        public Object inject( StoredProcedureParameter param ) throws NamingException
         {
-            return ( ServerLdapContext ) ( ( ServerLdapContext ) invocation.getCaller() ).getRootContext();
+            Generic_LDAP_CONTEXT ldapCtxParam = ( Generic_LDAP_CONTEXT ) param;
+            LdapDN ldapCtxName = ldapCtxParam.getCtxName();
+            return (( ServerLdapContext ) ( ( ServerLdapContext ) invocation.getCaller() ).getRootContext()).lookup( ldapCtxName );
         };
     };
 

Modified: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/trigger/AddStoredProcedureParameterInjector.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/trigger/AddStoredProcedureParameterInjector.java?view=diff&rev=440458&r1=440457&r2=440458
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/trigger/AddStoredProcedureParameterInjector.java (original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/trigger/AddStoredProcedureParameterInjector.java Tue Sep  5 12:35:34 2006
@@ -27,7 +27,7 @@
 
 import org.apache.directory.server.core.invocation.Invocation;
 import org.apache.directory.shared.ldap.name.LdapDN;
-import org.apache.directory.shared.ldap.trigger.StoredProcedureParameter.AddStoredProcedureParameter;
+import org.apache.directory.shared.ldap.trigger.StoredProcedureParameter;
 
 public class AddStoredProcedureParameterInjector extends AbstractStoredProcedureParameterInjector
 {
@@ -42,13 +42,13 @@
         this.addedEntryName = addedEntryName;
         this.addedEntry = addedEntry;
         injectors = super.getInjectors();
-        injectors.put( AddStoredProcedureParameter.ENTRY, $entryInjector.inject() );
-        injectors.put( AddStoredProcedureParameter.ATTRIBUTES, $attributesInjector.inject() );
+        injectors.put( StoredProcedureParameter.Add_ENTRY.class, $entryInjector );
+        injectors.put( StoredProcedureParameter.Add_ATTRIBUTES.class, $attributesInjector );
     }
     
     MicroInjector $entryInjector = new MicroInjector()
     {
-        public Object inject() throws NamingException
+        public Object inject( StoredProcedureParameter param ) throws NamingException
         {
             // Return a safe copy constructed with user provided name.
             return new LdapDN( addedEntryName.getUpName() );
@@ -57,7 +57,7 @@
     
     MicroInjector $attributesInjector = new MicroInjector()
     {
-        public Object inject() throws NamingException
+        public Object inject( StoredProcedureParameter param ) throws NamingException
         {
             return addedEntry.clone();
         };

Modified: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/trigger/DeleteStoredProcedureParameterInjector.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/trigger/DeleteStoredProcedureParameterInjector.java?view=diff&rev=440458&r1=440457&r2=440458
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/trigger/DeleteStoredProcedureParameterInjector.java (original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/trigger/DeleteStoredProcedureParameterInjector.java Tue Sep  5 12:35:34 2006
@@ -29,12 +29,13 @@
 import org.apache.directory.server.core.invocation.Invocation;
 import org.apache.directory.server.core.partition.PartitionNexusProxy;
 import org.apache.directory.shared.ldap.name.LdapDN;
-import org.apache.directory.shared.ldap.trigger.StoredProcedureParameter.DeleteStoredProcedureParameter;
+import org.apache.directory.shared.ldap.trigger.StoredProcedureParameter;
 
 
 public class DeleteStoredProcedureParameterInjector extends AbstractStoredProcedureParameterInjector
 {
     private LdapDN deletedEntryName;
+    private Attributes deletedEntry;
     
     private Map injectors;
     
@@ -42,14 +43,15 @@
     {
         super( invocation );
         this.deletedEntryName = deletedEntryName;
+        this.deletedEntry = getDeletedEntry();
         injectors = super.getInjectors();
-        injectors.put( DeleteStoredProcedureParameter.NAME, $nameInjector.inject() );
-        injectors.put( DeleteStoredProcedureParameter.DELETED_ENTRY, $deletedEntryInjector.inject() );
+        injectors.put( StoredProcedureParameter.Delete_NAME.class, $nameInjector );
+        injectors.put( StoredProcedureParameter.Delete_DELETED_ENTRY.class, $deletedEntryInjector );
     }
     
     MicroInjector $nameInjector = new MicroInjector()
     {
-        public Object inject() throws NamingException
+        public Object inject( StoredProcedureParameter param ) throws NamingException
         {
             // Return a safe copy constructed with user provided name.
             return new LdapDN( deletedEntryName.getUpName() );
@@ -58,16 +60,20 @@
     
     MicroInjector $deletedEntryInjector = new MicroInjector()
     {
-        public Object inject() throws NamingException
+        public Object inject( StoredProcedureParameter param ) throws NamingException
         {
-            PartitionNexusProxy proxy = getInvocation().getProxy();
-            /**
-             * Using LOOKUP_EXCLUDING_OPR_ATTRS_BYPASS here to exclude operational attributes
-             * especially subentry related ones like "triggerSubentries".
-             */
-            Attributes deletedEntry = proxy.lookup( deletedEntryName, PartitionNexusProxy.LOOKUP_EXCLUDING_OPR_ATTRS_BYPASS );
             return deletedEntry;
         };
     };
-
+    
+    private Attributes getDeletedEntry() 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( deletedEntryName, PartitionNexusProxy.LOOKUP_EXCLUDING_OPR_ATTRS_BYPASS );
+        return deletedEntry;
+    }
 }

Copied: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/trigger/ModifyDNStoredProcedureParameterInjector.java (from r440188, directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/trigger/ModDNStoredProcedureParameterInjector.java)
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/trigger/ModifyDNStoredProcedureParameterInjector.java?view=diff&rev=440458&p1=directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/trigger/ModDNStoredProcedureParameterInjector.java&r1=440188&p2=directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/trigger/ModifyDNStoredProcedureParameterInjector.java&r2=440458
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/trigger/ModDNStoredProcedureParameterInjector.java (original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/trigger/ModifyDNStoredProcedureParameterInjector.java Tue Sep  5 12:35:34 2006
@@ -28,7 +28,7 @@
 import org.apache.directory.shared.ldap.name.LdapDN;
 
 
-public class ModDNStoredProcedureParameterInjector extends AbstractStoredProcedureParameterInjector
+public class ModifyDNStoredProcedureParameterInjector extends AbstractStoredProcedureParameterInjector
 {
     private LdapDN oldName;
     private String newRn;
@@ -36,7 +36,8 @@
     
     private Map injectors;
     
-    public ModDNStoredProcedureParameterInjector( Invocation invocation, LdapDN oldName, String newRn, boolean deleteOldRn ) throws NamingException
+    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 );

Modified: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/trigger/ModifyStoredProcedureParameterInjector.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/trigger/ModifyStoredProcedureParameterInjector.java?view=diff&rev=440458&r1=440457&r2=440458
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/trigger/ModifyStoredProcedureParameterInjector.java (original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/trigger/ModifyStoredProcedureParameterInjector.java Tue Sep  5 12:35:34 2006
@@ -26,13 +26,12 @@
 import javax.naming.NamingException;
 import javax.naming.directory.Attribute;
 import javax.naming.directory.Attributes;
-import javax.naming.directory.DirContext;
 import javax.naming.directory.ModificationItem;
 
 import org.apache.directory.server.core.invocation.Invocation;
 import org.apache.directory.server.core.partition.PartitionNexusProxy;
 import org.apache.directory.shared.ldap.name.LdapDN;
-import org.apache.directory.shared.ldap.trigger.StoredProcedureParameter.ModifyStoredProcedureParameter;
+import org.apache.directory.shared.ldap.trigger.StoredProcedureParameter;
 
 public class ModifyStoredProcedureParameterInjector extends AbstractStoredProcedureParameterInjector
 {
@@ -68,16 +67,17 @@
     {
         this.modifiedEntryName = modifiedEntryName;
         this.modifications = modifications;
+        this.oldEntry = getEntry();
         injectors = super.getInjectors();
-        injectors.put( ModifyStoredProcedureParameter.OBJECT, $objectInjector.inject() );
-        injectors.put( ModifyStoredProcedureParameter.MODIFICATION, $modificationInjector.inject() );
-        injectors.put( ModifyStoredProcedureParameter.OLD_ENTRY, $oldEntryInjector.inject() );
-        injectors.put( ModifyStoredProcedureParameter.NEW_ENTRY, $newEntryInjector.inject() );
+        injectors.put( StoredProcedureParameter.Modify_OBJECT.class, $objectInjector );
+        injectors.put( StoredProcedureParameter.Modify_MODIFICATION.class, $modificationInjector );
+        injectors.put( StoredProcedureParameter.Modify_OLD_ENTRY.class, $oldEntryInjector );
+        injectors.put( StoredProcedureParameter.Modify_NEW_ENTRY.class, $newEntryInjector );
     }
     
     MicroInjector $objectInjector = new MicroInjector()
     {
-        public Object inject() throws NamingException
+        public Object inject( StoredProcedureParameter param ) throws NamingException
         {
             // Return a safe copy constructed with user provided name.
             return new LdapDN( modifiedEntryName.getUpName() );
@@ -86,7 +86,7 @@
     
     MicroInjector $modificationInjector = new MicroInjector()
     {
-        public Object inject() throws NamingException
+        public Object inject( StoredProcedureParameter param ) throws NamingException
         {
             return modifications.clone();
         };
@@ -94,43 +94,28 @@
     
     MicroInjector $oldEntryInjector = new MicroInjector()
     {
-        public Object inject() throws NamingException
+        public Object inject( StoredProcedureParameter param ) throws NamingException
         {
-            PartitionNexusProxy proxy = getInvocation().getProxy();
-            /**
-             * Using LOOKUP_EXCLUDING_OPR_ATTRS_BYPASS here to exclude operational attributes
-             * especially subentry related ones like "triggerSubentries".
-             */
-            oldEntry = proxy.lookup( modifiedEntryName, PartitionNexusProxy.LOOKUP_EXCLUDING_OPR_ATTRS_BYPASS );
             return oldEntry;
         };
     };
     
     MicroInjector $newEntryInjector = new MicroInjector()
     {
-        public Object inject() throws NamingException
+        public Object inject( StoredProcedureParameter param ) throws NamingException
         {
-            Attributes newEntry = ( Attributes ) oldEntry.clone();
-            
-            for ( int i = 0; i < modifications.length; i++ )
-            {
-                switch ( modifications[i].getModificationOp() )
-                {
-                    case ( DirContext.ADD_ATTRIBUTE  ):
-                        newEntry.put( modifications[i].getAttribute() );
-                        break;
-                    case ( DirContext.REMOVE_ATTRIBUTE  ):
-                        newEntry.remove( modifications[i].getAttribute().getID() );
-                        break;
-                    case ( DirContext.REPLACE_ATTRIBUTE  ):
-                        newEntry.remove( modifications[i].getAttribute().getID() );
-                        newEntry.put( modifications[i].getAttribute() );
-                        break;
-                }
-            }
-            
-            return newEntry;
+            return getEntry();
         };
     };
+    
+    private Attributes getEntry() 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( modifiedEntryName, PartitionNexusProxy.LOOKUP_EXCLUDING_OPR_ATTRS_BYPASS );
+    }
 
 }

Modified: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/trigger/StoredProcedureParameterInjector.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/trigger/StoredProcedureParameterInjector.java?view=diff&rev=440458&r1=440457&r2=440458
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/trigger/StoredProcedureParameterInjector.java (original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/trigger/StoredProcedureParameterInjector.java Tue Sep  5 12:35:34 2006
@@ -24,12 +24,14 @@
 
 import javax.naming.NamingException;
 
+import org.apache.directory.shared.ldap.trigger.StoredProcedureParameter;
+
 public interface StoredProcedureParameterInjector
 {
-    List getArgumentsToInject( List parameterList );
+    List getArgumentsToInject( List parameterList ) throws NamingException;
     
     public interface MicroInjector
     {
-        Object inject() throws NamingException;
+        Object inject( StoredProcedureParameter param ) throws NamingException;
     }
 }

Modified: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/trigger/TriggerService.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/trigger/TriggerService.java?view=diff&rev=440458&r1=440457&r2=440458
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/trigger/TriggerService.java (original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/trigger/TriggerService.java Tue Sep  5 12:35:34 2006
@@ -30,6 +30,7 @@
 import java.util.List;
 import java.util.Map;
 
+import javax.naming.NamingEnumeration;
 import javax.naming.NamingException;
 import javax.naming.directory.Attribute;
 import javax.naming.directory.Attributes;
@@ -38,6 +39,7 @@
 import org.apache.directory.server.core.DirectoryServiceConfiguration;
 import org.apache.directory.server.core.configuration.InterceptorConfiguration;
 import org.apache.directory.server.core.interceptor.BaseInterceptor;
+import org.apache.directory.server.core.interceptor.InterceptorChain;
 import org.apache.directory.server.core.interceptor.NextInterceptor;
 import org.apache.directory.server.core.invocation.Invocation;
 import org.apache.directory.server.core.invocation.InvocationStack;
@@ -45,6 +47,7 @@
 import org.apache.directory.server.core.partition.PartitionNexusProxy;
 import org.apache.directory.server.core.schema.AttributeTypeRegistry;
 import org.apache.directory.server.core.sp.LdapClassLoader;
+import org.apache.directory.server.core.subtree.SubentryService;
 import org.apache.directory.shared.ldap.exception.LdapNamingException;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.name.LdapDN;
@@ -72,13 +75,13 @@
     private static final Logger log = LoggerFactory.getLogger( TriggerService.class );
     
     /** the entry trigger attribute string: entryTrigger */
-    private static final String ENTRY_TRIGGER_ATTR = "entryTrigger";
+    private static final String ENTRY_TRIGGER_ATTR = "entryTriggerSpecification";
 
     /**
      * the multivalued operational attribute used to track the prescriptive
      * trigger subentries that apply to an entry
      */
-    private static final String TRIGGER_SUBENTRIES_ATTR = "triggerSubentries";
+    private static final String TRIGGER_SUBENTRIES_ATTR = "triggerExecutionSubentries";
     
     /** a triggerSpecCache that responds to add, delete, and modify attempts */
     private TriggerSpecCache triggerSpecCache;
@@ -86,6 +89,8 @@
     private TriggerSpecificationParser triggerParser;
     /** the attribute type registry */
     private AttributeTypeRegistry attrRegistry;
+    /** */
+    private InterceptorChain chain;
     /** whether or not this interceptor is activated */
     private boolean enabled = true;
 
@@ -177,8 +182,6 @@
     
     public Map getActionTimeMappedTriggerSpecsForOperation( List triggerSpecs, LdapOperation ldapOperation )
     {
-        List beforeTriggerSpecs = new ArrayList();
-        List insteadofTriggerSpecs = new ArrayList();
         List afterTriggerSpecs = new ArrayList();
         Map triggerSpecMap = new HashMap();
         
@@ -188,15 +191,7 @@
             TriggerSpecification triggerSpec = ( TriggerSpecification ) it.next();
             if ( triggerSpec.getLdapOperation().equals( ldapOperation ) )
             {
-                if ( triggerSpec.getActionTime().equals( ActionTime.BEFORE ) )
-                {
-                    beforeTriggerSpecs.add( triggerSpec );
-                }
-                else if ( triggerSpec.getActionTime().equals( ActionTime.INSTEADOF ) )
-                {
-                    insteadofTriggerSpecs.add( triggerSpec );
-                }
-                else if ( triggerSpec.getActionTime().equals( ActionTime.AFTER ) )
+                if ( triggerSpec.getActionTime().equals( ActionTime.AFTER ) )
                 {
                     afterTriggerSpecs.add( triggerSpec );
                 }
@@ -207,8 +202,6 @@
             }
         }
         
-        triggerSpecMap.put( ActionTime.BEFORE, beforeTriggerSpecs );
-        triggerSpecMap.put( ActionTime.INSTEADOF, insteadofTriggerSpecs );
         triggerSpecMap.put( ActionTime.AFTER, afterTriggerSpecs );
         
         return triggerSpecMap;
@@ -232,6 +225,7 @@
                     }
                 }
             );
+        chain = dirServCfg.getInterceptorChain();
         this.enabled = true; // TODO: Get this from the configuration if needed.
     }
 
@@ -254,28 +248,14 @@
         List triggerSpecs = new ArrayList();
         addPrescriptiveTriggerSpecs( triggerSpecs, proxy, normName, addedEntry );
         /**
-         *  NOTE: We do not handle entryTriggers for ADD operation.
+         *  NOTE: We do not handle entryTriggerSpecs for ADD operation.
          */
         
         // Gather a Map<ActionTime,TriggerSpecification> where TriggerSpecification.ldapOperation = LdapOperation.ADD.
         Map triggerMap = getActionTimeMappedTriggerSpecsForOperation( triggerSpecs, LdapOperation.ADD );
         
-        // Fire BEFORE Triggers.
-        List beforeTriggerSpecs = ( List ) triggerMap.get( ActionTime.BEFORE );
-        executeTriggers( beforeTriggerSpecs, injector, callerRootCtx );
-        
-        List insteadofTriggerSpecs = ( List ) triggerMap.get( ActionTime.INSTEADOF );
-        if ( insteadofTriggerSpecs.size() == 0 )
-        {
-            // Really add only when there is no INSTEADOF Trigger that applies to the entry.
-            next.add( normName, addedEntry );
-            triggerSpecCache.subentryAdded( normName, addedEntry );
-        }
-        else
-        {
-            // Fire INSTEADOF Triggers.
-            executeTriggers( insteadofTriggerSpecs, injector, callerRootCtx );
-        }
+        next.add( normName, addedEntry );
+        triggerSpecCache.subentryAdded( normName, addedEntry );
         
         // Fire AFTER Triggers.
         List afterTriggerSpecs = ( List ) triggerMap.get( ActionTime.AFTER );
@@ -306,22 +286,8 @@
         // Gather a Map<ActionTime,TriggerSpecification> where TriggerSpecification.ldapOperation = LdapOperation.DELETE.
         Map triggerMap = getActionTimeMappedTriggerSpecsForOperation( triggerSpecs, LdapOperation.DELETE );
         
-        // Fire BEFORE Triggers.
-        List beforeTriggerSpecs = ( List ) triggerMap.get( ActionTime.BEFORE );
-        executeTriggers( beforeTriggerSpecs, injector, callerRootCtx );
-        
-        List insteadofTriggerSpecs = ( List ) triggerMap.get( ActionTime.INSTEADOF );
-        if ( insteadofTriggerSpecs.size() == 0 )
-        {
-            // Really delete only when there is no INSTEADOF Trigger that applies to the entry.
-            next.delete( normName );
-            triggerSpecCache.subentryDeleted( normName, deletedEntry );
-        }
-        else
-        {
-            // Fire INSTEADOF Triggers.
-            executeTriggers( insteadofTriggerSpecs, injector, callerRootCtx );
-        }
+        next.delete( normName );
+        triggerSpecCache.subentryDeleted( normName, deletedEntry );
         
         // Fire AFTER Triggers.
         List afterTriggerSpecs = ( List ) triggerMap.get( ActionTime.AFTER );
@@ -352,22 +318,8 @@
         // Gather a Map<ActionTime,TriggerSpecification> where TriggerSpecification.ldapOperation = LdapOperation.MODIFY.
         Map triggerMap = getActionTimeMappedTriggerSpecsForOperation( triggerSpecs, LdapOperation.MODIFY );
         
-        // Fire BEFORE Triggers.
-        List beforeTriggerSpecs = ( List ) triggerMap.get( ActionTime.BEFORE );
-        executeTriggers( beforeTriggerSpecs, injector, callerRootCtx );
-        
-        List insteadofTriggerSpecs = ( List ) triggerMap.get( ActionTime.INSTEADOF );
-        if ( insteadofTriggerSpecs.size() == 0 )
-        {
-            // Really modify only when there is no INSTEADOF Trigger that applies to the entry.
-            next.modify( normName, modOp, mods );
-            triggerSpecCache.subentryModified( normName, modOp, mods, modifiedEntry );
-        }
-        else
-        {
-            // Fire INSTEADOF Triggers.
-            executeTriggers( insteadofTriggerSpecs, injector, callerRootCtx );
-        }
+        next.modify( normName, modOp, mods );
+        triggerSpecCache.subentryModified( normName, modOp, mods, modifiedEntry );
         
         // Fire AFTER Triggers.
         List afterTriggerSpecs = ( List ) triggerMap.get( ActionTime.AFTER );
@@ -399,50 +351,202 @@
         // Gather a Map<ActionTime,TriggerSpecification> where TriggerSpecification.ldapOperation = LdapOperation.MODIFY.
         Map triggerMap = getActionTimeMappedTriggerSpecsForOperation( triggerSpecs, LdapOperation.MODIFY );
         
-        // Fire BEFORE Triggers.
-        List beforeTriggerSpecs = ( List ) triggerMap.get( ActionTime.BEFORE );
-        executeTriggers( beforeTriggerSpecs, injector, callerRootCtx );
+        next.modify( normName, mods );
+        triggerSpecCache.subentryModified( normName, mods, modifiedEntry );
         
-        List insteadofTriggerSpecs = ( List ) triggerMap.get( ActionTime.INSTEADOF );
-        if ( insteadofTriggerSpecs.size() == 0 )
-        {
-            // Really modify only when there is no INSTEADOF Trigger that applies to the entry.
-            next.modify( normName, mods );
-            triggerSpecCache.subentryModified( normName, mods, modifiedEntry );
-        }
-        else
+        // Fire AFTER Triggers.
+        List afterTriggerSpecs = ( List ) triggerMap.get( ActionTime.AFTER );
+        executeTriggers( afterTriggerSpecs, injector, callerRootCtx );
+    }
+    
+
+    public void modifyRn( NextInterceptor next, LdapDN name, String newRn, boolean deleteOldRn ) throws NamingException
+    {
+        // Bypass trigger handling if the service is disabled.
+        if ( !enabled )
         {
-            // Fire INSTEADOF Triggers.
-            executeTriggers( insteadofTriggerSpecs, injector, callerRootCtx );
+            next.modifyRn( name, newRn, deleteOldRn );
+            return;
         }
         
+        // Gather supplementary data.        
+        Invocation invocation = InvocationStack.getInstance().peek();
+        PartitionNexusProxy proxy = invocation.getProxy();
+        Attributes renamedEntry = proxy.lookup( name, PartitionNexusProxy.LOOKUP_BYPASS );
+        ServerLdapContext callerRootCtx = ( ServerLdapContext ) ( ( ServerLdapContext ) invocation.getCaller() ).getRootContext();
+        
+        LdapDN oldRDN = new LdapDN( name.getRdn().getUpName() );
+        LdapDN newRDN = new LdapDN( newRn );
+        LdapDN oldSuperiorDN = ( LdapDN ) name.clone();
+        oldSuperiorDN.remove( oldSuperiorDN.size() - 1 );
+        LdapDN newSuperiorDN = ( LdapDN ) oldSuperiorDN.clone();
+        LdapDN oldDN = ( LdapDN ) name.clone();
+        LdapDN newDN = ( LdapDN ) name.clone();
+        newDN.add( newRn );
+        
+        StoredProcedureParameterInjector injector = new ModifyDNStoredProcedureParameterInjector(
+            invocation, deleteOldRn, oldRDN, newRDN, oldSuperiorDN, newSuperiorDN, oldDN, newDN );
+        
+        // Gather Trigger Specifications which apply to the entry being renamed.
+        List triggerSpecs = new ArrayList();
+        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 );
+        
+        next.modifyRn( name, newRn, deleteOldRn );
+        triggerSpecCache.subentryRenamed( name, newDN );
+        
         // Fire AFTER Triggers.
         List afterTriggerSpecs = ( List ) triggerMap.get( ActionTime.AFTER );
         executeTriggers( afterTriggerSpecs, injector, callerRootCtx );
     }
     
-    /**
-     * TODO: Fill in this method!
-     */
-    /*
-    public void modifyRn( NextInterceptor next, LdapDN normName, String newRn, boolean deleteOldRn ) throws NamingException
+    public void move( NextInterceptor next, LdapDN oriChildName, LdapDN newParentName, String newRn, boolean deleteOldRn ) throws NamingException
     {
         // Bypass trigger handling if the service is disabled.
         if ( !enabled )
         {
-            next.modifyRn( normName, newRn, deleteOldRn );
+            next.move( oriChildName, newParentName, newRn, deleteOldRn );
             return;
         }
         
-        // Gather supplementary data.
+        // Gather supplementary data.        
+        Invocation invocation = InvocationStack.getInstance().peek();
+        PartitionNexusProxy proxy = invocation.getProxy();
+        Attributes movedEntry = proxy.lookup( oriChildName, PartitionNexusProxy.LOOKUP_BYPASS );
+        ServerLdapContext callerRootCtx = ( ServerLdapContext ) ( ( ServerLdapContext ) invocation.getCaller() ).getRootContext();
+        
+        LdapDN oldRDN = new LdapDN( oriChildName.getRdn().getUpName() );
+        LdapDN newRDN = new LdapDN( newRn );
+        LdapDN oldSuperiorDN = ( LdapDN ) oriChildName.clone();
+        oldSuperiorDN.remove( oldSuperiorDN.size() - 1 );
+        LdapDN newSuperiorDN = ( LdapDN ) newParentName.clone();
+        LdapDN oldDN = ( LdapDN ) oriChildName.clone();
+        LdapDN newDN = ( LdapDN ) newParentName.clone();
+        newDN.add( newRn );
+
+        StoredProcedureParameterInjector injector = new ModifyDNStoredProcedureParameterInjector(
+            invocation, deleteOldRn, oldRDN, newRDN, oldSuperiorDN, newSuperiorDN, oldDN, newDN );
+
+        // Gather Trigger Specifications which apply to the entry being exported.
+        List exportTriggerSpecs = new ArrayList();
+        addPrescriptiveTriggerSpecs( exportTriggerSpecs, proxy, oriChildName, movedEntry );
+        addEntryTriggerSpecs( exportTriggerSpecs, movedEntry );
+        
+        // Get the entry again without operational attributes
+        // because access control subentry operational attributes
+        // will not be valid at the new location.
+        // This will certainly be fixed by the SubentryService,
+        // but after this service.
+        Attributes importedEntry = proxy.lookup( 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
+        // at least with minimal requirements which are object class
+        // and access control subentry operational attributes.
+        SubentryService subentryService = ( SubentryService ) chain.get( "subentryService" );
+        Attributes fakeImportedEntry = subentryService.getSubentryAttributes( newDN, importedEntry );
+        NamingEnumeration attrList = importedEntry.getAll();
+        while ( attrList.hasMore() )
+        {
+            fakeImportedEntry.put( ( Attribute ) attrList.next() );
+        }
+        
+        // Gather Trigger Specifications which apply to the entry being imported.
+        // Note: Entry Trigger Specifications are not valid for Import.
+        List importTriggerSpecs = new ArrayList();
+        addPrescriptiveTriggerSpecs( importTriggerSpecs, proxy, newDN, fakeImportedEntry );
+        
+        // Gather a Map<ActionTime,TriggerSpecification> where TriggerSpecification.ldapOperation = LdapOperation.MODIFYDN_EXPORT.
+        Map exportTriggerMap = getActionTimeMappedTriggerSpecsForOperation( exportTriggerSpecs, LdapOperation.MODIFYDN_EXPORT );
+        
+        // Gather a Map<ActionTime,TriggerSpecification> where TriggerSpecification.ldapOperation = LdapOperation.MODIFYDN_IMPORT.
+        Map importTriggerMap = getActionTimeMappedTriggerSpecsForOperation( importTriggerSpecs, LdapOperation.MODIFYDN_IMPORT );
+        
+        next.move( oriChildName, newParentName, newRn, deleteOldRn );
+        triggerSpecCache.subentryRenamed( oldDN, newDN );
+        
+        // Fire AFTER Triggers.
+        List afterExportTriggerSpecs = ( List ) exportTriggerMap.get( ActionTime.AFTER );
+        List afterImportTriggerSpecs = ( List ) importTriggerMap.get( ActionTime.AFTER );
+        executeTriggers( afterExportTriggerSpecs, injector, callerRootCtx );
+        executeTriggers( afterImportTriggerSpecs, injector, callerRootCtx );
+    }
+    
+    
+    public void move( NextInterceptor next, LdapDN oriChildName, LdapDN newParentName ) throws NamingException
+    {
+        // Bypass trigger handling if the service is disabled.
+        if ( !enabled )
+        {
+            next.move( oriChildName, newParentName );
+            return;
+        }
+        
+        // Gather supplementary data.        
         Invocation invocation = InvocationStack.getInstance().peek();
-        DirectoryPartitionNexusProxy proxy = invocation.getProxy();
-        Attributes entry = proxy.lookup( normName, DirectoryPartitionNexusProxy.LOOKUP_BYPASS );
-        LdapDN newName = ( LdapDN ) normName.clone();
-        newName.remove( normName.size() - 1 );
-        newName.add( parseNormalized( newRn ).get( 0 ) );
+        PartitionNexusProxy proxy = invocation.getProxy();
+        Attributes movedEntry = proxy.lookup( oriChildName, PartitionNexusProxy.LOOKUP_BYPASS );
+        ServerLdapContext callerRootCtx = ( ServerLdapContext ) ( ( ServerLdapContext ) invocation.getCaller() ).getRootContext();
+        
+        LdapDN oldRDN = new LdapDN( oriChildName.getRdn().getUpName() );
+        LdapDN newRDN = new LdapDN( oriChildName.getRdn().getUpName() );
+        LdapDN oldSuperiorDN = ( LdapDN ) oriChildName.clone();
+        oldSuperiorDN.remove( oldSuperiorDN.size() - 1 );
+        LdapDN newSuperiorDN = ( LdapDN ) newParentName.clone();
+        LdapDN oldDN = ( LdapDN ) oriChildName.clone();
+        LdapDN newDN = ( LdapDN ) newParentName.clone();
+        newDN.add( newRDN.getUpName() );
+
+        StoredProcedureParameterInjector injector = new ModifyDNStoredProcedureParameterInjector(
+            invocation, false, oldRDN, newRDN, oldSuperiorDN, newSuperiorDN, oldDN, newDN );
+
+        // Gather Trigger Specifications which apply to the entry being exported.
+        List exportTriggerSpecs = new ArrayList();
+        addPrescriptiveTriggerSpecs( exportTriggerSpecs, proxy, oriChildName, movedEntry );
+        addEntryTriggerSpecs( exportTriggerSpecs, movedEntry );
+        
+        // Get the entry again without operational attributes
+        // because access control subentry operational attributes
+        // will not be valid at the new location.
+        // This will certainly be fixed by the SubentryService,
+        // but after this service.
+        Attributes importedEntry = proxy.lookup( 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
+        // at least with minimal requirements which are object class
+        // and access control subentry operational attributes.
+        SubentryService subentryService = ( SubentryService ) chain.get( "subentryService" );
+        Attributes fakeImportedEntry = subentryService.getSubentryAttributes( newDN, importedEntry );
+        NamingEnumeration attrList = importedEntry.getAll();
+        while ( attrList.hasMore() )
+        {
+            fakeImportedEntry.put( ( Attribute ) attrList.next() );
+        }
+        
+        // Gather Trigger Specifications which apply to the entry being imported.
+        // Note: Entry Trigger Specifications are not valid for Import.
+        List importTriggerSpecs = new ArrayList();
+        addPrescriptiveTriggerSpecs( importTriggerSpecs, proxy, newDN, fakeImportedEntry );
+        
+        // Gather a Map<ActionTime,TriggerSpecification> where TriggerSpecification.ldapOperation = LdapOperation.MODIFYDN_EXPORT.
+        Map exportTriggerMap = getActionTimeMappedTriggerSpecsForOperation( exportTriggerSpecs, LdapOperation.MODIFYDN_EXPORT );
+        
+        // Gather a Map<ActionTime,TriggerSpecification> where TriggerSpecification.ldapOperation = LdapOperation.MODIFYDN_IMPORT.
+        Map importTriggerMap = getActionTimeMappedTriggerSpecsForOperation( importTriggerSpecs, LdapOperation.MODIFYDN_IMPORT );
+        
+        next.move( oriChildName, newParentName );
+        triggerSpecCache.subentryRenamed( oldDN, newDN );
+        
+        // Fire AFTER Triggers.
+        List afterExportTriggerSpecs = ( List ) exportTriggerMap.get( ActionTime.AFTER );
+        List afterImportTriggerSpecs = ( List ) importTriggerMap.get( ActionTime.AFTER );
+        executeTriggers( afterExportTriggerSpecs, injector, callerRootCtx );
+        executeTriggers( afterImportTriggerSpecs, injector, callerRootCtx );
     }
-    */
     
     ////////////////////////////////////////////////////////////////////////////
     // Utility Methods
@@ -480,7 +584,6 @@
     {
         List arguments = new ArrayList();
         arguments.addAll( injector.getArgumentsToInject( tsec.getStoredProcedureParameters() ) );
-        
         List typeList = new ArrayList();
         typeList.addAll( getTypesFromValues( arguments ) );
         

Modified: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/trigger/TriggerSpecCache.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/trigger/TriggerSpecCache.java?view=diff&rev=440458&r1=440457&r2=440458
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/trigger/TriggerSpecCache.java (original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/trigger/TriggerSpecCache.java Tue Sep  5 12:35:34 2006
@@ -63,11 +63,11 @@
 public class TriggerSpecCache
 {
     /** the attribute id for prescriptive trigger: prescriptiveTrigger */
-    private static final String PRESCRIPTIVE_TRIGGER_ATTR = "prescriptiveTrigger";
+    private static final String PRESCRIPTIVE_TRIGGER_ATTR = "prescriptiveTriggerSpecification";
     /** the attribute id for an object class: objectClass */
     private static final String OC_ATTR = "objectClass";
-    /** the object class for trigger subentries: triggerSubentry */
-    private static final String TRIGGER_SUBENTRY_OC = "triggerSubentry";
+    /** the object class for trigger subentries: triggerExecutionSubentry */
+    private static final String TRIGGER_SUBENTRY_OC = "triggerExecutionSubentry";
 
     /** the logger for this class */
     private static final Logger log = LoggerFactory.getLogger( TriggerSpecCache.class );
@@ -126,7 +126,7 @@
                 Attribute triggerSpec = result.getAttributes().get( PRESCRIPTIVE_TRIGGER_ATTR );
                 if ( triggerSpec == null )
                 {
-                    log.warn( "Found triggerSubentry '" + subentryDn + "' without any " + PRESCRIPTIVE_TRIGGER_ATTR );
+                    log.warn( "Found triggerExecutionSubentry '" + subentryDn + "' without any " + PRESCRIPTIVE_TRIGGER_ATTR );
                     continue;
                 }
 

Modified: directory/trunks/apacheds/core/src/main/schema/apache.schema
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/core/src/main/schema/apache.schema?view=diff&rev=440458&r1=440457&r2=440458
==============================================================================
--- directory/trunks/apacheds/core/src/main/schema/apache.schema (original)
+++ directory/trunks/apacheds/core/src/main/schema/apache.schema Tue Sep  5 12:35:34 2006
@@ -223,19 +223,19 @@
 # Trigger related
 # ===============
 
-attributetype ( 1.2.6.1.4.1.18060.1.1.1.3.25 NAME 'prescriptiveTrigger'
+attributetype ( 1.2.6.1.4.1.18060.1.1.1.3.25 NAME 'prescriptiveTriggerSpecification'
     DESC 'Trigger specification that applies to a set of entries'
     EQUALITY directoryStringFirstComponentMatch
     SYNTAX 1.3.6.1.4.1.1466.115.121.1.59
     USAGE directoryOperation )
 
-attributetype ( 1.2.6.1.4.1.18060.1.1.1.3.26 NAME 'entryTrigger'
+attributetype ( 1.2.6.1.4.1.18060.1.1.1.3.26 NAME 'entryTriggerSpecification'
     DESC 'Trigger specification that applies to a single entry'
     EQUALITY directoryStringFirstComponentMatch
     SYNTAX 1.3.6.1.4.1.1466.115.121.1.59
     USAGE directoryOperation )
 
-attributetype ( 1.2.6.1.4.1.18060.1.1.1.3.27 NAME 'triggerSubentries'
+attributetype ( 1.2.6.1.4.1.18060.1.1.1.3.27 NAME 'triggerExecutionSubentries'
     DESC 'Used to track subentries associated with a trigger area which an entry falls under'
     SUP distinguishedName
     EQUALITY distinguishedNameMatch
@@ -243,10 +243,10 @@
     NO-USER-MODIFICATION
     USAGE directoryOperation )
 
-objectclass ( 1.2.6.1.4.1.18060.1.1.1.3.28 NAME 'triggerSubentry'
+objectclass ( 1.2.6.1.4.1.18060.1.1.1.3.28 NAME 'triggerExecutionSubentry'
     DESC 'Used to track a subentry associated with trigger areas'
     AUXILIARY
-    MUST prescriptiveTrigger )
+    MUST prescriptiveTriggerSpecification )
 
 # ======================
 # End of Trigger related

Modified: directory/trunks/apacheds/server-sar/pom.xml
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/server-sar/pom.xml?view=diff&rev=440458&r1=440457&r2=440458
==============================================================================
--- directory/trunks/apacheds/server-sar/pom.xml (original)
+++ directory/trunks/apacheds/server-sar/pom.xml Tue Sep  5 12:35:34 2006
@@ -21,7 +21,7 @@
     <dependency>
       <groupId>org.apache.directory.daemon</groupId>
       <artifactId>daemon-bootstrappers</artifactId>
-      <version>1.0-RC3-SNAPSHOT</version>
+      <version>1.0-RC3</version>
     </dependency>
     <dependency>
       <groupId>jboss</groupId>

Modified: directory/trunks/apacheds/server-tools/pom.xml
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/server-tools/pom.xml?view=diff&rev=440458&r1=440457&r2=440458
==============================================================================
--- directory/trunks/apacheds/server-tools/pom.xml (original)
+++ directory/trunks/apacheds/server-tools/pom.xml Tue Sep  5 12:35:34 2006
@@ -22,7 +22,7 @@
     <dependency>
       <groupId>org.apache.directory.daemon</groupId>
       <artifactId>daemon-bootstrappers</artifactId>
-      <version>1.0-RC3-SNAPSHOT</version>
+      <version>1.0-RC3</version>
     </dependency>
     <dependency>
       <groupId>commons-cli</groupId>

Modified: directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/AbstractServerTriggerServiceTest.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/AbstractServerTriggerServiceTest.java?view=diff&rev=440458&r1=440457&r2=440458
==============================================================================
--- directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/AbstractServerTriggerServiceTest.java (original)
+++ directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/AbstractServerTriggerServiceTest.java Tue Sep  5 12:35:34 2006
@@ -159,9 +159,9 @@
         subentry.put( objectClass );
         objectClass.add( "top" );
         objectClass.add( "subentry" );
-        objectClass.add( "triggerSubentry" );
+        objectClass.add( "triggerExecutionSubentry" );
         subentry.put( "subtreeSpecification", subtree );
-        subentry.put( "prescriptiveTrigger", triggerSpec );
+        subentry.put( "prescriptiveTriggerSpecification", triggerSpec );
         adminCtx.createSubcontext( "cn=" + cn, subentry );
     }
 
@@ -176,7 +176,7 @@
      */
     public void addEntryTrigger( LdapContext adminCtx, Name rdn, String triggerSpec ) throws NamingException
     {
-        Attributes changes = new BasicAttributes( "entryTrigger", triggerSpec, true );
+        Attributes changes = new BasicAttributes( "entryTriggerSpecification", triggerSpec, true );
         adminCtx.modifyAttributes( rdn, DirContext.ADD_ATTRIBUTE, changes );
     }
 

Modified: directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/DefaultServerTriggerServiceTest.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/DefaultServerTriggerServiceTest.java?view=diff&rev=440458&r1=440457&r2=440458
==============================================================================
--- directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/DefaultServerTriggerServiceTest.java (original)
+++ directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/DefaultServerTriggerServiceTest.java Tue Sep  5 12:35:34 2006
@@ -87,7 +87,7 @@
         
         // Create the Triger Specification within a Trigger Subentry.
         createTriggerSubentry( ctx, "triggerSubentry1",
-            "AFTER delete CALL \"" + BackupUtilities.class.getName() + ".backupDeleted\" ( $rootDSE, $name, $operationPrincipal, $deletedEntry )" );
+            "AFTER Delete CALL \"" + BackupUtilities.class.getName() + ".backupDeleted\" ( $ldapContext \"\", $name, $operationPrincipal, $deletedEntry )" );
         
         // Create a test entry which is selected by the Trigger Subentry.
         Attributes testEntry = new BasicAttributes( "ou", "testou", true );

Modified: directory/trunks/shared/ldap/src/main/antlr/TriggerSpecification.g
URL: http://svn.apache.org/viewvc/directory/trunks/shared/ldap/src/main/antlr/TriggerSpecification.g?view=diff&rev=440458&r1=440457&r2=440458
==============================================================================
--- directory/trunks/shared/ldap/src/main/antlr/TriggerSpecification.g (original)
+++ directory/trunks/shared/ldap/src/main/antlr/TriggerSpecification.g Tue Sep  5 12:35:34 2006
@@ -138,64 +138,23 @@
 {
     log.debug( "entered actionTime()" );
 }
-    : ID_BEFORE { triggerActionTime = ActionTime.BEFORE; }
-    | ID_AFTER { triggerActionTime = ActionTime.AFTER; }
-    | ID_INSTEADOF { triggerActionTime = ActionTime.INSTEADOF; }
+    : ID_AFTER { triggerActionTime = ActionTime.AFTER; }
     ;
     
 ldapOperationAndStoredProcedureCall
 {
     log.debug( "entered ldapOperationAndStoredProcedureCall()" );
 }
-    : bindOperationAndStoredProcedureCall { triggerLdapOperation = LdapOperation.BIND; }
-    | unbindOperationAndStoredProcedureCall { triggerLdapOperation = LdapOperation.UNBIND; }
-    | searchOperationAndStoredProcedureCall { triggerLdapOperation = LdapOperation.SEARCH; }
-    | modifyOperationAndStoredProcedureCall { triggerLdapOperation = LdapOperation.MODIFY; }
+    : modifyOperationAndStoredProcedureCall { triggerLdapOperation = LdapOperation.MODIFY; }
     | addOperationAndStoredProcedureCall { triggerLdapOperation = LdapOperation.ADD; }
     | deleteOperationAndStoredProcedureCall { triggerLdapOperation = LdapOperation.DELETE; }
-    | modDNOperationAndStoredProcedureCall { triggerLdapOperation = LdapOperation.MODDN; }
-    | compareOperationAndStoredProcedureCall { triggerLdapOperation = LdapOperation.COMPARE; }
-    | abandonOperationAndStoredProcedureCall { triggerLdapOperation = LdapOperation.ABANDON; }
-    | extendedOperationAndStoredProcedureCall { triggerLdapOperation = LdapOperation.EXTENDED; }
+    | modifyDNOperationAndStoredProcedureCall
     ;
 
 // -----------------------------------------------------------------------------
 //  XXXOperationAndStoredProcedureCall
 // -----------------------------------------------------------------------------
 
-bindOperationAndStoredProcedureCall
-{
-    log.debug( "entered bindOperationAndStoredProcedureCall()" );
-}
-    :
-    ID_bind theCompositeRuleForCallAndSPNameAndSPOptionList
-    OPEN_PARAN ( SP )*
-        ( bindStoredProcedureParameterList )?
-    CLOSE_PARAN
-    ;
-
-unbindOperationAndStoredProcedureCall
-{
-    log.debug( "entered unbindOperationAndStoredProcedureCall()" );
-}
-    :
-    ID_unbind theCompositeRuleForCallAndSPNameAndSPOptionList
-    OPEN_PARAN ( SP )*
-        ( unbindStoredProcedureParameterList )?
-    CLOSE_PARAN
-    ;
-
-searchOperationAndStoredProcedureCall
-{
-    log.debug( "entered searchOperationAndStoredProcedureCall()" );
-}
-    :
-    ID_search theCompositeRuleForCallAndSPNameAndSPOptionList
-    OPEN_PARAN ( SP )*
-        ( searchStoredProcedureParameterList )?
-    CLOSE_PARAN
-    ;
-
 modifyOperationAndStoredProcedureCall
 {
     log.debug( "entered modifyOperationAndStoredProcedureCall()" );
@@ -229,47 +188,18 @@
     CLOSE_PARAN
     ;
 
-modDNOperationAndStoredProcedureCall
-{
-    log.debug( "entered modDNOperationAndStoredProcedureCall()" );
-}
-    :
-    ID_modDN theCompositeRuleForCallAndSPNameAndSPOptionList
-    OPEN_PARAN ( SP )*
-        ( modDNStoredProcedureParameterList )?
-    CLOSE_PARAN
-    ;
-
-compareOperationAndStoredProcedureCall
-{
-    log.debug( "entered compareOperationAndStoredProcedureCall()" );
-}
-    :
-    ID_compare theCompositeRuleForCallAndSPNameAndSPOptionList
-    OPEN_PARAN ( SP )*
-        ( compareStoredProcedureParameterList )?
-    CLOSE_PARAN
-    ;
-
-abandonOperationAndStoredProcedureCall
+modifyDNOperationAndStoredProcedureCall
 {
-    log.debug( "entered abandonOperationAndStoredProcedureCall()" );
+    log.debug( "entered modifyDNOperationAndStoredProcedureCall()" );
 }
     :
-    ID_abandon theCompositeRuleForCallAndSPNameAndSPOptionList
+    ID_modifyDN DOT
+    ( ID_modifyDNRename { triggerLdapOperation = LdapOperation.MODIFYDN_RENAME; }
+    | ID_modifyDNExport { triggerLdapOperation = LdapOperation.MODIFYDN_EXPORT; }
+    | ID_modifyDNImport { triggerLdapOperation = LdapOperation.MODIFYDN_IMPORT; } )
+    theCompositeRuleForCallAndSPNameAndSPOptionList
     OPEN_PARAN ( SP )*
-        ( abandonStoredProcedureParameterList )?
-    CLOSE_PARAN
-    ;
-
-extendedOperationAndStoredProcedureCall
-{
-    log.debug( "entered extendedOperationAndStoredProcedureCall()" );
-}
-    :
-    ID_extended theCompositeRuleForCallAndSPNameAndSPOptionList
-    OPEN_PARAN ( SP )*
-        ( extendedStoredProcedureParameterList )?
+        ( modifyDNStoredProcedureParameterList )?
     CLOSE_PARAN
     ;
 
@@ -296,33 +226,6 @@
 //  XXXStoredProcedureParameterList
 // -----------------------------------------------------------------------------
 
-bindStoredProcedureParameterList
-{
-    log.debug( "entered bindStoredProcedureParameterList()" );
-}
-    :
-    bindStoredProcedureParameter ( SP )*
-        ( SEP ( SP )* bindStoredProcedureParameter ( SP )* )*
-    ;
-
-unbindStoredProcedureParameterList
-{
-    log.debug( "entered unbindStoredProcedureParameterList()" );
-}
-    :
-    unbindStoredProcedureParameter ( SP )*
-        ( SEP ( SP )* unbindStoredProcedureParameter ( SP )* )*
-    ;
-
-searchStoredProcedureParameterList
-{
-    log.debug( "entered searchStoredProcedureParameterList()" );
-}
-    :
-    searchStoredProcedureParameter ( SP )*
-        ( SEP ( SP )* searchStoredProcedureParameter ( SP )* )*
-    ;
-
 modifyStoredProcedureParameterList
 {
     log.debug( "entered modifyStoredProcedureParameterList()" );
@@ -350,86 +253,27 @@
         ( SEP ( SP )* deleteStoredProcedureParameter ( SP )* )*
     ;
 
-modDNStoredProcedureParameterList
-{
-    log.debug( "entered modDNStoredProcedureParameterList()" );
-}
-    :
-    modDNStoredProcedureParameter ( SP )*
-        ( SEP ( SP )* modDNStoredProcedureParameter ( SP )* )*
-    ;
-
-compareStoredProcedureParameterList
+modifyDNStoredProcedureParameterList
 {
-    log.debug( "entered compareStoredProcedureParameterList()" );
+    log.debug( "entered modifyDNStoredProcedureParameterList()" );
 }
     :
-    compareStoredProcedureParameter ( SP )*
-        ( SEP ( SP )* compareStoredProcedureParameter ( SP )* )*
-    ;
-
-abandonStoredProcedureParameterList
-{
-    log.debug( "entered abandonStoredProcedureParameterList()" );
-}
-    :
-    abandonStoredProcedureParameter ( SP )*
-        ( SEP ( SP )* abandonStoredProcedureParameter ( SP )* )*
-    ;
-
-extendedStoredProcedureParameterList
-{
-    log.debug( "entered extendedStoredProcedureParameterList()" );
-}
-    :
-    extendedStoredProcedureParameter ( SP )*
-        ( SEP ( SP )* extendedStoredProcedureParameter ( SP )* )*
+    modifyDNStoredProcedureParameter ( SP )*
+        ( SEP ( SP )* modifyDNStoredProcedureParameter ( SP )* )*
     ;
 
 // -----------------------------------------------------------------------------
 // XXXStoredProcedureParameter
 // -----------------------------------------------------------------------------
 
-bindStoredProcedureParameter
-{
-    log.debug( "entered bindStoredProcedureParameter()" );
-}
-    : ID_version { triggerStoredProcedureParameters.add( StoredProcedureParameter.BindStoredProcedureParameter.VERSION ); }
-    | ID_name { triggerStoredProcedureParameters.add( StoredProcedureParameter.BindStoredProcedureParameter.NAME ); }
-    | ID_authentication { triggerStoredProcedureParameters.add( StoredProcedureParameter.BindStoredProcedureParameter.AUTHENTICATION ); }
-    | genericStoredProcedureParameter
-    ;
-
-unbindStoredProcedureParameter
-{
-    log.debug( "entered unbindStoredProcedureParameter()" );
-}
-    : genericStoredProcedureParameter
-    ;
-
-searchStoredProcedureParameter
-{
-    log.debug( "entered searchStoredProcedureParameter()" );
-}
-    : ID_baseObject { triggerStoredProcedureParameters.add( StoredProcedureParameter.SearchStoredProcedureParameter.BASE_OBJECT ); }
-    | ID_scope { triggerStoredProcedureParameters.add( StoredProcedureParameter.SearchStoredProcedureParameter.SCOPE ); }
-    | ID_derefAliases { triggerStoredProcedureParameters.add( StoredProcedureParameter.SearchStoredProcedureParameter.DEREF_ALIASES ); }
-    | ID_sizeLimit { triggerStoredProcedureParameters.add( StoredProcedureParameter.SearchStoredProcedureParameter.SIZE_LIMIT ); }
-    | ID_timeLimit { triggerStoredProcedureParameters.add( StoredProcedureParameter.SearchStoredProcedureParameter.TIME_LIMIT ); }
-    | ID_typesOnly { triggerStoredProcedureParameters.add( StoredProcedureParameter.SearchStoredProcedureParameter.TYPES_ONLY ); }
-    | ID_filter { triggerStoredProcedureParameters.add( StoredProcedureParameter.SearchStoredProcedureParameter.FILTER ); }
-    | ID_attributes { triggerStoredProcedureParameters.add( StoredProcedureParameter.SearchStoredProcedureParameter.ATTRIBUTES ); }
-    | genericStoredProcedureParameter
-    ;
-
 modifyStoredProcedureParameter
 {
     log.debug( "entered modifyStoredProcedureParameter()" );
 }
-    : ID_object { triggerStoredProcedureParameters.add( StoredProcedureParameter.ModifyStoredProcedureParameter.OBJECT ); }
-    | ID_modification { triggerStoredProcedureParameters.add( StoredProcedureParameter.ModifyStoredProcedureParameter.MODIFICATION ); }
-    | ID_oldEntry { triggerStoredProcedureParameters.add( StoredProcedureParameter.ModifyStoredProcedureParameter.OLD_ENTRY ); }
-    | ID_newEntry { triggerStoredProcedureParameters.add( StoredProcedureParameter.ModifyStoredProcedureParameter.NEW_ENTRY ); }
+    : ID_object { triggerStoredProcedureParameters.add( StoredProcedureParameter.Modify_OBJECT.instance() ); }
+    | ID_modification { triggerStoredProcedureParameters.add( StoredProcedureParameter.Modify_MODIFICATION.instance() ); }
+    | ID_oldEntry { triggerStoredProcedureParameters.add( StoredProcedureParameter.Modify_OLD_ENTRY.instance() ); }
+    | ID_newEntry { triggerStoredProcedureParameters.add( StoredProcedureParameter.Modify_NEW_ENTRY.instance() ); }
     | genericStoredProcedureParameter
     ;
 
@@ -437,8 +281,8 @@
 {
     log.debug( "entered addStoredProcedureParameter()" );
 }
-    : ID_entry { triggerStoredProcedureParameters.add( StoredProcedureParameter.AddStoredProcedureParameter.ENTRY ); }
-    | ID_attributes { triggerStoredProcedureParameters.add( StoredProcedureParameter.AddStoredProcedureParameter.ATTRIBUTES ); }
+    : ID_entry { triggerStoredProcedureParameters.add( StoredProcedureParameter.Add_ENTRY.instance() ); }
+    | ID_attributes { triggerStoredProcedureParameters.add( StoredProcedureParameter.Add_ATTRIBUTES.instance() ); }
     | genericStoredProcedureParameter
     ;
 
@@ -446,45 +290,19 @@
 {
     log.debug( "entered deleteStoredProcedureParameter()" );
 }
-    : ID_name { triggerStoredProcedureParameters.add( StoredProcedureParameter.DeleteStoredProcedureParameter.NAME ); }
-    | ID_deletedEntry { triggerStoredProcedureParameters.add( StoredProcedureParameter.DeleteStoredProcedureParameter.DELETED_ENTRY ); }
-    | genericStoredProcedureParameter
-    ;
-
-modDNStoredProcedureParameter
-{
-    log.debug( "entered modDNStoredProcedureParameter()" );
-}
-    : ID_entry { triggerStoredProcedureParameters.add( StoredProcedureParameter.ModDNStoredProcedureParameter.ENTRY ); }
-    | ID_newrdn { triggerStoredProcedureParameters.add( StoredProcedureParameter.ModDNStoredProcedureParameter.NEW_RDN ); }
-    | ID_deleteoldrdn { triggerStoredProcedureParameters.add( StoredProcedureParameter.ModDNStoredProcedureParameter.DELETE_OLD_RDN ); }
-    | ID_newSuperior { triggerStoredProcedureParameters.add( StoredProcedureParameter.ModDNStoredProcedureParameter.NEW_SUPERIOR ); }
+    : ID_name { triggerStoredProcedureParameters.add( StoredProcedureParameter.Delete_NAME.instance() ); }
+    | ID_deletedEntry { triggerStoredProcedureParameters.add( StoredProcedureParameter.Delete_DELETED_ENTRY.instance() ); }
     | genericStoredProcedureParameter
     ;
 
-compareStoredProcedureParameter
+modifyDNStoredProcedureParameter
 {
-    log.debug( "entered compareStoredProcedureParameter()" );
+    log.debug( "entered modifyDNStoredProcedureParameter()" );
 }
-    : ID_entry { triggerStoredProcedureParameters.add( StoredProcedureParameter.CompareStoredProcedureParameter.ENTRY ); }
-    | ID_ava { triggerStoredProcedureParameters.add( StoredProcedureParameter.CompareStoredProcedureParameter.AVA ); }
-    | genericStoredProcedureParameter
-    ;
-
-abandonStoredProcedureParameter
-{
-    log.debug( "entered abandonStoredProcedureParameter()" );
-}
-    : ID_messageId { triggerStoredProcedureParameters.add( StoredProcedureParameter.AbandonStoredProcedureParameter.MESSAGE_ID ); }
-    | genericStoredProcedureParameter
-    ;
-    
-extendedStoredProcedureParameter
-{
-    log.debug( "entered extendedStoredProcedureParameter()" );
-}
-    : ID_requestName { triggerStoredProcedureParameters.add( StoredProcedureParameter.ExtendedStoredProcedureParameter.REQUEST_NAME ); }
-    | ID_requestValue { triggerStoredProcedureParameters.add( StoredProcedureParameter.ExtendedStoredProcedureParameter.REQUEST_VALUE ); }
+    : ID_entry { triggerStoredProcedureParameters.add( StoredProcedureParameter.ModifyDN_ENTRY.instance() ); }
+    | ID_newrdn { triggerStoredProcedureParameters.add( StoredProcedureParameter.ModifyDN_NEW_RDN.instance() ); }
+    | ID_deleteoldrdn { triggerStoredProcedureParameters.add( StoredProcedureParameter.ModifyDN_DELETE_OLD_RDN.instance() ); }
+    | ID_newSuperior { triggerStoredProcedureParameters.add( StoredProcedureParameter.ModifyDN_NEW_SUPERIOR.instance() ); }
     | genericStoredProcedureParameter
     ;
 
@@ -494,11 +312,19 @@
 {
     log.debug( "entered genericStoredProcedureParameter()" );
 }
-    : ID_operationTime { triggerStoredProcedureParameters.add( StoredProcedureParameter.OPERATION_TIME ); }
-    | ID_operationPrincipal { triggerStoredProcedureParameters.add( StoredProcedureParameter.OPERATION_PRINCIPAL ); }
-    | ID_rootDSE { triggerStoredProcedureParameters.add( StoredProcedureParameter.ROOT_DSE ); }
+    : ldapContextStoredProcedureParameter
+    | ID_operationPrincipal { triggerStoredProcedureParameters.add( StoredProcedureParameter.Generic_OPERATION_PRINCIPAL.instance() ); }
     ;
 
+ldapContextStoredProcedureParameter
+{
+    log.debug( "entered ldapContextStoredProcedureParameter()" );
+    LdapDN ldapContext = null;
+}
+    : ID_ldapContext ( SP )+ ldapContext=distinguishedName
+    { triggerStoredProcedureParameters.add( StoredProcedureParameter.Generic_LDAP_CONTEXT.instance( ldapContext ) ); }
+	;
+
 // -----------------------------------------------------------------------------
 
 genericStoredProcedureOptionList
@@ -515,17 +341,17 @@
     log.debug( "entered genericStoredProcedureOption()" );
     StoredProcedureOption spOption = null;
 }
-    : ( spOption=storedProcedureLanguageOption | spOption=storedProcedureSearchContextOption )
+    : ( spOption=storedProcedureLanguageSchemeOption | spOption=storedProcedureSearchContextOption )
     { triggerStoredProcedureOptions.add( spOption ); }
     ;
 
-storedProcedureLanguageOption returns [ StoredProcedureLanguageOption spLanguageOption ]
+storedProcedureLanguageSchemeOption returns [ StoredProcedureLanguageSchemeOption spLanguageSchemeOption ]
 {
-    log.debug( "entered storedProcedureLanguageOption()" );
-    spLanguageOption = null;
+    log.debug( "entered storedProcedureLanguageSchemeOption()" );
+    spLanguageSchemeOption = null;
 }
-    : ID_language ( SP )+ languageToken:UTF8String
-    { spLanguageOption = new StoredProcedureLanguageOption( languageToken.getText() ); }
+    : ID_languageScheme ( SP )+ languageToken:UTF8String
+    { spLanguageSchemeOption = new StoredProcedureLanguageSchemeOption( languageToken.getText() ); }
     ;
 
 storedProcedureSearchContextOption returns [ StoredProcedureSearchContextOption spSearchContextOption ]
@@ -624,39 +450,16 @@
 tokens
 {
     // action time identifiers
-    ID_BEFORE = "before";
     ID_AFTER = "after";
-    ID_INSTEADOF = "insteadof";
     
     // operation identifiers
-    ID_bind = "bind";
-    ID_unbind = "unbind";
-    ID_search  = "search";
     ID_modify  = "modify";
     ID_add = "add";
     ID_delete = "delete";
-    ID_modDN = "moddn";
-    ID_compare = "compare";
-    ID_abandon = "abandon";
-    ID_extended = "extended";
-    
-    // bind specific parameters
-    ID_version = "$version";
-    ID_name = "$name";
-    ID_authentication = "$authentication";
-    
-    // unbind specific parameters
-    // there is non currently
-    
-    // search specific parameters
-    ID_baseObject = "$baseobject";
-    ID_scope = "$scope";
-    ID_derefAliases = "$derefaliases";
-    ID_sizeLimit = "$sizelimit";
-    ID_timeLimit = "$timelimit";
-    ID_typesOnly = "$typesonly";
-    ID_filter = "$filter";
-    ID_attributes = "$attributes";
+    ID_modifyDN = "modifydn";
+    ID_modifyDNRename = "rename";
+    ID_modifyDNExport = "export";
+    ID_modifyDNImport = "import";
     
     // modify specific parameters
     ID_object = "$object";
@@ -666,37 +469,25 @@
     
     // add specific parameters
     ID_entry = "$entry";
-    // ID_attributes = "$attributes"; // defined before
+    ID_attributes = "$attributes";
     
     // delete specific parameters
-    // ID_name = "$name"; // defined before
+    ID_name = "$name";
     ID_deletedEntry = "$deletedentry";
     
-    // modDN specific parameters
+    // modifyDN specific parameters
     // ID_entry = "$entry"; // defined before
     ID_newrdn = "$newrdn";
     ID_deleteoldrdn = "$deleteoldrdn";
     ID_newSuperior = "$newsuperior";
     
-    // compare specific parameters
-    // ID_entry = "$entry"; // defined before
-    ID_ava = "$ava";
-    
-    // abandon specific parameters
-    ID_messageId = "$messageid";
-    
-    // extended specific parameters
-    ID_requestName = "$requestname";
-    ID_requestValue = "$requestvalue";
-    
     // generic parameters
-    ID_operationTime = "$operationtime";
+    ID_ldapContext = "$ldapcontext";
     ID_operationPrincipal = "$operationprincipal";
-    ID_rootDSE = "$rootDSE";
     
     ID_CALL = "call";
     
-    ID_language = "language";
+    ID_languageScheme = "languagescheme";
     ID_searchContext = "searchcontext";
     ID_search_scope = "scope";
     ID_scope_base = "base";
@@ -734,6 +525,8 @@
     | '\n' { newline(); }
     | '\r' ('\n')? { newline(); }
     ;
+
+DOT : '.' ;
 
 UTF8String : '"'! ( SAFEUTF8CHAR )* '"'! ;
 

Modified: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/trigger/ActionTime.java
URL: http://svn.apache.org/viewvc/directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/trigger/ActionTime.java?view=diff&rev=440458&r1=440457&r2=440458
==============================================================================
--- directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/trigger/ActionTime.java (original)
+++ directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/trigger/ActionTime.java Tue Sep  5 12:35:34 2006
@@ -30,11 +30,11 @@
  */
 public class ActionTime
 {
-    public static final ActionTime BEFORE = new ActionTime( "BEFORE" );
+    //public static final ActionTime BEFORE = new ActionTime( "BEFORE" );
 
     public static final ActionTime AFTER = new ActionTime( "AFTER" );
 
-    public static final ActionTime INSTEADOF = new ActionTime( "INSTEADOF" );
+    //public static final ActionTime INSTEADOF = new ActionTime( "INSTEADOF" );
 
     
     private final String name;

Modified: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/trigger/LdapOperation.java
URL: http://svn.apache.org/viewvc/directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/trigger/LdapOperation.java?view=diff&rev=440458&r1=440457&r2=440458
==============================================================================
--- directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/trigger/LdapOperation.java (original)
+++ directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/trigger/LdapOperation.java Tue Sep  5 12:35:34 2006
@@ -22,32 +22,26 @@
 
 
 /**
- * An enumeration that represents all standard LDAP operations.
+ * An enumeration that represents change inducing LDAP operations.
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev:$, $Date:$
  */
 public class LdapOperation
 {
-    public static final LdapOperation BIND = new LdapOperation( "bind" );
+    public static final LdapOperation MODIFY = new LdapOperation( "Modify" );
 
-    public static final LdapOperation UNBIND = new LdapOperation( "unbind" );
+    public static final LdapOperation ADD = new LdapOperation( "Add" );
 
-    public static final LdapOperation SEARCH = new LdapOperation( "search" );
+    public static final LdapOperation DELETE = new LdapOperation( "Delete" );
 
-    public static final LdapOperation MODIFY = new LdapOperation( "modify" );
-
-    public static final LdapOperation ADD = new LdapOperation( "add" );
-
-    public static final LdapOperation DELETE = new LdapOperation( "delete" );
-
-    public static final LdapOperation MODDN = new LdapOperation( "moddn" );
-
-    public static final LdapOperation COMPARE = new LdapOperation( "compare" );
+    public static final LdapOperation MODIFYDN = new LdapOperation( "ModifyDN" );
+    
+    public static final LdapOperation MODIFYDN_RENAME = new LdapOperation( "ModifyDN.Rename" );
     
-    public static final LdapOperation ABANDON = new LdapOperation( "abandon" );
+    public static final LdapOperation MODIFYDN_EXPORT = new LdapOperation( "ModifyDN.Export" );
     
-    public static final LdapOperation EXTENDED = new LdapOperation( "extended" );
+    public static final LdapOperation MODIFYDN_IMPORT = new LdapOperation( "ModifyDN.Import" );
 
     
     private final String name;

Copied: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/trigger/StoredProcedureLanguageSchemeOption.java (from r440188, directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/trigger/StoredProcedureLanguageOption.java)
URL: http://svn.apache.org/viewvc/directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/trigger/StoredProcedureLanguageSchemeOption.java?view=diff&rev=440458&p1=directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/trigger/StoredProcedureLanguageOption.java&r1=440188&p2=directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/trigger/StoredProcedureLanguageSchemeOption.java&r2=440458
==============================================================================
--- directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/trigger/StoredProcedureLanguageOption.java (original)
+++ directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/trigger/StoredProcedureLanguageSchemeOption.java Tue Sep  5 12:35:34 2006
@@ -26,12 +26,12 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev:$, $Date:$
  */
-public class StoredProcedureLanguageOption implements StoredProcedureOption
+public class StoredProcedureLanguageSchemeOption implements StoredProcedureOption
 {
     
     private String language;
     
-    public StoredProcedureLanguageOption( String language )
+    public StoredProcedureLanguageSchemeOption( String language )
     {
         this.language = language;
     }
@@ -72,7 +72,7 @@
             return false;
         if ( getClass() != obj.getClass() )
             return false;
-        final StoredProcedureLanguageOption other = ( StoredProcedureLanguageOption ) obj;
+        final StoredProcedureLanguageSchemeOption other = ( StoredProcedureLanguageSchemeOption ) obj;
         if ( language == null )
         {
             if ( other.language != null )



Mime
View raw message