You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@directory.apache.org by GATTAZ Olivier <ol...@isandlatech.com> on 2015/06/19 13:48:21 UTC

ApacheDS 2.0-M20 used in an OSGi world : some questions

Bonjour,

Today I’m able to launch an Apache Directory Server embedded in an iPojo component instantiated in an Felix OSGi framework.

Many thanks to Yogesh.Bajaj@wyn.com :  my class is based on his sample "EmbeddedADS"

The lifecycle of the "CCpntEmbeddedADServer" instance is that of an iPojo component : it is validated (and initialized) when all the mandatory required services are injected and it is unvalidated when  at least on mandatory required service is going to be unregistered.

To reach this result, I had to embedded the "apacheds-service-2.0.0-M20.jar" artifact in my OSGi bundle and wrote the component factory Java class.

Note: I had to remove the log4j and the slf4j packages from the apacheds artifact because these tools are already available in the OSGi target platform that I use.

So all is perfect, but I have some misunderstandings :

How must I do to load programmatically  some schema extensions from an other ldif file ?
I stored my ldif file at side of the "config.ldif" one,  but the the method "SchemaManager:loadAllEnabled()"  loads only the "config.ldif" and not mine...
note: when my component is started I'm able to be connected to the LDAP sever using ApacheDS studio and I'm able to load my ldif file using the menu item "Import LDIF..." .

My second issue is : How must I do to create programmatically an admin account (uid=myAdmin) in the system partition ?
note: as for the previous issue, when my component is started I'm able to be connected to the LDAP sever using ApacheDS studio and I'm able to duplicate the uid:admin entry and change its password.

The source code of my class is here : http://gattaz.fr/things/CCpntEmbeddedADServer.java

Thanks a lot in advance

Olivier