org.openmrs.hl7
Class Hl7InArchivesMigrateThread

java.lang.Object
  extended by java.lang.Thread
      extended by org.openmrs.hl7.Hl7InArchivesMigrateThread
All Implemented Interfaces:
java.lang.Runnable

public class Hl7InArchivesMigrateThread
extends java.lang.Thread

Separate thread to move the hl7 in archives from the database tables to the filesystem. It is highly recommended to start this thread by calling "startHl7ArchiveMigration(UserContext)" method in the service layer as opposed to calling the thread's start() method to ensure the thread is started after making all the necessary checks.

See Also:
HL7Service#startHl7ArchiveMigration()}

Nested Class Summary
static class Hl7InArchivesMigrateThread.Status
          The different states this thread can be in at a given point during migration
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
Hl7InArchivesMigrateThread()
          Constructor to initialize variables
 
Method Summary
static java.lang.Integer getDaysKept()
           
static java.lang.Integer getNumberOfFailedTransfers()
          Gets the number of failed transfers during migration, this could be that the system couldn't write them to the file system or couldn't be deleted from the database.
static java.lang.Integer getNumberTransferred()
           
static Hl7InArchivesMigrateThread.Status getTransferStatus()
           
 UserContext getUserContext()
           
static boolean isActive()
           
 void run()
           
static void setActive(boolean active)
           
static void setDaysKept(java.lang.Integer daysKept)
           
static void stopMigration()
          convenience method to set transfer status and active flag to stop migration
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Hl7InArchivesMigrateThread

public Hl7InArchivesMigrateThread()
Constructor to initialize variables

Method Detail

getDaysKept

public static java.lang.Integer getDaysKept()
Returns:
the daysKept

setDaysKept

public static void setDaysKept(java.lang.Integer daysKept)
Parameters:
daysKept - the daysKept to set

isActive

public static boolean isActive()
Returns:
the active

setActive

public static void setActive(boolean active)
Parameters:
active - the active to set

run

public void run()
Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread
See Also:
Runnable.run()

stopMigration

public static void stopMigration()
convenience method to set transfer status and active flag to stop migration


getTransferStatus

public static Hl7InArchivesMigrateThread.Status getTransferStatus()
Returns:
the transferStatus

getNumberTransferred

public static java.lang.Integer getNumberTransferred()
Returns:
the numberTransferred at a given time during migration

getNumberOfFailedTransfers

public static java.lang.Integer getNumberOfFailedTransfers()
Gets the number of failed transfers during migration, this could be that the system couldn't write them to the file system or couldn't be deleted from the database.

Returns:
the numberOfFailedTransfers

getUserContext

public UserContext getUserContext()
Returns:
the userContext

OpenMRS-1.7.x

Generated Apr 27 2012 10:06 PM. NOTE - these libraries are in active development and subject to change