You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@directory.apache.org by Richard Evans <ri...@datanomic.com> on 2011/05/19 12:35:12 UTC

Embedding trunk ApacheDS

Hi

I'm looking at embedding ApacheDS in our application (a webapp running in tomcat or other app servers).  I started looking at the 1.5.7 release and got an implementation going using a Spring XML file for configuration.  I've moved to the trunk version now because I want to get some bug fixes.

The new approach is to configure ApacheDS using an LDIF file in the instance folder.  I see how to edit this to configure interceptors, etc, but I'd like to inject some of the configuration externally - for example the ports used for LDAP and LDAPS and the location of the working directory.  We set items like this in a properties file for our application; with Spring-based configuration I can use property place holders to use these values, as in:

   <property name="transports">
      <list>
        <bean class="org.apache.directory.server.protocol.shared.transport.TcpTransport" p:address="0.0.0.0"   p:port="${apacheds.ldapport}" p:nbThreads="8" p:backLog="50" p:enableSSL="false"/>
        <bean class="org.apache.directory.server.protocol.shared.transport.TcpTransport" p:address="localhost" p:port="${apacheds.ldapsport}" p:enableSSL="true"/>
      </list>
    </property>

Is there a similar recommended approach for use with the LDIF-based configuration?

Thanks

Richard 

Re: Embedding trunk ApacheDS

Posted by Kiran Ayyagari <ka...@apache.org>.
On Thu, May 19, 2011 at 4:05 PM, Richard Evans
<ri...@datanomic.com> wrote:
> Hi
>
> I'm looking at embedding ApacheDS in our application (a webapp running in tomcat or other app servers).  I started looking at the 1.5.7 release and got an implementation going using a Spring XML file for configuration.  I've moved to the trunk version now because I want to get some bug fixes.
>
> The new approach is to configure ApacheDS using an LDIF file in the instance folder.  I see how to edit this to configure interceptors, etc, but I'd like to inject some of the configuration externally - for example the ports used for LDAP and LDAPS and the location of the working directory.  We set items like this in a properties file for our application; with Spring-based configuration I can use property place holders to use these values, as in:
>
>   <property name="transports">
>      <list>
>        <bean class="org.apache.directory.server.protocol.shared.transport.TcpTransport" p:address="0.0.0.0"   p:port="${apacheds.ldapport}" p:nbThreads="8" p:backLog="50" p:enableSSL="false"/>
>        <bean class="org.apache.directory.server.protocol.shared.transport.TcpTransport" p:address="localhost" p:port="${apacheds.ldapsport}" p:enableSSL="true"/>
>      </list>
>    </property>
>
> Is there a similar recommended approach for use with the LDIF-based configuration?
In a truly embedded mode, we need not depend on the ldif
configuration, cause the app is responsible for configuring and
starting the
server (or just the DirectoryService). (note that in this case the
ou=config partition won't be available for editing externally)

And to achieve a similar configuration like above use the various
XXXBean (e.x DirectoryServiceBean) classes present in
server-config module.
You can configure them in your spring file and then use ServiceBuilder
to create the respective service/server instances
based on these configuration beans.

HTH

-- 
Kiran Ayyagari