public interface JiraLicenseManager
applications
.JiraLicenseService
Modifier and Type | Method and Description |
---|---|
void |
clearAndSetLicense(String licenseString)
Removes all licenses from JIRA and replace them with the new license.
|
LicenseDetails |
clearAndSetLicenseNoEvent(String licenseString)
Removes all licenses from JIRA and replace them with the new license without raising an event.
|
void |
confirmProceedUnderEvaluationTerms(String userName)
Records that the user has acknowledged that one or more of their licenses is out of maintenance.
|
Set<com.atlassian.application.api.ApplicationKey> |
getAllLicensedApplicationKeys()
Retrieve a Set of all installed product license's keys in this instance.
|
io.atlassian.fugue.Option<LicenseDetails> |
getLicense(com.atlassian.application.api.ApplicationKey key)
Return the
LicenseDetails associated with the passed
ApplicationKey . |
LicenseDetails |
getLicense(String licenseString)
Returns the
LicenseDetails corresponding to the given license string after decoding, or throws an
exception if the license string is invalid or cannot be decoded. |
Iterable<LicenseDetails> |
getLicenses()
Retrieve a collection of all product 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 |
hasLicenseTooOldForBuildConfirmationBeenDone()
Returns true if the support/maintenance period for this JIRA instance has been exceeded and an instance admin
has acknowledged this fact.
|
boolean |
isDecodeable(String licenseString)
This returns true if the provided licence string can be decoded into a valid licence
|
boolean |
isLicensed(com.atlassian.application.api.ApplicationKey key)
Returns
true if the given application is licensed. |
boolean |
isLicenseSet()
Returns true if at least one license has been
set . |
void |
removeLicense(com.atlassian.application.api.ApplicationKey application)
Removes the license that grants access to the passed application.
|
void |
removeLicenses(Iterable<? extends LicenseDetails> licenses)
Removes passed licenses.
|
LicenseDetails |
setLicense(String licenseString)
Sets the current license of this instance.
|
LicenseDetails |
setLicenseNoEvent(String licenseString)
Sets the current license of this instance.
|
Set<LicenseDetails> |
setLicenses(Collection<String> licenseStrings)
Sets the current licenses of this instance.
|
void |
subscribeToClearCache(java.util.function.Consumer<Void> consumer)
Subscribe a
Consumer to be called after this manager's cache has been cleared. |
void |
unSubscribeFromClearCache(java.util.function.Consumer<Void> consumer)
Un-subscribe a
Consumer from being called after clearing of this manager's cache. |
@Nonnull String getServerId()
@Nonnull LicenseDetails getLicense(@Nonnull String licenseString)
LicenseDetails
corresponding to the given license string after decoding, or throws an
exception if the license string is invalid or cannot be decoded.licenseString
- the license string.LicenseDetails
for license encoded by the given string.com.atlassian.extras.api.LicenseException
- if the stored license string cannot be decodedisDecodeable(String)
,
StringUtils.isBlank(CharSequence)
boolean isLicensed(@Nonnull com.atlassian.application.api.ApplicationKey key)
true
if the given application is licensed.key
- the applicationtrue
if the given application is licensed.boolean isDecodeable(String licenseString)
licenseString
- the license stringLicenseDetails setLicense(String licenseString)
Note that this method will fire a LicenseChangedEvent
.
licenseString
- the license stringlicense
is valid.Set<LicenseDetails> setLicenses(Collection<String> licenseStrings)
Note that this method will fire a LicenseChangedEvent
.
licenseStrings
- the list of license string to set.licenseStrings
are valid.LicenseDetails setLicenseNoEvent(String licenseString)
This is a special version of setLicense(String)
that will not fire any event and is purely for use
during a Data Import.
licenseString
- the license stringlicense
is valid.void confirmProceedUnderEvaluationTerms(String userName)
userName
- the name of the user that made the confirmation.hasLicenseTooOldForBuildConfirmationBeenDone()
boolean hasLicenseTooOldForBuildConfirmationBeenDone()
true
if the licenses in use are too old for the current build number and this instance is in
a maintenance grace period.confirmProceedUnderEvaluationTerms(String)
@Nonnull Iterable<LicenseDetails> getLicenses()
In pre-7.0 JIRA this method returns an iterable containing at most one license.
@Nonnull Set<com.atlassian.application.api.ApplicationKey> getAllLicensedApplicationKeys()
SortedSet<String> getSupportEntitlementNumbers()
SortedSet
of the SEN. The order of SENs in the set will be maintained as far as the
set of installed licenses doesn't change.LicenseDetails.getSupportEntitlementNumber()
io.atlassian.fugue.Option<LicenseDetails> getLicense(@Nonnull com.atlassian.application.api.ApplicationKey key)
LicenseDetails
associated with the passed
ApplicationKey
.key
- the ApplicationKey
to query.LicenseDetails
associated with the passed application key or
Option.none()
if no such application exists.void clearAndSetLicense(String licenseString)
IllegalArgumentException
.IllegalArgumentException
- if the license cannot be decoded.LicenseDetails clearAndSetLicenseNoEvent(String licenseString)
IllegalArgumentException
.IllegalArgumentException
- if the license cannot be decoded.void removeLicense(@Nonnull com.atlassian.application.api.ApplicationKey application) throws IllegalStateException
application
- the key of the application to check.IllegalStateException
- when removal of a license that would leave JIRA inoperable. For example,
removing the last license is not allowed.void removeLicenses(@Nonnull Iterable<? extends LicenseDetails> licenses) throws IllegalStateException
licenses
- to be removedIllegalStateException
- when removal of licenses that would leave JIRA inoperable. For example,
removing the last license is not allowed.boolean isLicenseSet()
set
.JiraLicenseService.isLicenseSet()
@Internal void subscribeToClearCache(@Nonnull java.util.function.Consumer<Void> consumer)
Consumer
to be called after this manager's cache has been cleared.consumer
- Consumer
that will be called after this manager's cache has been cleared.unSubscribeFromClearCache(Consumer)
@Internal void unSubscribeFromClearCache(@Nonnull java.util.function.Consumer<Void> consumer)
Consumer
from being called after clearing of this manager's cache.consumer
- Consumer
to be un-subscribed from this manager.subscribeToClearCache(Consumer)
Copyright © 2002-2021 Atlassian. All Rights Reserved.