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 |
---|---|
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 |
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)
Validates the passed license string against all installed JIRA applications in preparation for setting a new JIRA
application license.
|
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()
JiraLicenseService
getServerId
in interface JiraLicenseService
public JiraLicenseService.ValidationResult validate(@Nonnull I18nHelper i18nHelper, @Nonnull String licenseString)
JiraLicenseService
validate
in interface JiraLicenseService
i18nHelper
- 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)
JiraLicenseService
validate
in interface JiraLicenseService
applicationKey
- the application key this license is forlicenseString
- the license to validatei18nHelper
- the helper for i18npublic JiraLicenseService.ValidationResult validateApplicationLicense(@Nonnull I18nHelper i18nHelper, @Nonnull String licenseString)
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 JiraLicenseService
i18nHelper
- i18n helper used for messaging.licenseString
- the license to validatepublic SortedSet<String> getSupportEntitlementNumbers()
JiraLicenseService
getSupportEntitlementNumbers
in interface JiraLicenseService
SortedSet
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)
JiraLicenseService
existing licenses
are valid
.validate
in interface JiraLicenseService
public Iterable<JiraLicenseService.ValidationResult> validate(I18nHelper i18n, Iterable<String> licenses)
JiraLicenseService
validate
in interface JiraLicenseService
i18n
- the helper for i18n - used to populate the error messageslicenses
- the licenses to validatepublic boolean isLicenseSet()
JiraLicenseService
set
.isLicenseSet
in interface JiraLicenseService
JiraLicenseManager.isLicenseSet()
public LicenseDetails setLicense(JiraLicenseService.ValidationResult validationResult)
JiraLicenseUpdaterService
setLicense
in interface JiraLicenseUpdaterService
validationResult
- the validation result to get the license from.public LicenseDetails setLicenseNoEvent(JiraLicenseService.ValidationResult validationResult)
JiraLicenseUpdaterService
Note 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 JiraLicenseUpdaterService
validationResult
- the validation result to get the license from.public void removeLicenses(Iterable<? extends LicenseDetails> licensesToRemove)
JiraLicenseUpdaterService
removeLicenses
in interface JiraLicenseUpdaterService
licensesToRemove
- the licenses that are going to be removed.@Nonnull public Iterable<LicenseDetails> getLicenses()
JiraLicenseService
In JIRA 6.3 this method returns an iterable containing at most one license. In later versions it may contain more.
getLicenses
in interface JiraLicenseService
Copyright © 2002-2017 Atlassian. All Rights Reserved.