Package org.axonframework.updates
Class UpdateChecker
java.lang.Object
org.axonframework.updates.UpdateChecker
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:
- Set the environment variable
AXONIQ_UPDATE_CHECKER_DISABLED=true. - Run the JVM with
-Daxoniq.update-checker.disabled=true. - Create the file
$HOME/.axoniq/update-checker.propertieswith contentdisabled=true
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:
- 4.12.0
- Author:
- Mitchell Herrijgers
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.axonframework.lifecycle.Lifecycle
Lifecycle.LifecycleHandler, Lifecycle.LifecycleRegistry -
Constructor Summary
ConstructorsConstructorDescriptionUpdateChecker(UpdateCheckerHttpClient client, UpdateCheckerReporter reporter, UsagePropertyProvider usagePropertyProvider) Creates a new instance ofUpdateCheckTaskwith the givenUpdateCheckerHttpClientandUsagePropertyProvider.UpdateChecker(UpdateCheckerHttpClient client, UpdateCheckerReporter reporter, UsagePropertyProvider usagePropertyProvider, ScheduledExecutorService executor) -
Method Summary
Modifier and TypeMethodDescriptionbooleanChecks if the UpdateChecker has been started.voidRegisters the activities to be executed in the various phases of an application's lifecycle.voidrun()voidstart()Starts the anonymous usage reporting task.voidstop()Allows the task to be stopped, preventing any further updates from being checked.
-
Constructor Details
-
UpdateChecker
public UpdateChecker(UpdateCheckerHttpClient client, UpdateCheckerReporter reporter, UsagePropertyProvider usagePropertyProvider) Creates a new instance ofUpdateCheckTaskwith the givenUpdateCheckerHttpClientandUsagePropertyProvider.- 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.
-
UpdateChecker
public UpdateChecker(UpdateCheckerHttpClient client, UpdateCheckerReporter reporter, UsagePropertyProvider usagePropertyProvider, ScheduledExecutorService executor)
-
-
Method Details
-
registerLifecycleHandlers
Description copied from interface:LifecycleRegisters the activities to be executed in the various phases of an application's lifecycle. This could either be at startup, shutdown, or both.- Specified by:
registerLifecycleHandlersin interfaceLifecycle- Parameters:
lifecycle- the lifecycle instance to register the handlers with- See Also:
-
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() -
stop
public void stop()Allows the task to be stopped, preventing any further updates 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:
trueif the UpdateChecker has been started,falseotherwise.
-