directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Emmanuel Lécharny <elecha...@gmail.com>
Subject Re: [ApacheDS] Trigger in ApacheDS
Date Thu, 03 May 2012 15:40:05 GMT
Le 5/3/12 5:19 PM, Juan Pablo Sotelo a écrit :
> Hello everybody,
>
>                            sorry for the insistent question, but I want to
> know if this feature is real (I am talking about triggers),
It's experimental.
> if this feature
> is currently working on the latest version of apacheDS (I read in a forum
> that is not, need confirmation)?.
It should be working, but the latest version (2.0.0-M6) is a milestone, 
so we were focused on some other aspects of the code. We will most 
certainly review the trigger/SP code in a future milstone (no date 
provided...)

The tests are ignored atm. I'll check why they have not been set back...

>   And if you can, give me some advices
> about how to syncrhonize the apacheDS with a DB??
This is quite a complex question...
>
> I really want to use ApacheDS on my company but I need to solve this
> "problem". I hope you give me a hand.
>
> Thanks
>
> OLD Question - unanswered ---------------------------------
>
> Hello everyone, I need to know about triggers and SPs in ApacheDS in order
> to implement this features at work. I need them in order to create a
> trigger in order to synchronize a table that we have in an Oracle DB. I
> already created a trigger in the other way (Oracle to ldap) But I need two
> ways.
>
> After reading all the documentation that I found on internet I still have
> doubts about this features.
>
> 1- It is a posibility to write an interceptor in order to intercept the add
> call (or DELETE OR MODIFY) and trigger an action in java?
Yep.
> 2- In order to add/install our new interceptor:
>      a- Build the interceptor and generate a new jar.
>      b- Copy the jar file to APACHEDS_INSTALLDIR/lib/ext
>      c- ADd the interceptor to the server.xml file in
> APACHEDS_INSTALLDIR/conf/, fin the xml elements which list the
> interceptors. The easiest way to add a custom interceptor  is to add a
> Spring bean (namespace "s"). You may set configuration properties to the
> interceptros as well, if it supports some.
>      <interceptors>
>      <normalizationInterceptor/>
>      <s:bean
> class=3D"org.apache.directory.samples.interceptor.pwdhash.PasswordHashInter=
> ceptor">
>      <s:property name=3D"hashAlgorithm" value=3D"MD5" />
>      </s:bean>
>      <authenticationInterceptor/>
>      <referralInterceptor/>
>      <aciAuthorizationInterceptor/>
>      <defaultAuthorizationInterceptor/>
>      <exceptionInterceptor/>
>      <operationalAttributeInterceptor/>
>      ...
>      </interceptors>
This has changed in 2.0. The configuration is now in the DIT, instead of 
being stored in a XML file.
>
> 3- In the documentation (ApacheDS Advanced User Guide v1.5.8-SNAPSHOT) I
> read information about triggers and store procedures. The information is
> incomplete, and I didnt understand well how to implement the triggers. In
> one part of the trigger section I found this:
>
> AFTER ADD CALL "Logger.logAddOperation"
> ($entry,$attributes,$operationPrincipal);
>
> or
>
> AFTER Delete CALL =93com.example.ldap.util.sp.BackupTools:backupDeletedEntr=
> y=94
> ( $ldapContext =93ou=3Dbackup,ou=3Dsystem=94, $name, $deletedEntry );
>
>      a- Where I should add the line in order to create the trigger? DO I
> have to add that line in one attribute? Which one and how?
>      b- Do I have to follow same steps like to build an interceptor in order
> to build the trigger?
>      c- Same with SPs?
> 4- Can you provide me a full detail document about triggeres or SPs (maybe
> an example or tutorial with the implementation). Perhaps new documentation.
> I know that there is a new version of APacheDS, but I couldnt find
> documentation for this version. In fact the documentation in the Apache
> page is not complete. So this is why I came to you guys:)
yeah, the doco is brittle... Again, this is an experimental feature... 
Any help welcomed !
>
> 5- While searching I found this two messages in (
> http://mail-archives.apache.org/mod_mbox/directory-users/201202.mbox/%3CCAD=wPi+HseKESYBhfJim1crHdsOxOv=
> 3DPQzJ9eHO8h2VwYcLe33w@mail.gmail.com%3E )
>      a- " You also write that stored procedures are currently highly
> experimental.  Does it mean that the code is partly there, but is not used?
> Are stored  procedures not implemented, yet, or is there another api that I
> can use? Thanks"
>      b- "SPs were in fact working a while back but heavy refactoring and
> changes in  the server broke the code. Before going forward on this feature
> we're  trying to erect a MVCC layer to handle internal local transactions
> properly  to maintain consistency and isolation across the changes induced
> by the  action of a SP. Furthermore we're redesigning the server to
> leverage OSGi  for plugability and this is will obviously impact how SPs
> are deployed.  These changes will take some time but it will be operational
> in a more robust, easy to use and dependable wail."
>
>    After reading this I have this doubt "SPs and Triggers are currently
> working or supported? or is going to be a feature in the next versions?
> What about ApacheDS 1.57 (this is the version that I am using.)??"
The tests were working a while back, and after some digging, I found 
that they have been ignored since 2008.

i'll check that an come back later with some clarification...
>
> 6- Do you know a better way to synchronize LDAP with an Orable DB in
> ApacheDS?.
Not easy, as I said :)

Although you can perfectly write your own interceptor that 'traps' the 
Add/Delete events, and send those informations back to the DB.

There is nothing like an updated doco here...
>
> 7- I know you told me that I should use persistent search to get the
> notifications, but as my point of view this will be an external solution,
> am I wrong?
yes. But this is a workaround :)

I may give a hand in the next few days, but I won't work full time on 
those (interesting issues).

feel free to ping me from time to time, I'm ak with that. Those parts 
have to work, anyway !

Tahnks for your patience !


-- 
Regards,
Cordialement,
Emmanuel Lécharny
www.iktek.com


Mime
View raw message