Package lu.kbra.modelizer_next.bootstrap
Class BootstrapRuntime
java.lang.Object
lu.kbra.modelizer_next.bootstrap.BootstrapRuntime
- All Implemented Interfaces:
UpdateRuntime
Runtime coordinator that checks updates, prepares the installed application, and launches it.
-
Nested Class Summary
Nested classes/interfaces inherited from interface lu.kbra.modelizer_next.bootstrap.UpdateRuntime
UpdateRuntime.UpdatePreparation -
Method Summary
Modifier and TypeMethodDescriptionstatic BootstrapRuntimeStarts the bootstrap sequence.Checks the for updates.longDeletes installed update folders that are no longer needed.Returns the bootstrap config.com.fasterxml.jackson.databind.JsonNodeReturns the bootstrap JSON.Returns the current application version.Returns the force jar name during bootstrap/update processing.Returns the installed updates directory.longReturns the installed updates disk usage bytes.intReturns the installed updates file count.static BootstrapRuntimeReturns the instance during bootstrap/update processing.Returns the selected channel during bootstrap/update processing.booleaninstallUpdateAndRestart(Component parentComponent, AvailableUpdate update, UpdateRuntime.UpdatePreparation preparation) Installs the update and restart.static booleanisActive()Checks whether active is enabled or applies during bootstrap/update processing.booleanChecks whether auto check updates is enabled or applies.booleanChecks whether automatic update checks enabled by property is enabled or applies.booleanChecks whether available is enabled or applies during bootstrap/update processing.voidLaunches the installed application.voidsetAutoCheckUpdates(boolean enabled) Sets the auto check updates.voidsetSelectedChannel(UpdateChannel updateChannel) Sets the selected channel during bootstrap/update processing.
-
Method Details
-
bootstrap
Starts the bootstrap sequence.- Returns:
- the bootstrap result
- Throws:
IOException- if the operation cannot be completed
-
getInstance
Returns the instance during bootstrap/update processing.- Returns:
- the instance
-
isActive
public static boolean isActive()Checks whether active is enabled or applies during bootstrap/update processing.- Returns:
trueif active is enabled or applies; otherwisefalse
-
checkForUpdates
Checks the for updates.- Specified by:
checkForUpdatesin interfaceUpdateRuntime- Returns:
- the check for updates result
- Throws:
IOException- if the operation cannot be completed
-
getInstalledUpdatesDiskUsageBytes
Returns the installed updates disk usage bytes.- Specified by:
getInstalledUpdatesDiskUsageBytesin interfaceUpdateRuntime- Returns:
- the installed updates disk usage bytes
- Throws:
IOException- if the operation cannot be completed
-
getInstalledUpdatesFileCount
Returns the installed updates file count.- Specified by:
getInstalledUpdatesFileCountin interfaceUpdateRuntime- Returns:
- the installed updates file count
- Throws:
IOException- if the operation cannot be completed
-
getInstalledUpdatesDirectory
Returns the installed updates directory.- Specified by:
getInstalledUpdatesDirectoryin interfaceUpdateRuntime- Returns:
- the installed updates directory
-
freeUnusedInstalledUpdates
Deletes installed update folders that are no longer needed.- Specified by:
freeUnusedInstalledUpdatesin interfaceUpdateRuntime- Returns:
- the free unused installed updates result
- Throws:
IOException- if the operation cannot be completed
-
getBootstrapConfig
Returns the bootstrap config.- Specified by:
getBootstrapConfigin interfaceUpdateRuntime- Returns:
- the bootstrap config
-
getBootstrapJson
public com.fasterxml.jackson.databind.JsonNode getBootstrapJson()Returns the bootstrap JSON.- Specified by:
getBootstrapJsonin interfaceUpdateRuntime- Returns:
- the bootstrap JSON
-
getCurrentApplicationVersion
Returns the current application version.- Specified by:
getCurrentApplicationVersionin interfaceUpdateRuntime- Returns:
- the current application version
-
getSelectedChannel
Returns the selected channel during bootstrap/update processing.- Specified by:
getSelectedChannelin interfaceUpdateRuntime- Returns:
- the selected channel
-
installUpdateAndRestart
public boolean installUpdateAndRestart(Component parentComponent, AvailableUpdate update, UpdateRuntime.UpdatePreparation preparation) throws IOException Installs the update and restart.- Specified by:
installUpdateAndRestartin interfaceUpdateRuntime- Parameters:
parentComponent- parent component value used by the operationupdate- update metadata to download or installpreparation- preparation value used by the operation- Returns:
truewhen the condition is met; otherwisefalse- Throws:
IOException- if the operation cannot be completed
-
isAutoCheckUpdates
public boolean isAutoCheckUpdates()Checks whether auto check updates is enabled or applies.- Specified by:
isAutoCheckUpdatesin interfaceUpdateRuntime- Returns:
trueif auto check updates is enabled or applies; otherwisefalse
-
isAutomaticUpdateChecksEnabledByProperty
public boolean isAutomaticUpdateChecksEnabledByProperty()Checks whether automatic update checks enabled by property is enabled or applies.- Specified by:
isAutomaticUpdateChecksEnabledByPropertyin interfaceUpdateRuntime- Returns:
trueif automatic update checks enabled by property is enabled or applies; otherwisefalse
-
isAvailable
public boolean isAvailable()Checks whether available is enabled or applies during bootstrap/update processing.- Specified by:
isAvailablein interfaceUpdateRuntime- Returns:
trueif available is enabled or applies; otherwisefalse
-
getForceJarName
Returns the force jar name during bootstrap/update processing.- Returns:
- the force jar name
-
launch
Launches the installed application.- Parameters:
args- command-line arguments supplied by the launchertoBeOpened- to be opened value used by the operation- Throws:
Exception- if the operation cannot be completed
-
setAutoCheckUpdates
public void setAutoCheckUpdates(boolean enabled) Sets the auto check updates.- Specified by:
setAutoCheckUpdatesin interfaceUpdateRuntime- Parameters:
enabled- whether enabled is enabled
-
setSelectedChannel
Sets the selected channel during bootstrap/update processing.- Specified by:
setSelectedChannelin interfaceUpdateRuntime- Parameters:
updateChannel- update channel value used by the operation
-