Package nzilbb.labbcat.server.task
Class Upgrader
- java.lang.Object
-
- java.lang.Thread
-
- nzilbb.labbcat.server.task.Task
-
- nzilbb.labbcat.server.task.Upgrader
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
-
-
Field Summary
-
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidexecuteSql(File sqlFile)Executes all SQL statements in the given file.FilegetDir()Getter fordir: LaBB-CAT root directory, to where the contents of the uploader should be unpacked.Vector<String>getMessages()Getter formessages: Messages logged by the upgrader.static UpgradergetUpgrader()Provides the currently-running upgrader task, if any.FilegetWar()Getter forwar: The .war package to upgrade from.voidrelease()Release resources.voidrun()Runs the upgrade.UpgradersetDir(File newDir)Setter fordir: LaBB-CAT root directory, to where the contents of the uploader should be unpacked.voidsetStatus(String message)Sets the thread status.UpgradersetWar(File newWar)Setter forwar: The .war package to upgrade from.-
Methods inherited from class nzilbb.labbcat.server.task.Task
cancel, defaultThreadName, findTask, findTask, getCreationTime, getDuration, getLastException, getLastKeepAlive, getLog, getMaxLogSize, getPercentComplete, getResources, getResultTarget, getResultText, getResultUrl, getRunning, getStatus, getStatusObservers, getStore, getStoreCache, getTasksArray, getWaitToDieMilliseconds, getWho, keepAlive, setLastException, setLastKeepAlive, setMaxLogSize, setResources, setResultTarget, setResultText, setResultUrl, setStore, setStoreCache, setWaitToDieMilliseconds, setWho, start, waitToDie, waitToDie
-
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, stop, suspend, toString, yield
-
-
-
-
Method Detail
-
getUpgrader
public static Upgrader getUpgrader()
Provides the currently-running upgrader task, if any.- Returns:
- The currently-running upgrader task, if any.
-
getWar
public File getWar()
Getter forwar: The .war package to upgrade from.- Returns:
- The .war package to upgrade from.
-
setWar
public Upgrader setWar(File newWar)
Setter forwar: The .war package to upgrade from.- Parameters:
newWar- The .war package to upgrade from.
-
getDir
public File getDir()
Getter fordir: LaBB-CAT root directory, to where the contents of the uploader should be unpacked.- Returns:
- LaBB-CAT root directory, to where the contents of the uploader should be unpacked.
-
setDir
public Upgrader setDir(File newDir)
Setter fordir: LaBB-CAT root directory, to where the contents of the uploader should be unpacked.- Parameters:
newDir- LaBB-CAT root directory, to where the contents of the uploader should be unpacked.
-
getMessages
public Vector<String> getMessages()
Getter formessages: Messages logged by the upgrader.- Returns:
- Messages logged by the upgrader.
-
setStatus
public void setStatus(String message)
Sets the thread status.
-
run
public void run()
Runs the upgrade.
-
executeSql
public void executeSql(File sqlFile) throws SQLException, Exception
Executes all SQL statements in the given file.- Parameters:
sqlFile- The file to execute.- Throws:
SQLException- If there was an SQL error.Exception- If there was a general error.
-
-