public class JiraLicenseServiceImpl extends Object implements JiraLicenseUpdaterService
JiraLicenseService.ValidationResult| Constructor and Description |
|---|
JiraLicenseServiceImpl(JiraLicenseManager licenseManager,
ClusterManager clusterManager,
com.atlassian.application.api.ApplicationManager applicationManager,
UserManager userManager,
HelpUrls helpUrls) |
| Modifier and Type | Method and Description |
|---|---|
Optional<LicenseDetails> |
getLicenseDetails(String licenseString,
I18nHelper i18nHelper) |
Iterable<LicenseDetails> |
getLicenses()
Retrieve a list of all products licenses installed in this instance.
|
String |
getServerId()
Returns the server ID of this JIRA instance, creating it if necessary.
|
SortedSet<String> |
getSupportEntitlementNumbers()
Retrieves the SEN (Support Entitlement Number) of all installed licenses and orders them in a consistent manner.
|
boolean |
isDataCenterLicensed()
Returns whether or not Jira is licensed for DataCenter.
|
boolean |
isLicenseSet()
Returns true if at least one license has been
set. |
void |
removeLicenses(Iterable<? extends LicenseDetails> licensesToRemove)
Removes provided licenses.
|
LicenseDetails |
setLicense(JiraLicenseService.ValidationResult validationResult)
Sets the license from the given ValidationResult as the current JIRA license.
|
LicenseDetails |
setLicenseNoEvent(JiraLicenseService.ValidationResult validationResult)
Sets the license from the given ValidationResult as the current JIRA license.
|
JiraLicenseService.ValidationResult |
validate(com.atlassian.application.api.ApplicationKey applicationKey,
String licenseString,
I18nHelper i18nHelper)
Validates a JIRA application license string in preparation for setting that string as the license for the
specified application.
|
Iterable<JiraLicenseService.ValidationResult> |
validate(I18nHelper i18nHelper)
Checks that all
existing licenses are valid. |
Iterable<JiraLicenseService.ValidationResult> |
validate(I18nHelper i18n,
Iterable<String> licenses)
Validates each license String provided in preparation for setting them.
|
JiraLicenseService.ValidationResult |
validate(I18nHelper i18nHelper,
String licenseString)
Performs minimum validation on the license.
|
JiraLicenseService.ValidationResult |
validateApplicationLicense(I18nHelper i18nHelper,
String licenseString)
|
Collection<LicenseValidationInformation> |
validateMultiLicenses(Collection<LicenseValidationInformation> licenseValidationInformations,
I18nHelper i18nHelper)
Validates a JIRA application multiple license string in preparation for setting that string as the license for the
specified application.
|
public JiraLicenseServiceImpl(@Nonnull JiraLicenseManager licenseManager, @Nonnull ClusterManager clusterManager, @Nonnull com.atlassian.application.api.ApplicationManager applicationManager, @Nonnull UserManager userManager, @Nonnull HelpUrls helpUrls)
@Nonnull public String getServerId()
JiraLicenseServicegetServerId in interface JiraLicenseServicepublic JiraLicenseService.ValidationResult validate(@Nonnull I18nHelper i18nHelper, @Nonnull String licenseString)
JiraLicenseServicevalidate in interface JiraLicenseServicei18nHelper - the helper for i18nlicenseString - the license to validateJiraLicenseService#validate(com.atlassian.application.api.ApplicationKey, String, com.atlassian.jira.util.I18nHelper)}.public JiraLicenseService.ValidationResult validate(@Nonnull com.atlassian.application.api.ApplicationKey applicationKey, @Nonnull String licenseString, @Nonnull I18nHelper i18nHelper)
JiraLicenseServicevalidate in interface JiraLicenseServiceapplicationKey - the application key this license is forlicenseString - the license to validatei18nHelper - the helper for i18npublic Collection<LicenseValidationInformation> validateMultiLicenses(@Nonnull Collection<LicenseValidationInformation> licenseValidationInformations, @Nonnull I18nHelper i18nHelper)
JiraLicenseServicevalidateMultiLicenses in interface JiraLicenseServicelicenseValidationInformations - the license validation information of the licenses that will get validatedi18nHelper - the helper for i18npublic Optional<LicenseDetails> getLicenseDetails(@Nullable String licenseString, @Nonnull I18nHelper i18nHelper)
getLicenseDetails in interface JiraLicenseServicelicenseString - the license to validatei18nHelper - the helper for i18n@Deprecated public JiraLicenseService.ValidationResult validateApplicationLicense(@Nonnull I18nHelper i18nHelper, @Nonnull String licenseString)
validate(com.atlassian.application.api.ApplicationKey, java.lang.String, com.atlassian.jira.util.I18nHelper)JiraLicenseService
It is recommended that JiraLicenseService.validate(com.atlassian.application.api.ApplicationKey, java.lang.String, com.atlassian.jira.util.I18nHelper)
is used instead of this method.
validateApplicationLicense in interface JiraLicenseServicei18nHelper - i18n helper used for messaging.licenseString - the license to validatepublic SortedSet<String> getSupportEntitlementNumbers()
JiraLicenseServicegetSupportEntitlementNumbers in interface JiraLicenseServiceSortedSet of the SEN. The ordere of SENs in the set will be maintained as far as the
consistency of the licenses installed doesn't change.LicenseDetails.getSupportEntitlementNumber()@Nonnull public Iterable<JiraLicenseService.ValidationResult> validate(I18nHelper i18nHelper)
JiraLicenseServiceexisting licenses are valid.validate in interface JiraLicenseServicepublic Iterable<JiraLicenseService.ValidationResult> validate(I18nHelper i18n, Iterable<String> licenses)
JiraLicenseServicevalidate in interface JiraLicenseServicei18n - the helper for i18n - used to populate the error messageslicenses - the licenses to validatepublic boolean isLicenseSet()
JiraLicenseServiceset.isLicenseSet in interface JiraLicenseServiceJiraLicenseManager.isLicenseSet()public boolean isDataCenterLicensed()
JiraLicenseServiceisDataCenterLicensed in interface JiraLicenseServicepublic LicenseDetails setLicense(JiraLicenseService.ValidationResult validationResult)
JiraLicenseUpdaterServicesetLicense in interface JiraLicenseUpdaterServicevalidationResult - the validation result to get the license from.public LicenseDetails setLicenseNoEvent(JiraLicenseService.ValidationResult validationResult)
JiraLicenseUpdaterServiceNote that this is a special method specifically for resetting a license during Data Import which is why it will specifically not fire an Event.
setLicenseNoEvent in interface JiraLicenseUpdaterServicevalidationResult - the validation result to get the license from.public void removeLicenses(Iterable<? extends LicenseDetails> licensesToRemove)
JiraLicenseUpdaterServiceremoveLicenses in interface JiraLicenseUpdaterServicelicensesToRemove - the licenses that are going to be removed.@Nonnull public Iterable<LicenseDetails> getLicenses()
JiraLicenseServiceIn JIRA 6.3 this method returns an iterable containing at most one license. In later versions it may contain more.
getLicenses in interface JiraLicenseServiceCopyright © 2002-2022 Atlassian. All Rights Reserved.