Package com.atlassian.sal.jira.license
Class JiraLicenseHandler
java.lang.Object
com.atlassian.sal.jira.license.JiraLicenseHandler
- All Implemented Interfaces:
com.atlassian.sal.api.license.LicenseHandler,org.springframework.beans.factory.DisposableBean,org.springframework.beans.factory.InitializingBean
public class JiraLicenseHandler
extends Object
implements com.atlassian.sal.api.license.LicenseHandler, org.springframework.beans.factory.InitializingBean, org.springframework.beans.factory.DisposableBean
Jira implementation of license handler
-
Constructor Summary
ConstructorsConstructorDescriptionJiraLicenseHandler(JiraLicenseService jiraLicenseService, JiraLicenseManager jiraLicenseManager, I18nHelper.BeanFactory i18nBeanFactory, ApplicationProperties applicationProperties, com.atlassian.event.api.EventPublisher eventPublisher, JiraAuthenticationContext jiraAuthenticationContext, GlobalPermissionManager permissionManager, GroupManager groupManager) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddProductLicense(String productKey, String license) voidaddProductLicenses(Set<com.atlassian.sal.api.license.RawProductLicense> licenses) voidcom.atlassian.sal.api.license.MultiProductLicenseDetailsdecodeLicenseDetails(String license) voiddestroy()List<com.atlassian.sal.api.license.MultiProductLicenseDetails> Gets the Support Entitlement Numbers (SENs) for all licenses in the currently running application.protected LicenseDetailsgetLicenseDetailsByApplicationKey(com.atlassian.application.api.ApplicationKey application) com.atlassian.sal.api.license.SingleProductLicenseDetailsViewgetProductLicenseDetails(String productKey) getRawProductLicense(String productKey) Gets the server ID of the currently running application.Deprecated.booleanbooleanvoidvoidremoveProductLicense(String productKey) voidsetLicense(String license) Deprecated.UseaddProductLicense(String, String)instead.protected static LicenseValidationInformationvalidateApplicationForConfiguration(LicenseValidationInformation licenseValidationInfo, ApplicationConfigurationHelper appConfigHelper, JiraAuthenticationContext jiraAuthenticationContext) com.atlassian.sal.api.validate.MultipleLicensesValidationResultvalidateMultipleProductLicenses(Set<com.atlassian.sal.api.license.RawProductLicense> rawProductLicenses, Locale locale) com.atlassian.sal.api.validate.ValidationResultvalidateProductLicense(String productKey, String license, Locale locale)
-
Constructor Details
-
JiraLicenseHandler
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)
-
-
Method Details
-
setLicense
Deprecated.UseaddProductLicense(String, String)instead. Since 3.0.Sets the license, going through the regular validation steps as if you used the web UI- Specified by:
setLicensein interfacecom.atlassian.sal.api.license.LicenseHandler- Parameters:
license- The license string
-
hostAllowsMultipleLicenses
public boolean hostAllowsMultipleLicenses()- Specified by:
hostAllowsMultipleLicensesin interfacecom.atlassian.sal.api.license.LicenseHandler
-
hostAllowsCustomProducts
public boolean hostAllowsCustomProducts()- Specified by:
hostAllowsCustomProductsin interfacecom.atlassian.sal.api.license.LicenseHandler
-
getProductKeys
- Specified by:
getProductKeysin interfacecom.atlassian.sal.api.license.LicenseHandler
-
addProductLicense
public void addProductLicense(@Nonnull String productKey, @Nonnull String license) throws com.atlassian.sal.api.i18n.InvalidOperationException - Specified by:
addProductLicensein interfacecom.atlassian.sal.api.license.LicenseHandler- Throws:
com.atlassian.sal.api.i18n.InvalidOperationException
-
addProductLicenses
public void addProductLicenses(@Nonnull Set<com.atlassian.sal.api.license.RawProductLicense> licenses) throws com.atlassian.sal.api.i18n.InvalidOperationException - Specified by:
addProductLicensesin interfacecom.atlassian.sal.api.license.LicenseHandler- Throws:
com.atlassian.sal.api.i18n.InvalidOperationException- Since:
- 8.9
-
removeProductLicense
public void removeProductLicense(@Nonnull String productKey) throws com.atlassian.sal.api.i18n.InvalidOperationException - Specified by:
removeProductLicensein interfacecom.atlassian.sal.api.license.LicenseHandler- Throws:
com.atlassian.sal.api.i18n.InvalidOperationException
-
validateProductLicense
@Nonnull public com.atlassian.sal.api.validate.ValidationResult validateProductLicense(@Nonnull String productKey, @Nonnull String license, @Nullable Locale locale) - Specified by:
validateProductLicensein interfacecom.atlassian.sal.api.license.LicenseHandler
-
validateMultipleProductLicenses
@Nonnull public com.atlassian.sal.api.validate.MultipleLicensesValidationResult validateMultipleProductLicenses(@Nonnull Set<com.atlassian.sal.api.license.RawProductLicense> rawProductLicenses, @Nullable Locale locale) - Specified by:
validateMultipleProductLicensesin interfacecom.atlassian.sal.api.license.LicenseHandler- Since:
- 8.9
-
getServerId
Gets the server ID of the currently running application. The server ID format is four quadruples of alphanumeric characters, each separated by a dash (-).- Specified by:
getServerIdin interfacecom.atlassian.sal.api.license.LicenseHandler- Returns:
- the server ID
- Since:
- 2.7
-
getSupportEntitlementNumber
Deprecated.useBaseLicenseDetails.getSupportEntitlementNumber()insteadGets the Support Entitlement Number (SEN) for the currently running application.- Specified by:
getSupportEntitlementNumberin interfacecom.atlassian.sal.api.license.LicenseHandler- Returns:
- the Support Entitlement Number, or
nullif there is no current support entitlement.
-
getAllSupportEntitlementNumbers
Gets the Support Entitlement Numbers (SENs) for all licenses in the currently running application. The SENs are in an ordered set, guaranteeing to return the SEN in the same order until the installed license state changes.Note that licensed plugin SENs are not included in the results, unless they are being treated as application licenses.
- Specified by:
getAllSupportEntitlementNumbersin interfacecom.atlassian.sal.api.license.LicenseHandler- Returns:
- an ordered set of all the SENs. The set does not contain any empty or null SEN strings. If there is no SEN it will return an empty set.
- Since:
- 7.0
-
getLicenseDetailsByApplicationKey
@Nullable protected LicenseDetails getLicenseDetailsByApplicationKey(@Nonnull com.atlassian.application.api.ApplicationKey application) -
getRawProductLicense
- Specified by:
getRawProductLicensein interfacecom.atlassian.sal.api.license.LicenseHandler
-
getProductLicenseDetails
@Nullable public com.atlassian.sal.api.license.SingleProductLicenseDetailsView getProductLicenseDetails(@Nonnull String productKey) - Specified by:
getProductLicenseDetailsin interfacecom.atlassian.sal.api.license.LicenseHandler
-
getAllProductLicenses
@Nonnull public List<com.atlassian.sal.api.license.MultiProductLicenseDetails> getAllProductLicenses()- Specified by:
getAllProductLicensesin interfacecom.atlassian.sal.api.license.LicenseHandler
-
decodeLicenseDetails
@Nonnull public com.atlassian.sal.api.license.MultiProductLicenseDetails decodeLicenseDetails(@Nonnull String license) - Specified by:
decodeLicenseDetailsin interfacecom.atlassian.sal.api.license.LicenseHandler
-
onLicenseChanged
-
afterPropertiesSet
public void afterPropertiesSet()- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean
-
destroy
public void destroy()- Specified by:
destroyin interfaceorg.springframework.beans.factory.DisposableBean
-
validateApplicationForConfiguration
protected static LicenseValidationInformation validateApplicationForConfiguration(@Nonnull LicenseValidationInformation licenseValidationInfo, @Nonnull ApplicationConfigurationHelper appConfigHelper, @Nonnull JiraAuthenticationContext jiraAuthenticationContext)
-
BaseLicenseDetails.getSupportEntitlementNumber()instead