org.archive.wayback.resourceindex
Class CompositeSearchResultSource

java.lang.Object
  extended by org.archive.wayback.resourceindex.CompositeSearchResultSource
All Implemented Interfaces:
SearchResultSource
Direct Known Subclasses:
DynamicCDXIndex

public class CompositeSearchResultSource
extends Object
implements SearchResultSource

SearchResultSource that aggregates results from multiple SearchResultSources.

Version:
$Date: 2010-09-29 05:28:38 +0700 (Wed, 29 Sep 2010) $, $Revision: 3262 $
Author:
brad

Field Summary
protected  List<SearchResultSource> sources
           
 
Constructor Summary
CompositeSearchResultSource()
          Constructor
 
Method Summary
 void addSource(SearchResultSource source)
          add a SearchResultSource to this composite
 void cleanup(CloseableIterator<CaptureSearchResult> c)
           
 List<String> getCDXSources()
           
 CloseableIterator<CaptureSearchResult> getPrefixIterator(String prefix)
           
 CloseableIterator<CaptureSearchResult> getPrefixReverseIterator(String prefix)
           
 List<SearchResultSource> getSources()
           
 void setCDXSources(List<String> cdxs)
          Sets the list of files searched for queries against this SearchResultSource to the list of paths cdxs
 void setSources(List<SearchResultSource> sources)
           
 void shutdown()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sources

protected List<SearchResultSource> sources
Constructor Detail

CompositeSearchResultSource

public CompositeSearchResultSource()
Constructor

Method Detail

addSource

public void addSource(SearchResultSource source)
add a SearchResultSource to this composite

Parameters:
source - to be added

getPrefixIterator

public CloseableIterator<CaptureSearchResult> getPrefixIterator(String prefix)
                                                         throws ResourceIndexNotAvailableException
Specified by:
getPrefixIterator in interface SearchResultSource
Returns:
CleanableIterator that will return SearchResults beginning with prefix argument, with subsequent next() calls returning subsequent results.
Throws:
ResourceIndexNotAvailableException

getPrefixReverseIterator

public CloseableIterator<CaptureSearchResult> getPrefixReverseIterator(String prefix)
                                                                throws ResourceIndexNotAvailableException
Specified by:
getPrefixReverseIterator in interface SearchResultSource
Returns:
CleanableIterator that will return SearchResults starting *before* prefix argument, with subsequent next() calls returning previous results.
Throws:
ResourceIndexNotAvailableException

cleanup

public void cleanup(CloseableIterator<CaptureSearchResult> c)
             throws IOException
Specified by:
cleanup in interface SearchResultSource
Throws:
IOException

getCDXSources

public List<String> getCDXSources()
Returns:
null -- only present for Spring

setCDXSources

public void setCDXSources(List<String> cdxs)
Sets the list of files searched for queries against this SearchResultSource to the list of paths cdxs

Parameters:
cdxs -

setSources

public void setSources(List<SearchResultSource> sources)
Parameters:
sources - the sources to set

getSources

public List<SearchResultSource> getSources()
Returns:
the sources

shutdown

public void shutdown()
              throws IOException
Specified by:
shutdown in interface SearchResultSource
Throws:
IOException


Copyright © 2005-2011 Internet Archive. All Rights Reserved.