public class JiraLicenseManagerImpl extends Object implements JiraLicenseManager, CachingComponent
| Constructor and Description |
|---|
JiraLicenseManagerImpl(com.atlassian.license.SIDManager sidManager,
com.atlassian.event.api.EventPublisher eventPublisher,
MultiLicenseStore multiLicenseStore,
LicenseDetailsFactory licenseDetailsFactory,
ApplicationProperties applicationProperties,
com.atlassian.cache.CacheManager cacheManager) |
| 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 |
clearCache()
Clear the cache within the component.
|
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 application)
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. |
List<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 application)
Returns
true if the given application is licensed. |
boolean |
isLicenseSet()
Returns true if at least one license has been
set. |
void |
onCacheClear(ClearCacheEvent clearEvent) |
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. |
public JiraLicenseManagerImpl(com.atlassian.license.SIDManager sidManager,
com.atlassian.event.api.EventPublisher eventPublisher,
MultiLicenseStore multiLicenseStore,
LicenseDetailsFactory licenseDetailsFactory,
ApplicationProperties applicationProperties,
com.atlassian.cache.CacheManager cacheManager)
@Nonnull public String getServerId()
JiraLicenseManagergetServerId in interface JiraLicenseManager@Nonnull public LicenseDetails getLicense(@Nonnull String licenseString)
JiraLicenseManagerLicenseDetails corresponding to the given license string after decoding, or throws an
exception if the license string is invalid or cannot be decoded.getLicense in interface JiraLicenseManagerlicenseString - the license string.LicenseDetails for license encoded by the given string.JiraLicenseManager.isDecodeable(String),
StringUtils.isBlank(CharSequence)@Nonnull public List<LicenseDetails> getLicenses()
JiraLicenseManagerIn pre-7.0 JIRA this method returns an iterable containing at most one license.
getLicenses in interface JiraLicenseManager@Nonnull public Set<com.atlassian.application.api.ApplicationKey> getAllLicensedApplicationKeys()
JiraLicenseManagergetAllLicensedApplicationKeys in interface JiraLicenseManagerpublic SortedSet<String> getSupportEntitlementNumbers()
JiraLicenseManagergetSupportEntitlementNumbers in interface JiraLicenseManagerSortedSet 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()public io.atlassian.fugue.Option<LicenseDetails> getLicense(@Nonnull com.atlassian.application.api.ApplicationKey application)
JiraLicenseManagerLicenseDetails associated with the passed
ApplicationKey.getLicense in interface JiraLicenseManagerapplication - the ApplicationKey to query.LicenseDetails associated with the passed application key or
Option.none() if no such application exists.public boolean isLicensed(@Nonnull com.atlassian.application.api.ApplicationKey application)
JiraLicenseManagertrue if the given application is licensed.isLicensed in interface JiraLicenseManagerapplication - the applicationtrue if the given application is licensed.public boolean isDecodeable(String licenseString)
JiraLicenseManagerisDecodeable in interface JiraLicenseManagerlicenseString - the license stringpublic LicenseDetails setLicense(String licenseString)
JiraLicenseManager
Note that this method will fire a LicenseChangedEvent.
setLicense in interface JiraLicenseManagerlicenseString - the license stringlicense is valid.public Set<LicenseDetails> setLicenses(Collection<String> licenseStrings)
JiraLicenseManager
Note that this method will fire a LicenseChangedEvent.
setLicenses in interface JiraLicenseManagerlicenseStrings - the list of license string to set.IllegalArgumentException - if any of is invalid.com.atlassian.extras.api.LicenseException - if any of was null or could not be decodedpublic LicenseDetails setLicenseNoEvent(String licenseString)
JiraLicenseManager
This is a special version of JiraLicenseManager.setLicense(String) that will not fire any event and is purely for use
during a Data Import.
setLicenseNoEvent in interface JiraLicenseManagerlicenseString - the license stringlicense is valid.public void removeLicense(@Nonnull com.atlassian.application.api.ApplicationKey application)
JiraLicenseManagerremoveLicense in interface JiraLicenseManagerapplication - the key of the application to check.public void removeLicenses(@Nonnull Iterable<? extends LicenseDetails> licenses)
JiraLicenseManagerremoveLicenses in interface JiraLicenseManagerlicenses - to be removedpublic boolean isLicenseSet()
JiraLicenseManagerset.isLicenseSet in interface JiraLicenseManagerJiraLicenseService.isLicenseSet()public void clearAndSetLicense(String licenseString)
JiraLicenseManagerIllegalArgumentException.clearAndSetLicense in interface JiraLicenseManagerpublic LicenseDetails clearAndSetLicenseNoEvent(String licenseString)
JiraLicenseManagerIllegalArgumentException.clearAndSetLicenseNoEvent in interface JiraLicenseManager@EventListener public void onCacheClear(ClearCacheEvent clearEvent)
public void confirmProceedUnderEvaluationTerms(String userName)
JiraLicenseManagerconfirmProceedUnderEvaluationTerms in interface JiraLicenseManageruserName - the name of the user that made the confirmation.JiraLicenseManager.hasLicenseTooOldForBuildConfirmationBeenDone()public boolean hasLicenseTooOldForBuildConfirmationBeenDone()
JiraLicenseManagerhasLicenseTooOldForBuildConfirmationBeenDone in interface JiraLicenseManagertrue if the licenses in use are too old for the current build number and this instance is in
a maintenance grace period.JiraLicenseManager.confirmProceedUnderEvaluationTerms(String)public void subscribeToClearCache(@Nonnull java.util.function.Consumer<Void> consumer)
JiraLicenseManagerConsumer to be called after this manager's cache has been cleared.subscribeToClearCache in interface JiraLicenseManagerconsumer - Consumer that will be called after this manager's cache has been cleared.JiraLicenseManager.unSubscribeFromClearCache(Consumer)public void unSubscribeFromClearCache(@Nonnull java.util.function.Consumer<Void> consumer)
JiraLicenseManagerConsumer from being called after clearing of this manager's cache.unSubscribeFromClearCache in interface JiraLicenseManagerconsumer - Consumer to be un-subscribed from this manager.JiraLicenseManager.subscribeToClearCache(Consumer)public void clearCache()
CachingComponentclearCache in interface CachingComponentCopyright © 2002-2024 Atlassian. All Rights Reserved.