• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

LDAP java question

 
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am trying to code something that will identify duplicate user ids
from two different directories. What is the best approach in Java? Do
you know any article or online books that would get me up to speed
with LDAP programming with Java? Thanks a lot.
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The Java API for using LDAP is called JNDI; its home page might be a good starting point for further research.
 
Tim Cerillo
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Ulf. I was able to make a successful connection to LDAP via JNDI. I'm a java greenhorn, how can I compare two directories for duplicates say in lastname attribute. I already have the connection to both the directories. Can someone share some codes on how to search thru one attribute and compare with the same attribute on the second directory? Thanks in advance.
 
Author
Posts: 121
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Tim,

how many entries do your directories have? One option would be to fetch all users from directory A, and for each entry make a search for the attributes you interested in on directory B. Check out the JNDI Tutorial at Sun for code examples on how to perform search ops with JNDI. Note that the surname is normally not capable to identify a user, because it tends not to be unique (some serial number would do better).

If your directories contain many entries, this algorithm would be rather slow. It is probably better to export the entries into something else instead of using 2 connections to different directories ... But this depends on how often the task should be performed.

Hope that helped, Stefan
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic