Class ApplicationConfigurationLicenseStore
- java.lang.Object
-
- com.atlassian.confluence.license.store.ApplicationConfigurationLicenseStore
-
- All Implemented Interfaces:
LicenseStoreInternal
,LicenseStore
@ParametersAreNonnullByDefault public class ApplicationConfigurationLicenseStore extends Object implements LicenseStoreInternal
-
-
Constructor Summary
Constructors Constructor Description ApplicationConfigurationLicenseStore(com.atlassian.config.ApplicationConfiguration store, com.atlassian.extras.api.LicenseManager manager)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clearLicenseFromMemory()
Clears the currently installed from memory, causing it to be re-read from persistent the next timeLicenseStore.retrieve()
is called.void
install(String licenseString)
This delegates toApplicationConfiguration.setProperty(Object, Object)
but the underlying code does not callApplicationConfiguration.save()
and is thus only in memory for the time being.void
installTransiently(String licenseString)
Attempts to install the given license transiently.void
onRemoteEvent(ClusterEventWrapper wrapper)
@NonNull com.atlassian.extras.api.AtlassianLicense
retrieve()
Retrieves the currently installed license.@NonNull Optional<com.atlassian.extras.api.AtlassianLicense>
retrieveOptional()
Only useful during setup.
-
-
-
Method Detail
-
install
public void install(String licenseString)
This delegates toApplicationConfiguration.setProperty(Object, Object)
but the underlying code does not callApplicationConfiguration.save()
and is thus only in memory for the time being.This method does not allow concurrent invocation, thus escaping if one was detected. The reason being is that a concurrent license installation could lead to unexpected behaviour, thus we let the first invocation win and encourage the second one to be re-evaluated before being attempted again.
- Specified by:
install
in interfaceLicenseStore
- Parameters:
licenseString
- the encrypted license- See Also:
LicenseService.validate(String)
-
installTransiently
public void installTransiently(String licenseString)
Description copied from interface:LicenseStore
Attempts to install the given license transiently. It will not publish an event that a new license has been installed. It is provided for testing purposes only.- Specified by:
installTransiently
in interfaceLicenseStore
-
clearLicenseFromMemory
public void clearLicenseFromMemory()
Description copied from interface:LicenseStore
Clears the currently installed from memory, causing it to be re-read from persistent the next timeLicenseStore.retrieve()
is called. It is provided for testing purposes only.- Specified by:
clearLicenseFromMemory
in interfaceLicenseStore
-
retrieve
public @NonNull com.atlassian.extras.api.AtlassianLicense retrieve()
Description copied from interface:LicenseStore
Retrieves the currently installed license.- Specified by:
retrieve
in interfaceLicenseStore
- Returns:
- the currently installed license
-
retrieveOptional
public @NonNull Optional<com.atlassian.extras.api.AtlassianLicense> retrieveOptional() throws LicenseException
Description copied from interface:LicenseStoreInternal
Only useful during setup. At all other times, the license is guaranteed to be non-null.- Specified by:
retrieveOptional
in interfaceLicenseStoreInternal
- Returns:
- the license, if it's set.
- Throws:
LicenseException
- if the license is set, but cannot be parsed, or if the license store lock cannot be acquired.
-
onRemoteEvent
@EventListener public void onRemoteEvent(ClusterEventWrapper wrapper)
-
-