org.jets3t.service.multithread
Class DownloadObjectsEvent

java.lang.Object
  extended by org.jets3t.service.multithread.ServiceEvent
      extended by org.jets3t.service.multithread.DownloadObjectsEvent

public class DownloadObjectsEvent
extends ServiceEvent

Multi-threaded service event fired by S3ServiceMulti.downloadObjects(org.jets3t.service.model.S3Bucket, DownloadPackage[]).

EVENT_IN_PROGRESS events include an array of the S3Objects that have finished downloading since the last progress event was fired. These objects are available via getDownloadedObjects().

EVENT_CANCELLED events include an array of the S3Objects that were not downloaded before the operation was cancelled. These objects are available via getCancelledObjects().

Author:
James Murty

Field Summary
 
Fields inherited from class org.jets3t.service.multithread.ServiceEvent
EVENT_CANCELLED, EVENT_COMPLETED, EVENT_ERROR, EVENT_IGNORED_ERRORS, EVENT_IN_PROGRESS, EVENT_STARTED
 
Method Summary
 S3Object[] getCancelledObjects()
           
 S3Object[] getDownloadedObjects()
           
static DownloadObjectsEvent newCancelledEvent(S3Object[] incompletedObjects, Object uniqueOperationId)
           
static DownloadObjectsEvent newCompletedEvent(Object uniqueOperationId)
           
static DownloadObjectsEvent newErrorEvent(Throwable t, Object uniqueOperationId)
           
static DownloadObjectsEvent newIgnoredErrorsEvent(ThreadWatcher threadWatcher, Throwable[] ignoredErrors, Object uniqueOperationId)
           
static DownloadObjectsEvent newInProgressEvent(ThreadWatcher threadWatcher, S3Object[] completedObjects, Object uniqueOperationId)
           
static DownloadObjectsEvent newStartedEvent(ThreadWatcher threadWatcher, Object uniqueOperationId)
           
 
Methods inherited from class org.jets3t.service.multithread.ServiceEvent
getErrorCause, getEventCode, getIgnoredErrors, getThreadWatcher, getUniqueOperationId, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

newErrorEvent

public static DownloadObjectsEvent newErrorEvent(Throwable t,
                                                 Object uniqueOperationId)

newStartedEvent

public static DownloadObjectsEvent newStartedEvent(ThreadWatcher threadWatcher,
                                                   Object uniqueOperationId)

newInProgressEvent

public static DownloadObjectsEvent newInProgressEvent(ThreadWatcher threadWatcher,
                                                      S3Object[] completedObjects,
                                                      Object uniqueOperationId)

newCompletedEvent

public static DownloadObjectsEvent newCompletedEvent(Object uniqueOperationId)

newCancelledEvent

public static DownloadObjectsEvent newCancelledEvent(S3Object[] incompletedObjects,
                                                     Object uniqueOperationId)

newIgnoredErrorsEvent

public static DownloadObjectsEvent newIgnoredErrorsEvent(ThreadWatcher threadWatcher,
                                                         Throwable[] ignoredErrors,
                                                         Object uniqueOperationId)

getDownloadedObjects

public S3Object[] getDownloadedObjects()
                                throws IllegalStateException
Returns:
the S3Objects that have finished downloading since the last progress event was fired.
Throws:
IllegalStateException - downloaded objects are only available from EVENT_IN_PROGRESS events.

getCancelledObjects

public S3Object[] getCancelledObjects()
                               throws IllegalStateException
Returns:
the S3Objects that were not downloaded before the operation was cancelled.
Throws:
IllegalStateException - cancelled objects are only available from EVENT_CANCELLED events.