You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@directory.apache.org by Pinczel Balázs <pi...@gmail.com> on 2013/07/24 13:16:21 UTC

[ApacheDS] How can I use my own partition implementation in ApacheDS 2.0?

Hi,

I am currently using a custom Partition implementation with ApacheDS 1.5.5,
where configuration is XML-based. I would like to switch to the latest
version, but I have problems with configuring the server to use my Partition
implementation. (I do realize that the Partition interface slightly differs,
that's not the source of my problem.)

With 1.5.5, all I have to do is place my implementation on the classpath,
and add a few lines under the <partitions> part in config.xml, like this
 <s:bean id="mypartition" class="fully.qualified.name.of.MyPartition"> ...
</s:bean>

However, I found that I can't do the same with the LDIF-based configuration
of 2.0.0.

A solution I found requires altering the source code for ApacheDS 2.0.0:
looks like I should add a createMyPartition() method to
org.apache.directory.server.config.builder.ServiceBuilder, similar to
createJdbmPartition(), and call it at the appropriate places, like the else
branch of the if in createPartition(DirectoryService, PartitionBean). (And
also, some other work ensuring that my configuration information gets read
from the LDIF and passed to this createPartition() function as an instance
of some class, like MyPartitionBean).

I am unsure about this solution, as the previous version I used (1.5.5)
required no recompiling of the server source code to achieve the same
purpose, and I hoped a similar configuration method would be available here.
It seems weird to me that the ability to easily configure and use custom
Partition implementations is taken away in the new version (it's like the
choice of JdbmPartition is hard-coded into ServiceBuilder, when it only
checks for instances of JdbmPartitionBean).

I would be grateful, if you could help me by answering my questions:
 - Is the solution I outlined above correct?
 - Are there any other options to use a custom Partition implementation
(preferably without changing the source)?

Thanks in advance,

Balázs


Re: [ApacheDS] How can I use my own partition implementation in ApacheDS 2.0?

Posted by Pinczel Balázs <pi...@gmail.com>.
Hi!

Sorry for taking up your time, but do you guys have any thoughts on this
one?

Balázs


2013/7/24 Pinczel Balázs <pi...@gmail.com>

> Hi,
>
> I am currently using a custom Partition implementation with ApacheDS 1.5.5,
> where configuration is XML-based. I would like to switch to the latest
> version, but I have problems with configuring the server to use my
> Partition
> implementation. (I do realize that the Partition interface slightly
> differs,
> that's not the source of my problem.)
>
> With 1.5.5, all I have to do is place my implementation on the classpath,
> and add a few lines under the <partitions> part in config.xml, like this
>  <s:bean id="mypartition" class="fully.qualified.name.of.MyPartition"> ...
> </s:bean>
>
> However, I found that I can't do the same with the LDIF-based configuration
> of 2.0.0.
>
> A solution I found requires altering the source code for ApacheDS 2.0.0:
> looks like I should add a createMyPartition() method to
> org.apache.directory.server.config.builder.ServiceBuilder, similar to
> createJdbmPartition(), and call it at the appropriate places, like the else
> branch of the if in createPartition(DirectoryService, PartitionBean). (And
> also, some other work ensuring that my configuration information gets read
> from the LDIF and passed to this createPartition() function as an instance
> of some class, like MyPartitionBean).
>
> I am unsure about this solution, as the previous version I used (1.5.5)
> required no recompiling of the server source code to achieve the same
> purpose, and I hoped a similar configuration method would be available
> here.
> It seems weird to me that the ability to easily configure and use custom
> Partition implementations is taken away in the new version (it's like the
> choice of JdbmPartition is hard-coded into ServiceBuilder, when it only
> checks for instances of JdbmPartitionBean).
>
> I would be grateful, if you could help me by answering my questions:
>  - Is the solution I outlined above correct?
>  - Are there any other options to use a custom Partition implementation
> (preferably without changing the source)?
>
> Thanks in advance,
>
> Balázs
>
>