Package org.duracloud.retrieval.source
Class DuraStoreRetrievalSource
- java.lang.Object
-
- org.duracloud.retrieval.source.DuraStoreRetrievalSource
-
- All Implemented Interfaces:
RetrievalSource
- Direct Known Subclasses:
DuraStoreStitchingRetrievalSource
public class DuraStoreRetrievalSource extends Object implements RetrievalSource
-
-
Field Summary
Fields Modifier and Type Field Description protected ContentStorecontentStoreprotected Iterator<String>currentContentListprotected StringcurrentSpaceIdprotected Iterator<String>spaceIds
-
Constructor Summary
Constructors Constructor Description DuraStoreRetrievalSource(ContentStore store, List<String> spaces, boolean allSpaces)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ContentdoGetContent(ContentItem contentItem, RetrievalListener listener)ContentItemgetNextContentItem()Provides the next content item to be processed, cycles through all spaces as necessary.protected voidgetNextSpace()StringgetSourceChecksum(ContentItem contentItem)Provides the checksum of the specified source file based on the file's properties.ContentStreamgetSourceContent(ContentItem contentItem, RetrievalListener listener)Get the actual content using a retrieval listener callback.Map<String,String>getSourceProperties(ContentItem contentItem)Retrieves the Duracloud properties for the specified ContentItem.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.duracloud.retrieval.source.RetrievalSource
getSourceContent
-
-
-
-
Constructor Detail
-
DuraStoreRetrievalSource
public DuraStoreRetrievalSource(ContentStore store, List<String> spaces, boolean allSpaces)
-
-
Method Detail
-
getNextContentItem
public ContentItem getNextContentItem()
Description copied from interface:RetrievalSourceProvides the next content item to be processed, cycles through all spaces as necessary. Returns null when there are no further content ids to process.- Specified by:
getNextContentItemin interfaceRetrievalSource- Returns:
- the next content item to be processed
-
getNextSpace
protected void getNextSpace()
-
getSourceProperties
public Map<String,String> getSourceProperties(ContentItem contentItem)
Description copied from interface:RetrievalSourceRetrieves the Duracloud properties for the specified ContentItem.- Specified by:
getSourcePropertiesin interfaceRetrievalSource- Parameters:
contentItem- the file whose properties to retrieve- Returns:
- the Map of Duracloud properties
-
getSourceChecksum
public String getSourceChecksum(ContentItem contentItem)
Description copied from interface:RetrievalSourceProvides the checksum of the specified source file based on the file's properties.- Specified by:
getSourceChecksumin interfaceRetrievalSource- Parameters:
contentItem- the file to consider- Returns:
- MD5 checksum of the given file
-
getSourceContent
public ContentStream getSourceContent(ContentItem contentItem, RetrievalListener listener)
Description copied from interface:RetrievalSourceGet the actual content using a retrieval listener callback. The listener should be called synchronously.- Specified by:
getSourceContentin interfaceRetrievalSource- Parameters:
contentItem- the file to retrievelistener- of the specified operation- Returns:
-
doGetContent
protected Content doGetContent(ContentItem contentItem, RetrievalListener listener)
-
-