directory-api mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Harris, Christopher P" <chris_har...@baxter.com>
Subject RE: Proper use of LdapConnectionPool
Date Tue, 03 Feb 2015 08:19:54 GMT
Stefan,

Yes, we have a hierarchical structure. 

That's are fantastic ideas, Stefan!  I especially like the search base idea.

I'll try them out.

Thank you!

 - Chris


-----Original Message-----
From: Stefan Seelmann [mailto:mail@stefan-seelmann.de] 
Sent: Tuesday, February 03, 2015 1:42 AM
To: api@directory.apache.org
Subject: Re: Proper use of LdapConnectionPool

Hi Harris,

can you tell a bit about your directory structure? Do you have a flat directory i.e. all Persons
you are query for are below one OU, our do you have a nested hierarchical directory structure?

Looking at the code I guess the latter is the case, and then it is clear that onelevel search
isn't working.

* You get the entry of the CEO.
* You get the "directreports" attribute which seems to contain DNs
* For each of those DNs you construct a new search, with the same search base, the search
filter includes the one DN.

==> In that case I think you can use the DN directly as search base and search scope "object",
because you already know the DN. The LDAP API also contains a "lookup" method that you can
use.

Kind Regards,
Stefan


> ... 
> 	        		SearchRequest sr = new SearchRequestImpl();
> 	        		sr.setBase(new Dn(searchBase)); ...
> 		sb.append("(&(objectClass=person)(distinguishedName=")
> 		  .append(replaceFilterSpecialCharactersWithHexRepresentation(distinguishedName))
> 		  .append("))");
> ... 	
> 					.setDirectReports(entry.get( "directreports" ))


The information transmitted is intended only for the person(s) or entity to which it is addressed
and may contain confidential and/or legally privileged material. Delivery of this message
to any person other than the intended recipient(s) is not intended in any way to waive privilege
or confidentiality. Any review, retransmission, dissemination or other use of, or taking of
any action in reliance upon, this information by entities other than the intended recipient
is prohibited. If you receive this in error, please contact the sender and delete the material
from any computer.

For Translation:

http://www.baxter.com/email_disclaimer
Mime
View raw message