Introduction
This guide serves as an introduction to architectural concepts related to and administration of Triggers in ApacheDS. ApacheDS is the first server to provide Triggers for LDAP like their counterparts in RDBMS world. The Trigger Model in ApacheDS has been carefully designed to be LDAP standards compliant and to take advantage of powerful aspects of ApacheDS like The Administrative Model. A Trigger basically provides a mechanism to register some sort of action to be fired upon an event. To restate this considering ApacheDS Triggers, Triggers allow you to register Stored Procedure invocations to be fired upon any change-inducing LDAP operations on some set of selected entries. Triggers also provides some facilities to make them even more usable like allowing to pass request parameters to stored procedures. To make the most sense of this powerful construct you need to first understand The Administrative Model and have a look at Stored Procedures.
Trigger Specification
A Trigger can be specified with three basic components: Action Time, Trigger Event and Triggered Action. According to a Trigger specification, when a tracked Event occurs an Action gets invoked with respect to the Action Time. For example if an Add operation (Event) is performed, information related to it may be logged with a Stored Procedure (Triggered Action), just After (Action Time) the Add operation ended. Here is a sample Trigger Specification:
AFTER Add CALL "Logger.logAddOperation" ($entry,$attributes,$operationPrincipal);
In this example a Stored Procedure named "Logger.logAddOperation" is executed with three operation specific arguments After an LDAP Add operation is performed. The operation specific arguments will be discussed later as well as the not-yet-specified set of entries the Trigger is defined on.
Action Time for Triggers
ApacheDS LDAP Triggers currently support only AFTER action time scheme. An AFTER Triggers is executed just after the tracked event occurs but before the end of request. So before invoking a Triggered Action with respect to a tracked LDAP operation as a Trigger Event, the operation is executed essentially. After the Triggered Action is invoked the operation end completely.
TODO: Order of execution of Triggered Actions when there are more than one Triggered Actions with respect to an Event.
Note that more than one Triggered Action can be associated with a tracked event. The order of execution a Actions depends on the type of the Acti
Trigger Events: LDAP Operations
Change inducing LDAP operations can be specified as Trigger Events in a Trigger Specification. The following are valid identifiers as valid Trigger Events:
- Modify
- Add
- Delete
- ModifyDN.Rename
- ModifyDN.Export
- ModifyDN.Import