org.apache.manifoldcf.crawler.connectors.rss
Class DataCache

java.lang.Object
  extended by org.apache.manifoldcf.crawler.connectors.rss.DataCache

public class DataCache
extends java.lang.Object

This class is a cache of a specific URL's data. It's fetched early and kept, so that (1) an accurate data length can be found, and (2) we can compute a version checksum.


Field Summary
static java.lang.String _rcsid
           
protected  java.util.HashMap cacheData
           
 
Constructor Summary
DataCache()
          Constructor.
 
Method Summary
 long addData(org.apache.manifoldcf.crawler.interfaces.IVersionActivity activities, java.lang.String documentIdentifier, java.io.InputStream dataStream)
          Add binary data entry into the cache.
 void deleteData(java.lang.String documentIdentifier)
          Delete specified item of data.
 java.io.InputStream getData(java.lang.String documentIdentifier)
          Fetch binary data entry from the cache.
 long getDataLength(java.lang.String documentIdentifier)
          Fetch binary data length.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_rcsid

public static final java.lang.String _rcsid
See Also:
Constant Field Values

cacheData

protected java.util.HashMap cacheData
Constructor Detail

DataCache

public DataCache()
Constructor.

Method Detail

addData

public long addData(org.apache.manifoldcf.crawler.interfaces.IVersionActivity activities,
                    java.lang.String documentIdentifier,
                    java.io.InputStream dataStream)
             throws org.apache.manifoldcf.core.interfaces.ManifoldCFException,
                    org.apache.manifoldcf.agents.interfaces.ServiceInterruption
Add binary data entry into the cache. Does NOT close the input stream when done!

Parameters:
documentIdentifier - is the document identifier (url).
dataStream - is the data stream.
Returns:
the checksum value.
Throws:
org.apache.manifoldcf.core.interfaces.ManifoldCFException
org.apache.manifoldcf.agents.interfaces.ServiceInterruption

getDataLength

public long getDataLength(java.lang.String documentIdentifier)
                   throws org.apache.manifoldcf.core.interfaces.ManifoldCFException
Fetch binary data length.

Parameters:
documentIdentifier - is the document identifier.
Returns:
the length.
Throws:
org.apache.manifoldcf.core.interfaces.ManifoldCFException

getData

public java.io.InputStream getData(java.lang.String documentIdentifier)
                            throws org.apache.manifoldcf.core.interfaces.ManifoldCFException
Fetch binary data entry from the cache.

Parameters:
documentIdentifier - is the document identifier (url).
Returns:
a binary data stream.
Throws:
org.apache.manifoldcf.core.interfaces.ManifoldCFException

deleteData

public void deleteData(java.lang.String documentIdentifier)
Delete specified item of data.

Parameters:
documentIdentifier - is the document identifier (url).