anl.aida.reader
Class ResultCacher

java.lang.Object
  extended by anl.aida.reader.ResultCacher
All Implemented Interfaces:
ReaderResultProcessor

public class ResultCacher
extends java.lang.Object
implements ReaderResultProcessor

Result processor that will cache the contents of the the result in a file and create an index entry for that. The first line of the cached contents will be the original location.


Field Summary
private  java.io.PrintWriter contentOut
           
private  int entryIndex
           
private  java.io.PrintWriter indexOut
           
private  java.lang.String zipName
           
private  java.util.zip.ZipOutputStream zipOut
           
 
Constructor Summary
ResultCacher(java.lang.String cacheDir, java.lang.String indexName)
           
 
Method Summary
 void done()
          Notifies the processor that it is done processing results.
 void initialize()
          Initializes the processor.
 void process(ReaderResult result)
          Process the specified result.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

indexOut

private java.io.PrintWriter indexOut

zipOut

private java.util.zip.ZipOutputStream zipOut

contentOut

private java.io.PrintWriter contentOut

zipName

private java.lang.String zipName

entryIndex

private int entryIndex
Constructor Detail

ResultCacher

public ResultCacher(java.lang.String cacheDir,
                    java.lang.String indexName)
             throws java.io.IOException
Throws:
java.io.IOException
Method Detail

done

public void done()
          throws java.io.IOException
Description copied from interface: ReaderResultProcessor
Notifies the processor that it is done processing results.

Specified by:
done in interface ReaderResultProcessor
Throws:
java.io.IOException

initialize

public void initialize()
                throws AIDAException
Description copied from interface: ReaderResultProcessor
Initializes the processor.

Specified by:
initialize in interface ReaderResultProcessor
Throws:
AIDAException

process

public void process(ReaderResult result)
             throws AIDAException
Description copied from interface: ReaderResultProcessor
Process the specified result.

Specified by:
process in interface ReaderResultProcessor
Parameters:
result - the result to process
Throws:
AIDAException - if there is an error processing the result