org.duracloud.chunk.writer
Class DuracloudContentWriter

java.lang.Object
  extended by org.duracloud.chunk.writer.DuracloudContentWriter
All Implemented Interfaces:
ContentWriter

public class DuracloudContentWriter
extends java.lang.Object
implements ContentWriter

This class implements the ContentWriter interface to write the provided content to the Duracloud storeclient interface.

Author:
Andrew Woods Date: Feb 5, 2010

Constructor Summary
DuracloudContentWriter(ContentStore contentStore)
           
DuracloudContentWriter(ContentStore contentStore, boolean throwOnError)
           
 
Method Summary
 java.util.List<AddContentResult> getResults()
          This method returns an item-by-item list of results for the write requests.
 void ignore(java.lang.String spaceId, java.lang.String contentId, long contentSize)
          This method helps with the book-keeping of which files are ignored.
 ChunksManifest write(java.lang.String spaceId, ChunkableContent chunkable)
          This method implements the ContentWriter interface for writing content to a DataStore.
 java.lang.String writeSingle(java.lang.String spaceId, java.lang.String chunkChecksum, ChunkInputStream chunk)
          This method writes a single chunk to the DataStore.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DuracloudContentWriter

public DuracloudContentWriter(ContentStore contentStore)

DuracloudContentWriter

public DuracloudContentWriter(ContentStore contentStore,
                              boolean throwOnError)
Method Detail

getResults

public java.util.List<AddContentResult> getResults()
Description copied from interface: ContentWriter
This method returns an item-by-item list of results for the write requests.

Specified by:
getResults in interface ContentWriter
Returns:
List of results

ignore

public void ignore(java.lang.String spaceId,
                   java.lang.String contentId,
                   long contentSize)
Description copied from interface: ContentWriter
This method helps with the book-keeping of which files are ignored.

Specified by:
ignore in interface ContentWriter
Parameters:
spaceId - destination where arg content was assigned to be written
contentId - of content
contentSize - of content

write

public ChunksManifest write(java.lang.String spaceId,
                            ChunkableContent chunkable)
                     throws NotFoundException
This method implements the ContentWriter interface for writing content to a DataStore. In this case, the DataStore is durastore.

Specified by:
write in interface ContentWriter
Parameters:
spaceId - destination space of arg chunkable content
chunkable - content to be written
Returns:
ChunksManifest of written content
Throws:
NotFoundException - if space is not found

writeSingle

public java.lang.String writeSingle(java.lang.String spaceId,
                                    java.lang.String chunkChecksum,
                                    ChunkInputStream chunk)
                             throws NotFoundException
This method writes a single chunk to the DataStore.

Specified by:
writeSingle in interface ContentWriter
Parameters:
spaceId - destination where arg chunk content will be written
chunkChecksum - md5 checksum of the chunk if known, null otherwise
chunk - content to be written
Returns:
MD5 of written content
Throws:
NotFoundException - if space is not found


Copyright © 2009-2010 DuraSpace. All Rights Reserved.