How does one abandon a directory search before completion?

Robert Castaneda

To cancel a search, you simply need to close the NamingEnumeration that is returned from the context.search() method.

NamingEnumeration enum = ctx.search( "ou=People", attributes );
if ( enum.hasMore() ) {
//cancel search by closing Naming Enumeration

Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.