Class EnvironmentVariableUsagePropertyProvider
java.lang.Object
org.axonframework.update.configuration.EnvironmentVariableUsagePropertyProvider
- All Implemented Interfaces:
UsagePropertyProvider
@Internal
public class EnvironmentVariableUsagePropertyProvider
extends Object
implements UsagePropertyProvider
A
UsagePropertyProvider implementation that reads the usage properties from the
environment variables. The priority is half of max integer value, meaning it will be overridden by
the command-line properties provider.- Since:
- 5.0.0
- Author:
- Mitchell Herrijgers
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceA functional interface to supply environment variables. -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCreates a newEnvironmentVariableUsagePropertyProviderthat reads properties from the system environment.EnvironmentVariableUsagePropertyProvider(EnvironmentVariableUsagePropertyProvider.EnvironmentVariableSupplier envSupplier) Creates a newEnvironmentVariableUsagePropertyProviderthat reads properties from the providedEnvironmentVariableUsagePropertyProvider.EnvironmentVariableSupplier. -
Method Summary
-
Field Details
-
DISABLED_KEY
The environment variable key to check if the update checker is disabled.- See Also:
-
URL_KEY
The environment variable key to retrieve the URL for the usage collection endpoint.- See Also:
-
-
Constructor Details
-
EnvironmentVariableUsagePropertyProvider
public EnvironmentVariableUsagePropertyProvider()Creates a newEnvironmentVariableUsagePropertyProviderthat reads properties from the system environment. This constructor usesSystem.getenv()as the default supplier for environment variables. -
EnvironmentVariableUsagePropertyProvider
public EnvironmentVariableUsagePropertyProvider(@Nonnull EnvironmentVariableUsagePropertyProvider.EnvironmentVariableSupplier envSupplier) Creates a newEnvironmentVariableUsagePropertyProviderthat reads properties from the providedEnvironmentVariableUsagePropertyProvider.EnvironmentVariableSupplier. This allows for custom implementations to provide environment variable values, which can be useful for testing or when the defaultSystem.getenv()is not suitable.- Parameters:
envSupplier- The supplier to use for retrieving environment variables.
-
-
Method Details
-
getDisabled
Description copied from interface:UsagePropertyProviderReturns whether the Anonymous Usage Collection is disabled.- Specified by:
getDisabledin interfaceUsagePropertyProvider- Returns:
trueif the collection is disabled,nullif not specified, orfalseif enabled.
-
getUrl
Description copied from interface:UsagePropertyProviderReturns the URL for the Anonymous Usage Collection endpoint.- Specified by:
getUrlin interfaceUsagePropertyProvider- Returns:
- The URL as a
String, ornullif not specified.
-
priority
public int priority()Description copied from interface:UsagePropertyProviderReturns the priority of this property provider. Higher values indicate higher priority. Providers with higher priority will be checked first when retrieving properties.- Specified by:
priorityin interfaceUsagePropertyProvider- Returns:
- An
intrepresenting the priority of this provider.
-