Dekoh platform API

dekoh.portal.fwk.importer
Class ImportProgressObject

java.lang.Object
  extended by dekoh.portal.fwk.importer.ImportProgressObject

public class ImportProgressObject
extends Object

ImportProgressObject indicates the progress of current importing of Digital Objects. An instance of this class is returned by ImportService#start(ImportContext,ImportProgressObject)) method.

Since:
Dec 18, 2006

Nested Class Summary
static class ImportProgressObject.ProgressStatus
          States of an import process.
protected  class ImportProgressObject.RegisteredTask
           
 
Constructor Summary
ImportProgressObject()
           
ImportProgressObject(int initialWeightage)
           
 
Method Summary
 void addImportProgressListener(ImportProgressEventListener importProgressEventListener)
           
 void cancel()
          Cancels the current import process, rolling back all the files that may be imported to Dekoh Database since the start operation.
 String getCompletionMessage()
           
protected  List getImportTasksToRegister()
           
 int getInitialWeightage()
           
 ImportProgressObject.ProgressStatus getProgressStatus()
           
protected  void invokeListeners()
           
 boolean isCancelSupported()
           
 boolean isDone()
           
 boolean isStopped()
           
 void removeImportProgressListener(ImportProgressEventListener importProgressEventListener)
           
 void stop()
          Stops the current importing of DigitalObjects.
 void updateStatus(ImportStatus importStatus, File f)
           
 void updateStatus(ImportStatus importStatus, int percentageCompletion, File f)
          Creates an event and nofify the listener with the new ImportStatus
 void updateStatus(ImportStatus importStatus, int percentageCompletion, File f, String message)
           
 void updateStatusToCompleted()
           
 void updateStatusToFailure(String message, Throwable cause)
           
 void waitForCompletion()
           
 void waitForCompletion(int timeout)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImportProgressObject

public ImportProgressObject()

ImportProgressObject

public ImportProgressObject(int initialWeightage)
Method Detail

getImportTasksToRegister

protected List getImportTasksToRegister()

addImportProgressListener

public void addImportProgressListener(ImportProgressEventListener importProgressEventListener)

getInitialWeightage

public int getInitialWeightage()

removeImportProgressListener

public void removeImportProgressListener(ImportProgressEventListener importProgressEventListener)

isStopped

public boolean isStopped()

stop

public void stop()
Stops the current importing of DigitalObjects. Files that are already written to Dekoh Database will be retained.


isCancelSupported

public boolean isCancelSupported()

cancel

public void cancel()
Cancels the current import process, rolling back all the files that may be imported to Dekoh Database since the start operation. (Optional operation)

Throws:
UnsupportedOperationException
See Also:
ImportProgressObject.isCancelSupported()

updateStatus

public void updateStatus(ImportStatus importStatus,
                         File f)

updateStatus

public void updateStatus(ImportStatus importStatus,
                         int percentageCompletion,
                         File f)
Creates an event and nofify the listener with the new ImportStatus

Parameters:
importStatus -
percentageCompletion -
f -

updateStatus

public void updateStatus(ImportStatus importStatus,
                         int percentageCompletion,
                         File f,
                         String message)

getProgressStatus

public ImportProgressObject.ProgressStatus getProgressStatus()

isDone

public boolean isDone()

updateStatusToFailure

public void updateStatusToFailure(String message,
                                  Throwable cause)

updateStatusToCompleted

public void updateStatusToCompleted()

getCompletionMessage

public String getCompletionMessage()

invokeListeners

protected void invokeListeners()

waitForCompletion

public void waitForCompletion(int timeout)
                       throws InterruptedException
Throws:
InterruptedException

waitForCompletion

public void waitForCompletion()
                       throws InterruptedException
Throws:
InterruptedException

Dekoh platform API

© 2009 Pramati Technologies - Dekoh - Portal for Developers