0

I am in the process to create a program that connects to an OpenLDAP database server and receives notifications of every modification done in the DB.
During my investigation, I came to the conclusion that SyncRepl is the way to go. As JNDI doesn't support SyncRepl, I decided to try either UnbindID or ldaptive (the latter would be preferred as it seems a more generic aproach).
But however I hit google I'm unable to find some example for this usage.
The documentation is really insufficient. The basic example on the ldaptive webpage about content syncronization covers only the first steps (changing provider, connecting, searching), but what after?

I would like some information (example code, how-to, documentation, anything) about writing the client side of a SyncRepl connection.

Tylla
  • 189
  • 2
  • 14

1 Answers1

0

You should first familiarize yourself with LDAP Sync Replication. The OpenLDAP admin guide has a good write up including how to configure different types of replication.

The next thing you should ask yourself is "What do I want my program to do?". You mention that you'd like to receive notifications of every modification. There are a couple of ways you can go about this.

The first is to set up the provider LDAP with the syncprov overlay and do an LDAP sync search on that branch. This configuration is shown in this example. Basically, once you have set up your OpenLDAP instance correctly, use the ldaptive example to process those entries (this will be done in the if(item.isEntry()) block).

Note that when using this method all attributes for an entry that have changed are sent.

If you want to see what actually changed, you may want to use delta-syncrepl, where you set up an accesslog database that contains entries that represent the changes to the directory.

Whichever way you choose, you'll want to process those entries in the item.isEntry() block of the ldaptive instructions you link to.

You should be able to get this working with both the ldaptive and OpenLDAP documentation.

Floegipoky
  • 3,087
  • 1
  • 31
  • 47
David H
  • 1
  • 1