public static MultipartCompletesEvent newInProgressEvent(ThreadWatcher threadWatcher, MultipartCompleted[] completedUploads, Object uniqueOperationId) { MultipartCompletesEvent event = new MultipartCompletesEvent(EVENT_IN_PROGRESS, uniqueOperationId); event.setThreadWatcher(threadWatcher); event.setCompleteUploads(completedUploads); return event; }
/** * @return * the {@link MultipartUpload}s that have been completed since the last progress event was fired. * @throws IllegalStateException * created objects are only available from EVENT_IN_PROGRESS events. */ public MultipartCompleted[] getCompletedUploads() throws IllegalStateException { if (getEventCode() != EVENT_IN_PROGRESS) { throw new IllegalStateException("Started Objects are only available from EVENT_IN_PROGRESS events"); } return completedUploads; }
public static MultipartCompletesEvent newErrorEvent(Throwable t, Object uniqueOperationId) { MultipartCompletesEvent event = new MultipartCompletesEvent(EVENT_ERROR, uniqueOperationId); event.setErrorCause(t); return event; }
public static MultipartCompletesEvent newIgnoredErrorsEvent(ThreadWatcher threadWatcher, Throwable[] ignoredErrors, Object uniqueOperationId) { MultipartCompletesEvent event = new MultipartCompletesEvent(EVENT_IGNORED_ERRORS, uniqueOperationId); event.setIgnoredErrors(ignoredErrors); return event; }
public static MultipartCompletesEvent newStartedEvent(ThreadWatcher threadWatcher, Object uniqueOperationId) { MultipartCompletesEvent event = new MultipartCompletesEvent(EVENT_STARTED, uniqueOperationId); event.setThreadWatcher(threadWatcher); return event; }
@Override public void event(MultipartCompletesEvent event) { super.event(event); if (ServiceEvent.EVENT_IN_PROGRESS == event.getEventCode()) { displayProgressStatus("Completing large file uploads: ", event.getThreadWatcher()); } }
public static MultipartCompletesEvent newCancelledEvent(MultipartUpload[] incompletedUploads, Object uniqueOperationId) { MultipartCompletesEvent event = new MultipartCompletesEvent(EVENT_CANCELLED, uniqueOperationId); event.setIncompleteUploads(incompletedUploads); return event; }
@Override public void fireCompletedEvent() { fireServiceEvent(MultipartCompletesEvent.newCompletedEvent(uniqueOperationId)); } @Override
@Override public void fireCancelEvent() { MultipartUpload[] incompletedObjects = incompletedObjectsList .toArray(new MultipartUpload[incompletedObjectsList.size()]); success[0] = false; fireServiceEvent(MultipartCompletesEvent.newCancelledEvent(incompletedObjects, uniqueOperationId)); } @Override
@Override public void fireIgnoredErrorsEvent(ThreadWatcher threadWatcher, Throwable[] ignoredErrors) { success[0] = false; fireServiceEvent(MultipartCompletesEvent.newIgnoredErrorsEvent(threadWatcher, ignoredErrors, uniqueOperationId)); } }).run();
@Override public void fireErrorEvent(Throwable throwable) { success[0] = false; fireServiceEvent(MultipartCompletesEvent.newErrorEvent(throwable, uniqueOperationId)); } @Override
@Override public void fireStartEvent(ThreadWatcher threadWatcher) { fireServiceEvent(MultipartCompletesEvent.newStartedEvent(threadWatcher, uniqueOperationId)); } @Override
@Override public void fireProgressEvent(ThreadWatcher threadWatcher, List completedResults) { incompletedObjectsList.removeAll(completedResults); MultipartCompleted[] completedObjects = (MultipartCompleted[]) completedResults .toArray(new MultipartCompleted[completedResults.size()]); fireServiceEvent(MultipartCompletesEvent.newInProgressEvent(threadWatcher, completedObjects, uniqueOperationId)); } @Override
public static MultipartCompletesEvent newCompletedEvent(Object uniqueOperationId) { MultipartCompletesEvent event = new MultipartCompletesEvent(EVENT_COMPLETED, uniqueOperationId); return event; }
public static MultipartCompletesEvent newErrorEvent(Throwable t, Object uniqueOperationId) { MultipartCompletesEvent event = new MultipartCompletesEvent(EVENT_ERROR, uniqueOperationId); event.setErrorCause(t); return event; }
public static MultipartCompletesEvent newIgnoredErrorsEvent(ThreadWatcher threadWatcher, Throwable[] ignoredErrors, Object uniqueOperationId) { MultipartCompletesEvent event = new MultipartCompletesEvent(EVENT_IGNORED_ERRORS, uniqueOperationId); event.setIgnoredErrors(ignoredErrors); return event; }
@Override public void event(MultipartCompletesEvent event) { super.event(event); if (ServiceEvent.EVENT_IN_PROGRESS == event.getEventCode()) { displayProgressStatus("Completing large file uploads: ", event.getThreadWatcher()); } }
public static MultipartCompletesEvent newStartedEvent(ThreadWatcher threadWatcher, Object uniqueOperationId) { MultipartCompletesEvent event = new MultipartCompletesEvent(EVENT_STARTED, uniqueOperationId); event.setThreadWatcher(threadWatcher); return event; }
public static MultipartCompletesEvent newCancelledEvent(MultipartUpload[] incompletedUploads, Object uniqueOperationId) { MultipartCompletesEvent event = new MultipartCompletesEvent(EVENT_CANCELLED, uniqueOperationId); event.setIncompleteUploads(incompletedUploads); return event; }
@Override public void fireCompletedEvent() { fireServiceEvent(MultipartCompletesEvent.newCompletedEvent(uniqueOperationId)); } @Override