de.fh_mannheim.mm.dms.indexserver
Class ImportUploadsThread

java.lang.Object
  extended byjava.lang.Thread
      extended byde.fh_mannheim.mm.dms.indexserver.ImportUploadsThread
All Implemented Interfaces:
IMonitor, IViewer, java.lang.Runnable

public class ImportUploadsThread
extends java.lang.Thread
implements java.lang.Runnable, IMonitor

ImportUploadsThread organizes uploadmanager to import files.

Version:
$Revision: 1.6 $
Author:
Jan Löffler, mail@jlsoft.de

Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
ImportUploadsThread(java.lang.ThreadGroup group, java.lang.String strName, IViewer viewer, UploadManager uplMgr)
          Constructor.
ImportUploadsThread(java.lang.ThreadGroup group, java.lang.String strName, UploadManager uplMgr)
          Constructor.
 
Method Summary
 FormattedDate getRunTime()
          Get the runtime of thread.
 boolean hasFinished()
          Has importing finished.
 void registerViewer(IViewer viewer)
          Register a viewer with callback.
 void run()
          Start the thread.
 void setImportParameters(java.lang.String strPath, java.lang.String strExtension, int nUserID, boolean bSearchSubdirs, boolean bForceUpdate)
          Initialize the needed parameters.
 void stateHasChanged()
          Call all callbacks and send onChanged.
 void unregisterViewer(IViewer viewer)
          Unregister a viewer with callback.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ImportUploadsThread

public ImportUploadsThread(java.lang.ThreadGroup group,
                           java.lang.String strName,
                           UploadManager uplMgr)
Constructor.

Parameters:
group - Threadgroup
strName - Name of thread

ImportUploadsThread

public ImportUploadsThread(java.lang.ThreadGroup group,
                           java.lang.String strName,
                           IViewer viewer,
                           UploadManager uplMgr)
Constructor.

Parameters:
group - Threadgroup
strName - Name of thread
viewer - Viewer
Method Detail

setImportParameters

public void setImportParameters(java.lang.String strPath,
                                java.lang.String strExtension,
                                int nUserID,
                                boolean bSearchSubdirs,
                                boolean bForceUpdate)
Initialize the needed parameters.

Parameters:
strPath - Path to be searched
strExtension - Filetype which should be found
nUserID - User
bSearchSubdirs - Should subdiretories be searched too
bForceUpdate - Overwrite existing upload

getRunTime

public FormattedDate getRunTime()
Get the runtime of thread.

Returns:
time

hasFinished

public boolean hasFinished()
Has importing finished.

Returns:
true, if finished

registerViewer

public void registerViewer(IViewer viewer)
Register a viewer with callback.

Specified by:
registerViewer in interface IMonitor
Parameters:
viewer - Callback

run

public void run()
Start the thread.

Specified by:
run in interface java.lang.Runnable

stateHasChanged

public void stateHasChanged()
Call all callbacks and send onChanged.

Specified by:
stateHasChanged in interface IMonitor

unregisterViewer

public void unregisterViewer(IViewer viewer)
Unregister a viewer with callback.

Specified by:
unregisterViewer in interface IMonitor
Parameters:
viewer - Callback