PDA

View Full Version : Spring Batch and LDAP?



vond
Jan 14th, 2008, 02:48 AM
Hi,
I would like to write a batch that reads data from db and Ldap server and than writes it ldap server. Is is possible to use Ldap server an input or output source in Spring Batch?

Marten Deinum
Jan 14th, 2008, 04:13 AM
InputSource is merely an interface how you implement it (file, db, ldap, http, r2d2 data interface, c3p0 babble) doesn't matter. So yes but you will have to implement it yourself.

dkaminsky
Jan 15th, 2008, 01:26 PM
I was thinking about writing an LDAP-aware input source at one point, too. This is a common enough need, and this is a commonly used protocol, so it might be worthwhile to submit a request for this functionality as a JIRA issue. Additionally, you may want to attach your solution for consideration.

In any case, you'll have to write it yourself for now, so keep posting if you have any questions.

vond
Jan 18th, 2008, 07:29 AM
After analyzing samples provided with Spring Batch I think that it'll be better to use ItemProvider/ItemProcessor pattern. ItemProvider will read from db userId and user profile and then ItemProviderProcessTasklet will pass it to ItemProcessor to write attribute.
However my batch also has to remove profile from users who don't have it in db anymore. This will require more logic - loading all users with given profile and checking if proper entry exists in db. I've been considering putting all this logic in ItemProvider so it would provide just attributes to remove for ItemProcessor.
What do you think about this solution? I'm new to Spring/Spring Batch ( I only use spring-ldap) so I guess there might be better way to do this.

j2ee_evangelist
Mar 3rd, 2010, 10:57 AM
Hi,
I am new to Spring Batch and trying to read from LDAP and write to DB, It would be great if you could help me with any inputs, Thank you.