Class DataCache
- java.lang.Object
-
- org.apache.manifoldcf.crawler.connectors.rss.DataCache
-
public class DataCache extends java.lang.ObjectThis 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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classDataCache.DocumentDataThis class represents everything we need to know about a document that's getting passed from the getDocumentVersions() phase to the processDocuments() phase.
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String_rcsidprotected java.util.Map<java.lang.String,DataCache.DocumentData>cacheData
-
Constructor Summary
Constructors Constructor Description DataCache()Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longaddData(org.apache.manifoldcf.crawler.interfaces.IProcessActivity activities, java.lang.String documentIdentifier, java.lang.String contentType, java.io.InputStream dataStream)Add binary data entry into the cache.voiddeleteData(java.lang.String documentIdentifier)Delete specified item of data.java.lang.StringgetContentType(java.lang.String documentIdentifier)Get the content type.java.io.InputStreamgetData(java.lang.String documentIdentifier)Fetch binary data entry from the cache.longgetDataLength(java.lang.String documentIdentifier)Fetch binary data length.
-
-
-
Field Detail
-
_rcsid
public static final java.lang.String _rcsid
- See Also:
- Constant Field Values
-
cacheData
protected java.util.Map<java.lang.String,DataCache.DocumentData> cacheData
-
-
Method Detail
-
addData
public long addData(org.apache.manifoldcf.crawler.interfaces.IProcessActivity activities, java.lang.String documentIdentifier, java.lang.String contentType, java.io.InputStream dataStream) throws org.apache.manifoldcf.core.interfaces.ManifoldCFException, org.apache.manifoldcf.agents.interfaces.ServiceInterruptionAdd binary data entry into the cache. Does NOT close the input stream when done!- Parameters:
documentIdentifier- is the document identifier (url).contentType- is the content type for the data.dataStream- is the data stream.- Returns:
- the checksum value.
- Throws:
org.apache.manifoldcf.core.interfaces.ManifoldCFExceptionorg.apache.manifoldcf.agents.interfaces.ServiceInterruption
-
getDataLength
public long getDataLength(java.lang.String documentIdentifier) throws org.apache.manifoldcf.core.interfaces.ManifoldCFExceptionFetch 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.ManifoldCFExceptionFetch 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
-
getContentType
public java.lang.String getContentType(java.lang.String documentIdentifier)
Get the content type.- Parameters:
documentIdentifier- is the document identifier.- Returns:
- the content type, or null if there is none.
-
deleteData
public void deleteData(java.lang.String documentIdentifier)
Delete specified item of data.- Parameters:
documentIdentifier- is the document identifier (url).
-
-