Class UpdateChecker

java.lang.Object
org.axonframework.update.UpdateChecker
All Implemented Interfaces:
Runnable

@Internal public class UpdateChecker extends Object implements Runnable
The UpdateChecker reports Anonymous usage data to AxonIQ periodically. In return, it receives information about available upgrades and vulnerabilities in the AxonIQ libraries used. These upgrades and vulnerabilities are reported to the configured UpdateCheckerReporter.

The task will not run if the user has opted out of anonymous usage reporting. There are three ways to disable the anonymous usage reporting:

  1. Set the environment variable AXONIQ_UPDATE_CHECKER_DISABLED=true.
  2. Run the JVM with -Daxoniq.update-checker.disabled=true.
  3. Create the file $HOME/.axoniq/update-checker.properties with content disabled=true
These methods are listed in order of precedence, meaning that if the environment variable is set, it will take precedence over the JVM property and the file. Explicitly setting the property to disabled=false in a method of higher precedence will ignore the lower precedence disabled.

This class is not intended to be in use during the running of test suites and therefore does not run when it detects one.

Since:
5.0.0
Author:
Mitchell Herrijgers
  • Constructor Details

    • UpdateChecker

      public UpdateChecker(@Nonnull UpdateCheckerHttpClient client, @Nonnull UpdateCheckerReporter reporter, @Nonnull UsagePropertyProvider usagePropertyProvider)
      Creates a new instance of UpdateCheckTask with the given UpdateCheckerHttpClient and UsagePropertyProvider.
      Parameters:
      client - The HTTP client used to send requests to the telemetry endpoint.
      reporter - The reporter that will handle the response from the telemetry endpoint.
      usagePropertyProvider - The property provider used to determine if the update check is disabled.
  • Method Details

    • start

      public void start()
      Starts the anonymous usage reporting task. If the user has opted out of anonymous usage reporting, or a testsuite is detected, the task will not be started.
    • run

      public void run()
      Specified by:
      run in interface Runnable
    • stop

      public void stop()
      Allows the task to be stopped, preventing any further update from being checked. Useful for terminating the task gracefully, for example, when the application is shutting down.
    • isStarted

      public boolean isStarted()
      Checks if the UpdateChecker has been started.
      Returns:
      true if the UpdateChecker has been started, false otherwise.