Class AbstractBootstrapRuntime

java.lang.Object
lu.kbra.modelizer_next.bootstrap.AbstractBootstrapRuntime

public class AbstractBootstrapRuntime extends Object
Base implementation of update runtime behavior shared with application-side update checks.
  • Field Details

  • Constructor Details

    • AbstractBootstrapRuntime

      protected AbstractBootstrapRuntime()
      Creates an abstract bootstrap runtime instance.
  • Method Details

    • getInstance

      public static AbstractBootstrapRuntime 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:
      true if active is enabled or applies; otherwise false
    • checkForUpdates

      public AvailableUpdate checkForUpdates() throws IOException
      Checks the for updates.
      Returns:
      the check for updates result
      Throws:
      IOException - if the operation cannot be completed
    • getInstalledUpdatesDiskUsageBytes

      public long getInstalledUpdatesDiskUsageBytes() throws IOException
      Returns the installed updates disk usage bytes.
      Returns:
      the installed updates disk usage bytes
      Throws:
      IOException - if the operation cannot be completed
    • getInstalledUpdatesFileCount

      public int getInstalledUpdatesFileCount() throws IOException
      Returns the installed updates file count.
      Returns:
      the installed updates file count
      Throws:
      IOException - if the operation cannot be completed
    • getInstalledUpdatesDirectory

      public Path getInstalledUpdatesDirectory()
      Returns the installed updates directory.
      Returns:
      the installed updates directory
    • freeUnusedInstalledUpdates

      public long freeUnusedInstalledUpdates() throws IOException
      Deletes installed update folders that are no longer needed.
      Returns:
      the free unused installed updates result
      Throws:
      IOException - if the operation cannot be completed
    • getCurrentApplicationVersion

      public String getCurrentApplicationVersion()
      Returns the current application version.
      Returns:
      the current application version
    • getSelectedChannel

      public UpdateChannel getSelectedChannel()
      Returns the selected channel during bootstrap/update processing.
      Returns:
      the selected channel
    • installUpdateAndExit

      public boolean installUpdateAndExit(Component parentComponent, AvailableUpdate update, AbstractBootstrapRuntime.UpdatePreparation preparation) throws IOException
      Installs the update and exit.
      Parameters:
      parentComponent - parent component value used by the operation
      update - update metadata to download or install
      preparation - preparation value used by the operation
      Returns:
      true when the condition is met; otherwise false
      Throws:
      IOException - if the operation cannot be completed
    • isAutoCheckUpdates

      public boolean isAutoCheckUpdates()
      Checks whether auto check updates is enabled or applies.
      Returns:
      true if auto check updates is enabled or applies; otherwise false
    • isAutomaticUpdateChecksEnabledByProperty

      public boolean isAutomaticUpdateChecksEnabledByProperty()
      Checks whether automatic update checks enabled by property is enabled or applies.
      Returns:
      true if automatic update checks enabled by property is enabled or applies; otherwise false
    • setAutoCheckUpdates

      public void setAutoCheckUpdates(boolean enabled)
      Sets the auto check updates.
      Parameters:
      enabled - whether enabled is enabled
    • setSelectedChannel

      public void setSelectedChannel(UpdateChannel updateChannel)
      Sets the selected channel during bootstrap/update processing.
      Parameters:
      updateChannel - update channel value used by the operation