public class JiraLicenseHandler extends Object implements com.atlassian.sal.api.license.LicenseHandler, org.springframework.beans.factory.InitializingBean, org.springframework.beans.factory.DisposableBean
Constructor and Description |
---|
JiraLicenseHandler(JiraLicenseService jiraLicenseService,
JiraLicenseManager jiraLicenseManager,
I18nHelper.BeanFactory i18nBeanFactory,
ApplicationProperties applicationProperties,
com.atlassian.event.api.EventPublisher eventPublisher,
JiraAuthenticationContext jiraAuthenticationContext,
GlobalPermissionManager permissionManager,
GroupManager groupManager) |
Modifier and Type | Method and Description |
---|---|
void |
addProductLicense(String productKey,
String license) |
void |
afterPropertiesSet() |
com.atlassian.sal.api.license.MultiProductLicenseDetails |
decodeLicenseDetails(String license) |
void |
destroy() |
List<com.atlassian.sal.api.license.MultiProductLicenseDetails> |
getAllProductLicenses() |
SortedSet<String> |
getAllSupportEntitlementNumbers()
Gets the Support Entitlement Numbers (SENs) for all licenses in the currently running application.
|
protected LicenseDetails |
getLicenseDetailsByApplicationKey(com.atlassian.application.api.ApplicationKey application) |
Set<String> |
getProductKeys() |
com.atlassian.sal.api.license.SingleProductLicenseDetailsView |
getProductLicenseDetails(String productKey) |
String |
getRawProductLicense(String productKey) |
String |
getServerId()
Gets the server ID of the currently running application.
|
String |
getSupportEntitlementNumber()
Deprecated.
use
BaseLicenseDetails.getSupportEntitlementNumber() instead |
boolean |
hostAllowsCustomProducts() |
boolean |
hostAllowsMultipleLicenses() |
void |
onLicenseChanged(LicenseChangedEvent event) |
void |
removeProductLicense(String productKey) |
void |
setLicense(String license)
Sets the license, going through the regular validation steps as if you used the web UI
|
com.atlassian.sal.api.validate.ValidationResult |
validateProductLicense(String productKey,
String license,
Locale locale) |
public JiraLicenseHandler(@Nonnull JiraLicenseService jiraLicenseService, @Nonnull JiraLicenseManager jiraLicenseManager, @Nonnull I18nHelper.BeanFactory i18nBeanFactory, @Nonnull ApplicationProperties applicationProperties, @Nonnull com.atlassian.event.api.EventPublisher eventPublisher, @Nonnull JiraAuthenticationContext jiraAuthenticationContext, @Nonnull GlobalPermissionManager permissionManager, @Nonnull GroupManager groupManager)
public void setLicense(String license)
setLicense
in interface com.atlassian.sal.api.license.LicenseHandler
license
- The license stringpublic boolean hostAllowsMultipleLicenses()
hostAllowsMultipleLicenses
in interface com.atlassian.sal.api.license.LicenseHandler
public boolean hostAllowsCustomProducts()
hostAllowsCustomProducts
in interface com.atlassian.sal.api.license.LicenseHandler
public Set<String> getProductKeys()
getProductKeys
in interface com.atlassian.sal.api.license.LicenseHandler
public void addProductLicense(@Nonnull String productKey, @Nonnull String license) throws com.atlassian.sal.api.i18n.InvalidOperationException
addProductLicense
in interface com.atlassian.sal.api.license.LicenseHandler
com.atlassian.sal.api.i18n.InvalidOperationException
public void removeProductLicense(@Nonnull String productKey) throws com.atlassian.sal.api.i18n.InvalidOperationException
removeProductLicense
in interface com.atlassian.sal.api.license.LicenseHandler
com.atlassian.sal.api.i18n.InvalidOperationException
@Nonnull public com.atlassian.sal.api.validate.ValidationResult validateProductLicense(@Nonnull String productKey, @Nonnull String license, @Nullable Locale locale)
validateProductLicense
in interface com.atlassian.sal.api.license.LicenseHandler
public String getServerId()
getServerId
in interface com.atlassian.sal.api.license.LicenseHandler
public String getSupportEntitlementNumber()
BaseLicenseDetails.getSupportEntitlementNumber()
insteadgetSupportEntitlementNumber
in interface com.atlassian.sal.api.license.LicenseHandler
null
if there is no current support entitlement.@Nonnull public SortedSet<String> getAllSupportEntitlementNumbers()
Note that licensed plugin SENs are not included in the results, unless they are being treated as application licenses.
getAllSupportEntitlementNumbers
in interface com.atlassian.sal.api.license.LicenseHandler
@Nullable protected LicenseDetails getLicenseDetailsByApplicationKey(@Nonnull com.atlassian.application.api.ApplicationKey application)
@Nullable public String getRawProductLicense(String productKey)
getRawProductLicense
in interface com.atlassian.sal.api.license.LicenseHandler
@Nullable public com.atlassian.sal.api.license.SingleProductLicenseDetailsView getProductLicenseDetails(@Nonnull String productKey)
getProductLicenseDetails
in interface com.atlassian.sal.api.license.LicenseHandler
@Nonnull public List<com.atlassian.sal.api.license.MultiProductLicenseDetails> getAllProductLicenses()
getAllProductLicenses
in interface com.atlassian.sal.api.license.LicenseHandler
@Nonnull public com.atlassian.sal.api.license.MultiProductLicenseDetails decodeLicenseDetails(@Nonnull String license)
decodeLicenseDetails
in interface com.atlassian.sal.api.license.LicenseHandler
@EventListener public void onLicenseChanged(LicenseChangedEvent event)
public void afterPropertiesSet()
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
public void destroy()
destroy
in interface org.springframework.beans.factory.DisposableBean
Copyright © 2002-2019 Atlassian. All Rights Reserved.