You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@directory.apache.org by Juan Pablo Sotelo <ju...@gmail.com> on 2012/05/03 17:19:37 UTC

[ApacheDS] Trigger in ApacheDS

Hello everybody,

                          sorry for the insistent question, but I want to
know if this feature is real (I am talking about triggers), if this feature
is currently working on the latest version of apacheDS (I read in a forum
that is not, need confirmation)?. And if you can, give me some advices
about how to syncrhonize the apacheDS with a DB??

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?
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>

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:)

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.)??"

6- Do you know a better way to synchronize LDAP with an Orable DB in
ApacheDS?.

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?

Thanks in advance for your time

OLD Question - unanswered ---------------------------------

Re: [ApacheDS] Trigger in ApacheDS

Posted by Emmanuel Lécharny <el...@gmail.com>.
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


Re: [ApacheDS] Trigger in ApacheDS

Posted by Kiran Ayyagari <ka...@apache.org>.
On Thu, May 3, 2012 at 11:55 PM, Juan Pablo Sotelo <ju...@gmail.com> wrote:
> Thanks for the replies!.. Now everything is clear. Another question:
>
> How can I download the code? I saw in the old documentation that you had a
> svn repository. I tried the old one, and I couldnt get the code
> (http://svn.apache.org/repos/asf/directory/apacheds/trunk-with-dependencies/
this is the correct location and is configured with svn:externals, you
won't see anything
if you use a browser, do an svn checkout
> apacheds-trunk). Since the latest documentation is not ready in the webpage,
> How can I get the code? SVN? ZIP?
>
> Where can I get the latest documentation?
>
there is no such thing, yet :)
> Thanks again :)
>
>
> On Thu, May 3, 2012 at 1:11 PM, Kiran Ayyagari <ka...@apache.org> wrote:
>>
>> On Thu, May 3, 2012 at 8:49 PM, Juan Pablo Sotelo <ju...@gmail.com>
>> wrote:
>> > Hello everybody,
>> >
>> >                           sorry for the insistent question, but I want
>> > to
>> > know if this feature is real (I am talking about triggers), if this
>> > feature
>> > is currently working on the latest version of apacheDS (I read in a
>> > forum
>> > that is not, need confirmation)?. And if you can, give me some advices
>> > about
>> > how to syncrhonize the apacheDS with a DB??
>> >
>> > I really want to use ApacheDS on my company but I need to solve this
>> > "problem". I hope you give me a hand.
>> >
>> the only other better way that I can suggest is to write an implementation
>> of
>> DirectoryListener [1] and add it to DirectoryService by calling
>> dirService.getEventService().addListener().
>>
>> This way you get notified of all the event as soon as they happen
>> matching the provided criteria.
>>
>> Another issue after implementing this is to register this listener,
>> for that you can write a no-op interceptor
>> and use its init() method to register the listener.
>>
>> Another reason I suggest you to use the above said mechanism is
>> interceptors work in a blocking mode
>> where as event listeners process each change in a separate thread
>>
>> And finally, I would strongly suggest to use the latest milestone
>> version 2.0.0-M6, it is way better
>>
>> HTH
>>
>> [1]
>> http://svn.apache.org/repos/asf/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/event/DirectoryListener.java
>> > 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?
>> > 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>
>> >
>> > 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:)
>> >
>> > 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.)??"
>> >
>> > 6- Do you know a better way to synchronize LDAP with an Orable DB in
>> > ApacheDS?.
>> >
>> > 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?
>> >
>> > Thanks in advance for your time
>> >
>> > OLD Question - unanswered ---------------------------------
>>
>>
>>
>> --
>> Kiran Ayyagari
>
>
>
>
> --
> Sotelo Juan Pablo
>



-- 
Kiran Ayyagari

Re: [ApacheDS] Trigger in ApacheDS

Posted by Kiran Ayyagari <ka...@apache.org>.
If you want to skip running tests, run:

   mvn clean install -DskipTests

On Fri, May 4, 2012 at 9:21 PM, Juan Pablo Sotelo <ju...@gmail.com> wrote:
> Thanks for your replies (all of them), I already downloaded the code. I am
> trying to run "mvn clean install", but I am facing some troubles.
>
> I made some modifications to the Maven options, because at first I got
> "java.lang.OutOfMemoryError: PermGen space"
> ############################################################
> Maven is 3.0.3 and jdk1.6.0_24
>
> JAVA_OPTS  ---> -Xms512M -Xmx1024M -XX:MaxPermSize=512M
> MAVEN_OPTS   --->  -Xmx512m -XX:MaxPermSize=384m -Xms512M
> ############################################################
>
> The problem was solved with the previus configurations, but after a while of
> running the command:
>
> I am getting:
> -------------------------------------------------------
>  T E S T S
> -------------------------------------------------------
> Running org.apache.directory.shared.client.api.LdapApiISuite
>  NO cache entry for write 600000
>  NO cache entry for write 600000
>
> I saw in internet that the problem could be cause because of dead code? Do I
> have to remove the code in the following list before running the command?.
> Do I have to wait?
>
> https://builds.apache.org/job/dir-apacheds-jdk16-win/org.apache.directory.server$apacheds-server-integ/114/changes
>
>
>
>
>
> On Thu, May 3, 2012 at 6:42 PM, Emmanuel Lécharny <el...@gmail.com>
> wrote:
>>
>> Le 5/3/12 8:25 PM, Juan Pablo Sotelo a écrit :
>>
>>> Thanks for the replies!.. Now everything is clear. Another question:
>>>
>>> How can I download the code? I saw in the old documentation that you had
>>> a
>>> svn repository. I tried the old one, and I couldnt get the code (
>>>
>>> http://svn.apache.org/repos/asf/directory/apacheds/trunk-with-dependencies/apacheds-trunk).
>>> Since the latest documentation is not ready in the
>>> webpage, How can I get the code? SVN? ZIP?
>>
>> svn co
>> http://svn.apache.org/repos/asf/directory/apacheds/trunk-with-dependencies
>> should get you all the sources (we are using svn externals, so if you look
>> at this page on the web, you might think there is nothing in it, but
>> everything is hidden :)
>>
>>>
>>> Where can I get the latest documentation?
>>
>> Hmmm, well, hmmm... Unless you are a neurogolgist that can read on our
>> brains, the latest documentation is really seriously lagging...
>>
>> Sorry for that !
>>
>>
>>
>> --
>> Regards,
>> Cordialement,
>> Emmanuel Lécharny
>> www.iktek.com
>>
>
>
>
> --
> Sotelo Juan Pablo
>



-- 
Kiran Ayyagari

Re: [ApacheDS] Trigger in ApacheDS

Posted by Emmanuel Lécharny <el...@gmail.com>.
Le 5/9/12 7:52 PM, Juan Pablo Sotelo a écrit :
> Me again!! :(. Sorry to bother you guys so much!..
>
> Thanks Emmanual, I did that change in the POM file and run "mvn clean",
> then "mvn install" (I wanted to try test too, so I can give you more
> details). But now I have a problem in:
>
> [INFO] ApacheDS Password Hashing Interceptor ............. SUCCESS [2.125s]
> [INFO] ApacheDS Core Integration ......................... SUCCESS
> [6:39.390s]
> [INFO] ApacheDS Server Integration ....................... FAILURE
> [15:11.704s]
> [INFO] ApacheDS DirectoryService-WebApp bridge ........... SKIPPED
> [INFO] ApacheDS Jetty HTTP Server Integration ............ SKIPPED
>
> surefire-reports are all empty except one,
> "TEST-org.apache.directory.server.replication.ClientServerReplicationIT.xml",
> but I couldnt find any information about the error in this file. The other
> two files are "org.apache.directory.server.suites.StockServerISuite.txt"
> and "org.apache.directory.server.replication.ClientServerReplicationIT.txt".
>
> Any solution??
Here, you will have to run the test again :
mvn clean install -Dintegration -rf apacheds/server-integ

We have an issue in the server that makes the tests failing randomly 
(50% of the time).

We are currently chasing it.


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


Re: [ApacheDS] Trigger in ApacheDS

Posted by Juan Pablo Sotelo <ju...@gmail.com>.
Me again!! :(. Sorry to bother you guys so much!..

Thanks Emmanual, I did that change in the POM file and run "mvn clean",
then "mvn install" (I wanted to try test too, so I can give you more
details). But now I have a problem in:

[INFO] ApacheDS Password Hashing Interceptor ............. SUCCESS [2.125s]
[INFO] ApacheDS Core Integration ......................... SUCCESS
[6:39.390s]
[INFO] ApacheDS Server Integration ....................... FAILURE
[15:11.704s]
[INFO] ApacheDS DirectoryService-WebApp bridge ........... SKIPPED
[INFO] ApacheDS Jetty HTTP Server Integration ............ SKIPPED

surefire-reports are all empty except one,
"TEST-org.apache.directory.server.replication.ClientServerReplicationIT.xml",
but I couldnt find any information about the error in this file. The other
two files are "org.apache.directory.server.suites.StockServerISuite.txt"
and "org.apache.directory.server.replication.ClientServerReplicationIT.txt".

Any solution??

Thanks for everything!

Re: [ApacheDS] Trigger in ApacheDS

Posted by Emmanuel Lécharny <el...@gmail.com>.
Le 5/9/12 4:55 PM, Juan Pablo Sotelo a écrit :
> Sure, Well I have downloaded a fresh copy of apacheDS from (
> http://svn.apache.org/repos/asf/directory/apacheds/trunk-with-dependencies/
> ).
>
> Then I ran "mvn clean install".
>
> And I dont have folder "target" in "Core Api" so I dont have the surefiles.
> Sorry.
np.

We have just released shared-1.0.0-M12, so the apacheds trunk might 
refer to some not existing jar. That might give you some failure.

The maven repositery will take a bit of time to be refeshed, so either 
you try again 1), or you change one single line in apacheds/trunks/ (2)

(1) run :
mvn clean install -DskipTests

so that the tests aren't executed (faster)

(2) Line 47 in apacheds/pom.xml, change
<org.apache.directory.shared.version>1.0.0-M12</org.apache.directory.shared.version>
to
<org.apache.directory.shared.version>1.0.0-M12-SNAPSHOT</org.apache.directory.shared.version>



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


Re: [ApacheDS] Trigger in ApacheDS

Posted by Juan Pablo Sotelo <ju...@gmail.com>.
Sure, Well I have downloaded a fresh copy of apacheDS from (
http://svn.apache.org/repos/asf/directory/apacheds/trunk-with-dependencies/
).

Then I ran "mvn clean install".

And I dont have folder "target" in "Core Api" so I dont have the surefiles.
Sorry.

Regards.

Re: [ApacheDS] Trigger in ApacheDS

Posted by Emmanuel Lécharny <el...@gmail.com>.
Le 5/9/12 4:32 PM, Juan Pablo Sotelo a écrit :
> [INFO] ApacheDS Core API ................................. FAILURE [0.078s]
Can you tell us what you checked out, and what did you ran ?

Also you should have some surefire text files containing the failing 
tests, that would be good to provide the one that fails.

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


Re: [ApacheDS] Trigger in ApacheDS

Posted by Juan Pablo Sotelo <ju...@gmail.com>.
hello everybody. I am back. I wanted to try agaim to build the code. I have
updated all the code and then tried again. Now is failing in a different
part (not in the test)

[INFO] ApacheDS .......................................... SUCCESS [0.093s]
[INFO] ApacheDS I18n ..................................... SUCCESS [2.703s]
[INFO] ApacheDS Core Constants ........................... SUCCESS [1.204s]
[INFO] ApacheDS Core API ................................. FAILURE [0.078s]
[INFO] ApacheDS Core Shared .............................. SKIPPED
[INFO] ApacheDS Interceptors ............................. SKIPPED

Why is failing, Any solution to this?

Regards

Re: [ApacheDS] Trigger in ApacheDS

Posted by Emmanuel Lécharny <el...@gmail.com>.
Le 5/4/12 8:58 PM, Juan Pablo Sotelo a écrit :
> Thanks for the replies.. I waited until I got this (maybe is usefull for
> you)
>
> After this I run the command again with "mvn clean install -DskipTests" and
> everything is good now. (I also tried mvn clean install -rf
> apacheds/ldap-client-test)

Skipping tests will always be successful :)
>
> In the manual I see this steps in order to build the installers:
> 1- cd apacheds-trunk
> 2- mvn install
> 3- cd installers/apacheds
> 4- mvn -Pserver-installer install
The command is :

mvn clean install -Pinstallers


It should work and generate the installers for your platform.

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


Re: [ApacheDS] Trigger in ApacheDS

Posted by Juan Pablo Sotelo <ju...@gmail.com>.
Thanks for the replies.. I waited until I got this (maybe is usefull for
you)

################## LOG ########################################
...
[INFO] Surefire report directory:
C:\work\ApacheDs\apacheds\ldap-client-test\target\surefire-reports

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running org.apache.directory.shared.client.api.LdapApiISuite
 NO cache entry for write 600000
 NO cache entry for write 600000
 NO cache entry for write 600000
 NO cache entry for write 600000
 NO cache entry for write 600000
 NO cache entry for write 600000
 NO cache entry for write 600000
 NO cache entry for write 600000
 NO cache entry for write 600000
 NO cache entry for write 600000
 NO cache entry for write 600000
 NO cache entry for write 600000
 NO cache entry for write 600000
 NO cache entry for write 600000
Tests run: 41, Failures: 3, Errors: 17, Skipped: 1, Time elapsed: 8,502.859
sec <<< FAILURE!

Results :

Failed tests:
testCancelSearch(org.apache.directory.shared.client.api.operations.ClientAbandonRequestTest):
expected:<100> but was:<-1>

testAddAsync(org.apache.directory.shared.client.api.operations.ClientAddRequestTest)

testAddAsyncLdif(org.apache.directory.shared.client.api.operations.ClientAddRequestTest)

Tests in error:
  org.apache.directory.shared.client.api.operations.ClientAbandonRequestTest

testAbandonSearch(org.apache.directory.shared.client.api.operations.ClientAbandonRequestTest):
ENTRY_ALREADY_EXISTS: failed for MessageType : ADD_REQUEST(..)

org.apache.directory.shared.client.api.operations.ClientAbandonRequestTest:
java.io.IOException

testAdd(org.apache.directory.shared.client.api.operations.ClientAddRequestTest):
The response queue has been emptied, no response was found.

testAddLdif(org.apache.directory.shared.client.api.operations.ClientAddRequestTest):
The response queue has been emptied, no response was found.

testAddWithControl(org.apache.directory.shared.client.api.operations.ClientAddRequestTest):
The response queue has been emptied, no response was found.
  org.apache.directory.shared.client.api.operations.ClientAddRequestTest:
java.io.IOException

testAddEntryWithRdnContainingEscapedChars(org.apache.directory.shared.client.api.operations.ClientAddRequestTest):
The response queue has been emptied, no response was found.

testAddEntryWithRdnContainingEscapedCharsExistingnEntry(org.apache.directory.shared.client.api.operations.ClientAddRequestTest):
The response queue has been emptied, no response was found.

testAddEntryWithRdnContainingEscapedCharsMultiValued(org.apache.directory.shared.client.api.operations.ClientAddRequestTest):
The response queue has been emptied, no response was found.

testPreserveRdnUpName(org.apache.directory.shared.client.api.operations.ClientAddRequestTest):
The response queue has been emptied, no response was found.

org.apache.directory.shared.client.api.operations.ClientDeleteRequestTest:
java.io.IOException

org.apache.directory.shared.client.api.operations.ClientModifyDnRequestTest:
java.io.IOException

org.apache.directory.shared.client.api.operations.ClientModifyRequestTest:
java.io.IOException

org.apache.directory.shared.client.api.operations.bind.SimpleBindRequestTest:
java.io.IOException

org.apache.directory.shared.client.api.operations.search.ClientSearchRequestTest:
java.io.IOException

org.apache.directory.shared.client.api.operations.search.SearchRequestReturningAttributesTest:
java.io.IOException

Tests run: 41, Failures: 3, Errors: 17, Skipped: 1

[INFO]
------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Apache Directory Project .......................... SUCCESS [1.344s]
[INFO] Apache Directory Checkstyle Configuration ......... SUCCESS [1.250s]
[INFO] Apache Directory JUnit Add-ons .................... SUCCESS [2.312s]
[INFO] Apache Directory Shared ........................... SUCCESS [0.313s]
[INFO] Apache Directory Shared I18n ...................... SUCCESS [2.015s]
[INFO] Apache Directory Shared Utilities ................. SUCCESS [6.985s]
[INFO] Apache Directory Shared ASN.1 Parent .............. SUCCESS [0.656s]
[INFO] Apache Directory Shared ASN.1 API ................. SUCCESS [3.390s]
[INFO] Apache Directory Shared ASN.1 BER ................. SUCCESS [4.563s]
[INFO] Apache Directory Shared LDAP Parent ............... SUCCESS [0.109s]
[INFO] Apache Directory Shared LDAP Model ................ SUCCESS [40.297s]
[INFO] Apache Directory Shared LDAP Codec Parent ......... SUCCESS [0.156s]
[INFO] Apache Directory Shared LDAP Codec ................ SUCCESS [15.016s]
[INFO] Apache Directory Shared LDAP Net Parent ........... SUCCESS [0.188s]
[INFO] Apache Directory Shared LDAP Network MINA ......... SUCCESS [2.843s]
[INFO] Apache Directory Shared LDAP Codec Standalone ..... SUCCESS [2.282s]
[INFO] Apache Directory Shared DSML Parent ............... SUCCESS [0.421s]
[INFO] Apache Directory Shared DSML Parser ............... SUCCESS [17.032s]
[INFO] Apache Directory Shared LDAP Extras ............... SUCCESS [0.140s]
[INFO] Apache Directory Shared LDAP Extras ACI ........... SUCCESS [6.219s]
[INFO] Apache Directory Shared LDAP Schema Parent ........ SUCCESS [0.141s]
[INFO] Apache Directory Shared LDAP Schema ............... SUCCESS
[1:15.890s]
[INFO] Apache Directory Shared LDAP Client Parent ........ SUCCESS [0.203s]
[INFO] Apache Directory Shared LDAP Client API ........... SUCCESS [3.422s]
[INFO] Apache Directory Shared DSML Engine ............... SUCCESS [2.719s]
[INFO] Apache Directory Shared LDAP Extras Codec API ..... SUCCESS [2.422s]
[INFO] Apache Directory Shared LDAP Extras Codec ......... SUCCESS [6.266s]
[INFO] Apache Directory Shared LDAP Extras Util .......... SUCCESS [3.812s]
[INFO] Apache Directory Shared LDAP Extras Stored Procedures  SUCCESS
[1.844s]
[INFO] Apache Directory Shared LDAP Extras Trigger ....... SUCCESS [4.547s]
[INFO] Apache Directory Shared LDAP Schema Converter ..... SUCCESS [4.953s]
[INFO] Apache Directory Shared All ....................... SUCCESS [6.765s]
[INFO] Apache Directory Shared LDAP Client All ........... SUCCESS [7.422s]
[INFO] Apache Directory Shared Integration Tests ......... SUCCESS [16.032s]
[INFO] Apache Directory LDAP API Distribution ............ SUCCESS [0.171s]
[INFO] ApacheDS .......................................... SUCCESS [0.219s]
[INFO] ApacheDS I18n ..................................... SUCCESS [3.094s]
[INFO] ApacheDS Core Constants ........................... SUCCESS [1.375s]
[INFO] ApacheDS Core API ................................. SUCCESS [21.094s]
[INFO] ApacheDS Core Shared .............................. SUCCESS [3.093s]
[INFO] ApacheDS Interceptors ............................. SUCCESS [0.344s]
[INFO] ApacheDS AdministrativePoint Interceptor .......... SUCCESS [3.688s]
[INFO] ApacheDS Authentication Interceptor ............... SUCCESS [13.156s]
[INFO] ApacheDS Authorization Interceptor ................ SUCCESS [34.641s]
[INFO] ApacheDS ChangeLog Interceptor .................... SUCCESS [11.078s]
[INFO] ApacheDS Collective Attribute Interceptor ......... SUCCESS [3.453s]
[INFO] ApacheDS Event Interceptor ........................ SUCCESS [2.500s]
[INFO] ApacheDS Exception Interceptor .................... SUCCESS [3.484s]
[INFO] ApacheDS Journal Interceptor ...................... SUCCESS [2.485s]
[INFO] ApacheDS Normalization Interceptor ................ SUCCESS [12.406s]
[INFO] ApacheDS Operational Attribute Interceptor ........ SUCCESS [2.484s]
[INFO] ApacheDS Referral Interceptor ..................... SUCCESS [3.844s]
[INFO] ApacheDS Schema Interceptor ....................... SUCCESS [37.141s]
[INFO] ApacheDS Subtree Interceptor ...................... SUCCESS [37.468s]
[INFO] ApacheDS Triggers Interceptor ..................... SUCCESS [3.407s]
[INFO] ApacheDS Core ..................................... SUCCESS [8.718s]
[INFO] ApacheDS Core AVL ................................. SUCCESS [18.922s]
[INFO] ApacheDS Generalized (X) DBM Partition ............ SUCCESS [25.110s]
[INFO] ApacheDS LDIF Partition ........................... SUCCESS [10.296s]
[INFO] ApacheDS JDBM Partition ........................... SUCCESS [36.282s]
[INFO] ApacheDS Core Annotations ......................... SUCCESS [27.156s]
[INFO] ApacheDS Core JNDI ................................ SUCCESS [6.891s]
[INFO] ApacheDS Protocol Shared .......................... SUCCESS [4.359s]
[INFO] ApacheDS Protocol Kerberos Codec .................. SUCCESS [40.922s]
[INFO] ApacheDS Interceptors for Kerberos ................ SUCCESS [4.047s]
[INFO] ApacheDS Protocol Dhcp ............................ SUCCESS [6.875s]
[INFO] ApacheDS Protocol Dns ............................. SUCCESS [8.265s]
[INFO] ApacheDS Protocol Kerberos ........................ SUCCESS [8.578s]
[INFO] ApacheDS Protocol Ldap ............................ SUCCESS [29.344s]
[INFO] ApacheDS Protocol Ntp ............................. SUCCESS [5.547s]
[INFO] Apacheds Server Annotations ....................... SUCCESS [25.438s]
[INFO] ApacheDS Server Config ............................ SUCCESS [27.859s]
[INFO] ApacheDS Server JNDI .............................. SUCCESS [5.672s]
[INFO] ApacheDS Server Replication Service ............... SUCCESS [1.187s]
[INFO] ApacheDS Test Framework ........................... SUCCESS
[1:22.094s]
[INFO] ApacheDS Generalized (X) DBM Tools ................ SUCCESS [7.031s]
[INFO] ApacheDS All ...................................... SUCCESS [12.547s]
[INFO] ApacheDS Logger Interceptor ....................... SUCCESS [3.813s]
[INFO] ApacheDS Password Hashing Interceptor ............. SUCCESS [2.531s]
[INFO] ApacheDS Core Integration ......................... SUCCESS
[8:40.625s]
[INFO] ApacheDS Server Integration ....................... SUCCESS
[4:13.234s]
[INFO] ApacheDS DirectoryService-WebApp bridge ........... SUCCESS [1.985s]
[INFO] ApacheDS Jetty HTTP Server Integration ............ SUCCESS [19.609s]
[INFO] ApacheDS Service Builder .......................... SUCCESS [3.688s]
[INFO] ApacheDS Protocol Kerberos Test ................... SUCCESS [18.281s]
[INFO] Apache Directory LDAP Client API test ............. FAILURE
[2:21:48.531s]
[INFO] ApacheDS Service .................................. SKIPPED
[INFO] ApacheDS Wrapper .................................. SKIPPED
[INFO] ApacheDS Installers Maven Plugin .................. SKIPPED
[INFO] ApacheDS Installers ............................... SKIPPED
[INFO] ApacheDS Manuals .................................. SKIPPED
[INFO] ApacheDS Build With Dependencies .................. SKIPPED
[INFO]
------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 2:49:42.391s
[INFO] Finished at: Fri May 04 14:45:55 GFT 2012
[INFO] Final Memory: 88M/494M
[INFO]
------------------------------------------------------------------------
[ERROR] Failed to execute goal
org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on
project ldap-client-test: There are test failures.
[ERROR]
[ERROR] Please refer to
C:\work\ApacheDs\apacheds\ldap-client-test\target\surefire-reports for the
individual test results.
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e
switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions,
please read the following articles:
[ERROR] [Help 1]
http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the
command
[ERROR]   mvn <goals> -rf :ldap-client-test
C:\work\ApacheDs>mvn clean install -DskipTests
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model
for
org.apache.directory.buildtools:checkstyle-configuration:jar:0.2-SNAPSHOT
[WARNING] 'parent.relativePath' points at
org.apache.directory.server:apacheds-with-dependencies instead of
org.apache.directory.project:project, please verify your project structure
@ line 24, column 11
[WARNING]
[WARNING] It is highly recommended to fix these problems because they
threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support
building such malformed projects.
[WARNING]
[INFO]
------------------------------------------------------------------------
###############################################################

After this I run the command again with "mvn clean install -DskipTests" and
everything is good now. (I also tried mvn clean install -rf
apacheds/ldap-client-test)

In the manual I see this steps in order to build the installers:
1- cd apacheds-trunk
2- mvn install
3- cd installers/apacheds
4- mvn -Pserver-installer install

What I did:
1- Since I already executed "mvn clean install -rf
apacheds/ldap-client-test", I will not execute mvn install, right?
2- then cd apacheds\installers
3- mvn -Pserver-installer install

And:

################## LOG ########################################
C:\work\ApacheDs\apacheds\installers>mvn -Pserver-installer install
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model
for org.apache.directory.server:apacheds-installers:pom:2.0.0-M7-SNAPSHOT
[WARNING] 'parent.relativePath' of POM
org.apache.directory.server:apacheds-parent:2.0.0-M7-SNAPSHOT
(C:\work\ApacheDs\apacheds\pom.xml) points at
org.apache.directory.server:apacheds-with-dependencies instead of
org.apache.directory.project:project, please verify your project structure
@ org.apache.directory.server:apacheds-parent:2.0.0-M7-SNAPSHOT,
C:\work\ApacheDs\apacheds\pom.xml, line 24, column 11
[WARNING]
[WARNING] It is highly recommended to fix these problems because they
threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support
building such malformed projects.
[WARNING]
[INFO]
[INFO]
------------------------------------------------------------------------
[INFO] Building ApacheDS Installers 2.0.0-M7-SNAPSHOT
[INFO]
------------------------------------------------------------------------
[INFO]
[INFO] --- maven-remote-resources-plugin:1.2.1:process (default) @
apacheds-installers ---
[INFO]
[INFO] --- maven-site-plugin:3.0:attach-descriptor (attach-descriptor) @
apacheds-installers ---
[INFO]
[INFO] --- tools-maven-plugin:1.4:verify-legal-files (verify-legal-files) @
apacheds-installers ---
[INFO]
[INFO] --- maven-install-plugin:2.3.1:install (default-install) @
apacheds-installers ---
[INFO] Installing C:\work\ApacheDs\apacheds\installers\pom.xml to
C:\Documents and
Settings\Juano\.m2\repository\org\apache\directory\server\apacheds-installers\2.0.0-M7-SNAPSHOT\apacheds-installers-2.0.0-M7-SNAPSHOT.pom
[INFO] Installing
C:\work\ApacheDs\apacheds\installers\target\apacheds-installers-2.0.0-M7-SNAPSHOT-site.xml
to C:\Documents and
Settings\Juano\.m2\repository\org\apache\directory\server\apacheds-installers\2.0.0-M7-SNAPSHOT\apacheds-installers-2.0.0-M7-SNAPSHOT-site.xml
[INFO]
------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 2.609s
[INFO] Finished at: Fri May 04 15:44:14 GFT 2012
[INFO] Final Memory: 11M/494M
[INFO]
------------------------------------------------------------------------
[WARNING] The requested profile "server-installer" could not be activated
because it does not exist.
###############################################################

Not sure what is wrong? I have checked the pom.xml (I didnt modifications
in any file.) but I am not sure if this is the problem? does anybody had
the same problem?

I will write a document about all the step that I made, detailed.. In case
another person had the same problem.

Thanks for your help and patience.

Re: [ApacheDS] Trigger in ApacheDS

Posted by Emmanuel Lécharny <el...@gmail.com>.
Le 5/4/12 5:51 PM, Juan Pablo Sotelo a écrit :
> Thanks for your replies (all of them), I already downloaded the code. I am
> trying to run "mvn clean install", but I am facing some troubles.
>
> I made some modifications to the Maven options, because at first I got
> "java.lang.OutOfMemoryError: PermGen space"
> ############################################################
> Maven is 3.0.3 and jdk1.6.0_24
>
> JAVA_OPTS  --->  -Xms512M -Xmx1024M -XX:MaxPermSize=512M
> MAVEN_OPTS   --->   -Xmx512m -XX:MaxPermSize=384m -Xms512M
> ############################################################
>
> The problem was solved with the previus configurations, but after a while
> of running the command:
>
> I am getting:
> -------------------------------------------------------
>   T E S T S
> -------------------------------------------------------
> Running org.apache.directory.shared.client.api.LdapApiISuite
>   NO cache entry for write 600000
>   NO cache entry for write 600000
>
> I saw in internet that the problem could be cause because of dead code? Do
> I have to remove the code in the following list before running the
> command?. Do I have to wait?
No, this is an issue we have from time to time, probably because tests 
are run in parallel.

Just restart the build using :

mvn clean install -rf apacheds/ldap-client-test

tests should pass


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


Re: [ApacheDS] Trigger in ApacheDS

Posted by Juan Pablo Sotelo <ju...@gmail.com>.
Thanks for your replies (all of them), I already downloaded the code. I am
trying to run "mvn clean install", but I am facing some troubles.

I made some modifications to the Maven options, because at first I got
"java.lang.OutOfMemoryError: PermGen space"
############################################################
Maven is 3.0.3 and jdk1.6.0_24

JAVA_OPTS  ---> -Xms512M -Xmx1024M -XX:MaxPermSize=512M
MAVEN_OPTS   --->  -Xmx512m -XX:MaxPermSize=384m -Xms512M
############################################################

The problem was solved with the previus configurations, but after a while
of running the command:

I am getting:
-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running org.apache.directory.shared.client.api.LdapApiISuite
 NO cache entry for write 600000
 NO cache entry for write 600000

I saw in internet that the problem could be cause because of dead code? Do
I have to remove the code in the following list before running the
command?. Do I have to wait?

https://builds.apache.org/job/dir-apacheds-jdk16-win/org.apache.directory.server$apacheds-server-integ/114/changes




On Thu, May 3, 2012 at 6:42 PM, Emmanuel Lécharny <el...@gmail.com>wrote:

> Le 5/3/12 8:25 PM, Juan Pablo Sotelo a écrit :
>
>  Thanks for the replies!.. Now everything is clear. Another question:
>>
>> How can I download the code? I saw in the old documentation that you had a
>> svn repository. I tried the old one, and I couldnt get the code (
>> http://svn.apache.org/repos/**asf/directory/apacheds/trunk-**
>> with-dependencies/apacheds-**trunk<http://svn.apache.org/repos/asf/directory/apacheds/trunk-with-dependencies/apacheds-trunk>
>> ).
>> Since the latest documentation is not ready in the
>> webpage, How can I get the code? SVN? ZIP?
>>
> svn co http://svn.apache.org/repos/**asf/directory/apacheds/trunk-**
> with-dependencies<http://svn.apache.org/repos/asf/directory/apacheds/trunk-with-dependencies>should get you all the sources (we are using svn externals, so if you look
> at this page on the web, you might think there is nothing in it, but
> everything is hidden :)
>
>
>> Where can I get the latest documentation?
>>
> Hmmm, well, hmmm... Unless you are a neurogolgist that can read on our
> brains, the latest documentation is really seriously lagging...
>
> Sorry for that !
>
>
>
> --
> Regards,
> Cordialement,
> Emmanuel Lécharny
> www.iktek.com
>
>


-- 
Sotelo Juan Pablo

Re: [ApacheDS] Trigger in ApacheDS

Posted by Emmanuel Lécharny <el...@gmail.com>.
Le 5/3/12 8:25 PM, Juan Pablo Sotelo a écrit :
> Thanks for the replies!.. Now everything is clear. Another question:
>
> How can I download the code? I saw in the old documentation that you had a
> svn repository. I tried the old one, and I couldnt get the code (
> http://svn.apache.org/repos/asf/directory/apacheds/trunk-with-dependencies/apacheds-trunk).
> Since the latest documentation is not ready in the
> webpage, How can I get the code? SVN? ZIP?
svn co 
http://svn.apache.org/repos/asf/directory/apacheds/trunk-with-dependencies 
should get you all the sources (we are using svn externals, so if you 
look at this page on the web, you might think there is nothing in it, 
but everything is hidden :)
>
> Where can I get the latest documentation?
Hmmm, well, hmmm... Unless you are a neurogolgist that can read on our 
brains, the latest documentation is really seriously lagging...

Sorry for that !


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


Re: [ApacheDS] Trigger in ApacheDS

Posted by Juan Pablo Sotelo <ju...@gmail.com>.
Thanks for the replies!.. Now everything is clear. Another question:

How can I download the code? I saw in the old documentation that you had a
svn repository. I tried the old one, and I couldnt get the code (
http://svn.apache.org/repos/asf/directory/apacheds/trunk-with-dependencies/apacheds-trunk).
Since the latest documentation is not ready in the
webpage, How can I get the code? SVN? ZIP?

Where can I get the latest documentation?

Thanks again :)

On Thu, May 3, 2012 at 1:11 PM, Kiran Ayyagari <ka...@apache.org> wrote:

> On Thu, May 3, 2012 at 8:49 PM, Juan Pablo Sotelo <ju...@gmail.com>
> wrote:
> > Hello everybody,
> >
> >                           sorry for the insistent question, but I want to
> > know if this feature is real (I am talking about triggers), if this
> feature
> > is currently working on the latest version of apacheDS (I read in a forum
> > that is not, need confirmation)?. And if you can, give me some advices
> about
> > how to syncrhonize the apacheDS with a DB??
> >
> > I really want to use ApacheDS on my company but I need to solve this
> > "problem". I hope you give me a hand.
> >
> the only other better way that I can suggest is to write an implementation
> of
> DirectoryListener [1] and add it to DirectoryService by calling
> dirService.getEventService().addListener().
>
> This way you get notified of all the event as soon as they happen
> matching the provided criteria.
>
> Another issue after implementing this is to register this listener,
> for that you can write a no-op interceptor
> and use its init() method to register the listener.
>
> Another reason I suggest you to use the above said mechanism is
> interceptors work in a blocking mode
> where as event listeners process each change in a separate thread
>
> And finally, I would strongly suggest to use the latest milestone
> version 2.0.0-M6, it is way better
>
> HTH
>
> [1]
> http://svn.apache.org/repos/asf/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/event/DirectoryListener.java
> > 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?
> > 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>
> >
> > 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:)
> >
> > 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.)??"
> >
> > 6- Do you know a better way to synchronize LDAP with an Orable DB in
> > ApacheDS?.
> >
> > 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?
> >
> > Thanks in advance for your time
> >
> > OLD Question - unanswered ---------------------------------
>
>
>
> --
> Kiran Ayyagari
>



-- 
Sotelo Juan Pablo

Re: [ApacheDS] Trigger in ApacheDS

Posted by Kiran Ayyagari <ka...@apache.org>.
On Thu, May 3, 2012 at 8:49 PM, Juan Pablo Sotelo <ju...@gmail.com> wrote:
> Hello everybody,
>
>                           sorry for the insistent question, but I want to
> know if this feature is real (I am talking about triggers), if this feature
> is currently working on the latest version of apacheDS (I read in a forum
> that is not, need confirmation)?. And if you can, give me some advices about
> how to syncrhonize the apacheDS with a DB??
>
> I really want to use ApacheDS on my company but I need to solve this
> "problem". I hope you give me a hand.
>
the only other better way that I can suggest is to write an implementation of
DirectoryListener [1] and add it to DirectoryService by calling
dirService.getEventService().addListener().

This way you get notified of all the event as soon as they happen
matching the provided criteria.

Another issue after implementing this is to register this listener,
for that you can write a no-op interceptor
and use its init() method to register the listener.

Another reason I suggest you to use the above said mechanism is
interceptors work in a blocking mode
where as event listeners process each change in a separate thread

And finally, I would strongly suggest to use the latest milestone
version 2.0.0-M6, it is way better

HTH

[1] http://svn.apache.org/repos/asf/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/event/DirectoryListener.java
> 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?
> 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>
>
> 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:)
>
> 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.)??"
>
> 6- Do you know a better way to synchronize LDAP with an Orable DB in
> ApacheDS?.
>
> 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?
>
> Thanks in advance for your time
>
> OLD Question - unanswered ---------------------------------



-- 
Kiran Ayyagari