com.ca.jcs.enumeration
Class ProcessingNamingEnumeration

java.lang.Object
  extended by com.ca.jcs.enumeration.RawNamingEnumeration<T>
      extended by com.ca.jcs.enumeration.LookAheadRawNamingEnumeration<SearchResult>
          extended by com.ca.jcs.enumeration.ProcessingNamingEnumeration
All Implemented Interfaces:
Enumeration<SearchResult>, NamingEnumeration<SearchResult>
Direct Known Subclasses:
AbsoluteQueryResultNamingEnumeration, FilteringNamingEnumeration

public abstract class ProcessingNamingEnumeration
extends LookAheadRawNamingEnumeration<SearchResult>

A base class for enumerations which want to process entries while stepping through them, allowing for entries to be skipped when processNext(SearchResult) returns false.


Field Summary
 
Fields inherited from class com.ca.jcs.enumeration.LookAheadRawNamingEnumeration
lookAhead, skippedCount
 
Fields inherited from class com.ca.jcs.enumeration.RawNamingEnumeration
countLimit, scope, startTime, timeLimit, visitedCount
 
Constructor Summary
ProcessingNamingEnumeration(NamingEnumeration<SearchResult> target)
          Create an enumeration which process entries read from underlying target, should use ProcessingNamingEnumeration(SearchControls, NamingEnumeration) instead if at all possible as it respects any configured time / size limits.
ProcessingNamingEnumeration(SearchControls searchControls, NamingEnumeration<SearchResult> target)
          Create an enumeration which process entries read from underlying target, respecting any time / size limits in SearchControls.
 
Method Summary
 void close()
          Closes the underlying target enumeration.
abstract  boolean processNext(SearchResult result)
          Return true if result should be returned to the client, false if it should be skipped.
 boolean rawHasMore()
          Returns true if at least one object remains for which processNext(SearchResult) returns true.
 
Methods inherited from class com.ca.jcs.enumeration.LookAheadRawNamingEnumeration
getSkippedCount, rawNext, toString
 
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, wait, wait, wait
 

Constructor Detail

ProcessingNamingEnumeration

public ProcessingNamingEnumeration(SearchControls searchControls,
                                   NamingEnumeration<SearchResult> target)
Create an enumeration which process entries read from underlying target, respecting any time / size limits in SearchControls.


ProcessingNamingEnumeration

public ProcessingNamingEnumeration(NamingEnumeration<SearchResult> target)
Create an enumeration which process entries read from underlying target, should use ProcessingNamingEnumeration(SearchControls, NamingEnumeration) instead if at all possible as it respects any configured time / size limits.

Method Detail

processNext

public abstract boolean processNext(SearchResult result)
                             throws NamingException
Return true if result should be returned to the client, false if it should be skipped.

Throws:
NamingException

rawHasMore

public boolean rawHasMore()
                   throws NamingException
Returns true if at least one object remains for which processNext(SearchResult) returns true.

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

close

public void close()
           throws NamingException
Closes the underlying target enumeration.

Throws:
NamingException


Created 2011-07-14 13:27 EST