How can I get the number of results returned in a NamingEnumeration by a call to DirContext.search()?
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Peter_Farkas
Posted On:   Thursday, April 12, 2001 06:07 AM

Have created a class that manages a series of threads. Each thread attaches to an LDAP server and performs a search. I would like my manager to be able to report on the total number of hits *without* stepping through each Naming Enumeration.

Stepping through each NamingEnumeration is costly (takes as much time as it does to conduct the search) and seems to invalidate the NamingEnumeration (I can't use it again to examine the SearchResults, doing so generates NullPointerErrors on calls to hasMore()).

Actually examining the SearchResults must be left to another class which will parse them and display them as appropriate.

Re: How can I get the number of results returned in a NamingEnumeration by a call to DirContext.search()?

Posted By:   John_Mitchell  
Posted On:   Friday, June 29, 2001 07:52 PM

You can't do that, directly. You'll have to pull out all of the entries and copy/put them into an intermediate structure and then do your processing against your structure.
About | Sitemap | Contact