Package general.common
Class JatosUpdater
- java.lang.Object
-
- general.common.JatosUpdater
-
@Singleton public class JatosUpdater extends java.lang.ObjectThis class handles JATOS updates Some hints: - JATOS releases are currently stored at GitHub - The data requested from GitHub are stored in ReleaseInfo - If there is an 'n' in the release's version an update is forbidden. This is safety feature in case an future update is not compatible with this update process. - The new release might need a new Java version. The release's Java version is determined by the asset's filename (see newJavaVersion). - The current state of the update process (UpdateState) is stored in 'state'. - The update process is finished in the loader script - In the GUI the update is handled in the home view Update process: 1. Check GitHub for a new releases and put release data into ReleaseInfo 2. Ask user (GUI home view) 3. Download and unzip new release into system's tmp folder 4. Ask user (GUI home view) 5. Move new release into a separate folder within the current JATOS installation folder 6. Exchange loader scripts and config folder 7. Restart JATOS: finish process with an stop hook that runs the new loader script with an 'update' parameter 8. The loader script moves everything in the new release folder into the JATOS installation folder (eventual overwriting existing files) 9. The loader script starts JATOS again 10. JATOS shows a success msg (or a failure msg)
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcancelUpdate()java.util.concurrent.CompletionStage<?>downloadFromGitHubAndUnzip(boolean dry)java.util.concurrent.CompletionStage<com.fasterxml.jackson.databind.JsonNode>getReleaseInfo(java.lang.String version, boolean allowPreReleases)voidsetUpdateStateFailed()voidsetUpdateStateSuccess()voidupdateAndRestart(boolean backupAll)Backups, updates files and restarts JATOS
-
-
-
Method Detail
-
setUpdateStateSuccess
public void setUpdateStateSuccess()
-
setUpdateStateFailed
public void setUpdateStateFailed()
-
getReleaseInfo
public java.util.concurrent.CompletionStage<com.fasterxml.jackson.databind.JsonNode> getReleaseInfo(java.lang.String version, boolean allowPreReleases)
-
cancelUpdate
public void cancelUpdate()
-
downloadFromGitHubAndUnzip
public java.util.concurrent.CompletionStage<?> downloadFromGitHubAndUnzip(boolean dry)
-
updateAndRestart
public void updateAndRestart(boolean backupAll) throws java.io.IOExceptionBackups, updates files and restarts JATOS- Parameters:
backupAll- If true, everything in the JATOS directory will be copied into a backup folder. If false, only the conf directory and the loader scripts.- Throws:
java.io.IOException
-
-