com.ca.jcs.sdk
Class SDKSearchEnumeration

java.lang.Object
  extended by com.ca.jcs.enumeration.RawNamingEnumeration<SearchResult>
      extended by com.ca.jcs.sdk.SDKSearchEnumeration
All Implemented Interfaces:
Enumeration<SearchResult>, NamingEnumeration<SearchResult>

public class SDKSearchEnumeration
extends RawNamingEnumeration<SearchResult>

Example of an enumeration which allows results to be streamed back to the LDAP client as soon as they become available.

Note that most implementations will use the connector's ConnectionManager (pool) to get a new connection in each call to rawNext() but as the SDK's idea of a connection is a bit contrived (due to it being file system based) this class does not do this. In particular, for scalability, reasons it is not advisable to hold onto a single connection for the lifetime of the enumeration, as returning a large set of results can take a very long time for some endpoint technologies and there can be multiple such searches running at once which therefore risk hogging all the connections in the pool.


Field Summary
 
Fields inherited from class com.ca.jcs.enumeration.RawNamingEnumeration
countLimit, scope, startTime, timeLimit, visitedCount
 
Constructor Summary
SDKSearchEnumeration(SDKAttributeStyleOpProcessor opProcessor, MetaObjectClassMapping classMap, String[] nonAssocAttrIds, SearchControls searchControls, String ext, Map<String,Pattern> filterMap, FilenameFilter filenameFilter)
           
 
Method Summary
 void close()
           
 boolean rawHasMore()
          Override this method to return whether more values remain to be returned.
 SearchResult rawNext()
          Override this method to return next value to be returned from next().
 
Methods inherited from class com.ca.jcs.enumeration.RawNamingEnumeration
getCountLimit, getNonFatalException, getTimeLimit, getVisitedCount, hasMore, hasMoreElements, next, nextElement, setCountLimit, setNonFatalException, setTimeLimit
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SDKSearchEnumeration

public SDKSearchEnumeration(SDKAttributeStyleOpProcessor opProcessor,
                            MetaObjectClassMapping classMap,
                            String[] nonAssocAttrIds,
                            SearchControls searchControls,
                            String ext,
                            Map<String,Pattern> filterMap,
                            FilenameFilter filenameFilter)
Method Detail

rawHasMore

public boolean rawHasMore()
                   throws NamingException
Description copied from class: RawNamingEnumeration
Override this method to return whether more values remain to be returned.

Specified by:
rawHasMore in class RawNamingEnumeration<SearchResult>
Throws:
NamingException

rawNext

public SearchResult rawNext()
                     throws NamingException
Description copied from class: RawNamingEnumeration
Override this method to return next value to be returned from next().

Specified by:
rawNext in class RawNamingEnumeration<SearchResult>
Throws:
NamingException

close

public void close()
           throws NamingException
Throws:
NamingException


Created 2011-07-14 13:27 EST