public class

JiraLicenseHandler

extends Object
implements LicenseHandler DisposableBean InitializingBean
java.lang.Object
   ↳ com.atlassian.sal.jira.license.JiraLicenseHandler

Class Overview

Jira implementation of license handler

Summary

Public Constructors
JiraLicenseHandler(JiraLicenseService jiraLicenseService, JiraLicenseManager jiraLicenseManager, I18nHelper.BeanFactory i18nBeanFactory, ApplicationProperties applicationProperties, EventPublisher eventPublisher, JiraAuthenticationContext jiraAuthenticationContext, GlobalPermissionManager permissionManager, GroupManager groupManager)
Public Methods
void addProductLicense(String productKey, String license)
void afterPropertiesSet()
@Nonnull MultiProductLicenseDetails decodeLicenseDetails(String license)
void destroy()
@Nonnull List<MultiProductLicenseDetails> getAllProductLicenses()
@Nonnull SortedSet<String> getAllSupportEntitlementNumbers()
Gets the Support Entitlement Numbers (SENs) for all licenses in the currently running application.
Set<String> getProductKeys()
@Nullable SingleProductLicenseDetailsView getProductLicenseDetails(String productKey)
@Nullable String getRawProductLicense(String productKey)
String getServerId()
Gets the server ID of the currently running application.
String getSupportEntitlementNumber()
This method is deprecated. use getSupportEntitlementNumber() instead
boolean hostAllowsCustomProducts()
boolean hostAllowsMultipleLicenses()
@EventListener 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
@Nonnull ValidationResult validateProductLicense(String productKey, String license, Locale locale)
Protected Methods
@Nullable LicenseDetails getLicenseDetailsByApplicationKey(ApplicationKey application)
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.atlassian.sal.api.license.LicenseHandler
From interface org.springframework.beans.factory.DisposableBean
From interface org.springframework.beans.factory.InitializingBean

Public Constructors

public JiraLicenseHandler (JiraLicenseService jiraLicenseService, JiraLicenseManager jiraLicenseManager, I18nHelper.BeanFactory i18nBeanFactory, ApplicationProperties applicationProperties, EventPublisher eventPublisher, JiraAuthenticationContext jiraAuthenticationContext, GlobalPermissionManager permissionManager, GroupManager groupManager)

Public Methods

public void addProductLicense (String productKey, String license)

Throws
InvalidOperationException

public void afterPropertiesSet ()

@Nonnull public MultiProductLicenseDetails decodeLicenseDetails (String license)

public void destroy ()

@Nonnull public List<MultiProductLicenseDetails> getAllProductLicenses ()

@Nonnull public SortedSet<String> 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.

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.

public Set<String> getProductKeys ()

@Nullable public SingleProductLicenseDetailsView getProductLicenseDetails (String productKey)

@Nullable public String getRawProductLicense (String productKey)

public String 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 (-).

Returns
  • the server ID

public String getSupportEntitlementNumber ()

This method is deprecated.
use getSupportEntitlementNumber() instead

Gets the Support Entitlement Number (SEN) for the currently running application.

Returns
  • the Support Entitlement Number, or null if there is no current support entitlement.

public boolean hostAllowsCustomProducts ()

public boolean hostAllowsMultipleLicenses ()

@EventListener public void onLicenseChanged (LicenseChangedEvent event)

public void removeProductLicense (String productKey)

Throws
InvalidOperationException

public void setLicense (String license)

Sets the license, going through the regular validation steps as if you used the web UI

Parameters
license The license string

@Nonnull public ValidationResult validateProductLicense (String productKey, String license, Locale locale)

Protected Methods

@Nullable protected LicenseDetails getLicenseDetailsByApplicationKey (ApplicationKey application)