public class RenaissanceSwitchingMultiLicenseStore extends Object implements MultiLicenseStore
MultiLicenseStore
that switches its behaviour based on if renaissance migration has run or not. When the
migration has run it will only look at the production data store in the ProductLicense
table. When migration
has not run it will also return the licenses from the JIRA 6.3.x and UPM SD locations. We need to do this because
there is code that relies on being able to read the licenses before the migration has run
(e.g. JIRA will only run the upgrade when all the licenses are in maintenance).Constructor and Description |
---|
RenaissanceSwitchingMultiLicenseStore(LegacyMultiLicenseStore jira6xStore,
MultiLicenseStoreImpl jira7xStore,
RenaissanceMigrationStatus predicate) |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Removes all licenses from JIRA.
|
void |
confirmProceedUnderEvaluationTerms(String userName)
This will confirm that user has agreed to proceed under Evaluation terms, typically when the license is too old
for the current JIRA build.
|
void |
onClearCache(ClearCacheEvent dataImport) |
void |
resetOldBuildConfirmation()
Resets persisted information about license in use being too old for current build.
|
Iterable<String> |
retrieve()
Retrieves all product license strings.
|
String |
retrieveServerId()
Gets the server ID from the persistence backend
|
void |
store(Iterable<String> licenses)
Persists a new state for all licenses.
|
void |
storeServerId(String serverId)
Stores the server ID to the persistent backend
|
@Inject public RenaissanceSwitchingMultiLicenseStore(LegacyMultiLicenseStore jira6xStore, MultiLicenseStoreImpl jira7xStore, RenaissanceMigrationStatus predicate)
@Nonnull public Iterable<String> retrieve()
MultiLicenseStore
retrieve
in interface MultiLicenseStore
public void store(@Nonnull Iterable<String> licenses)
MultiLicenseStore
This method will do some cursory checking of inputs but will still store most invalid licenses if requested. The caller should test licenses strings for validity before attempting to store them. This method may throw an unspecified runtime exception if the argument is invalid, for example if it is null, empty, or contains a null element.
Until the application roles dark feature is enabled, MultiLicenseStores may operate in legacy mode. In legacy mode a single license is arbitrarily chosen and stored in the backing legacy license store, typically as an ApplicationProperties property. It is the caller's responsibility to ensure that no more than one license is attempted to be stored when in legacy mode.
store
in interface MultiLicenseStore
licenses
- the license strings to storepublic String retrieveServerId()
MultiLicenseStore
retrieveServerId
in interface MultiLicenseStore
null
if not foundpublic void storeServerId(String serverId)
MultiLicenseStore
storeServerId
in interface MultiLicenseStore
serverId
- the server ID to storepublic void resetOldBuildConfirmation()
MultiLicenseStore
resetOldBuildConfirmation
in interface MultiLicenseStore
public void confirmProceedUnderEvaluationTerms(String userName)
MultiLicenseStore
confirmProceedUnderEvaluationTerms
in interface MultiLicenseStore
userName
- the name of the user that made the confirmationpublic void clear()
MultiLicenseStore
clear
in interface MultiLicenseStore
@EventListener public void onClearCache(ClearCacheEvent dataImport)
Copyright © 2002-2021 Atlassian. All Rights Reserved.