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 Details

  • Method Details

    • setLicense

      @Deprecated public void setLicense(String license)
      Deprecated.
      Use addProductLicense(String, String) instead. Since 3.0.
      Sets the license, going through the regular validation steps as if you used the web UI
      Specified by:
      setLicense in interface com.atlassian.sal.api.license.LicenseHandler
      Parameters:
      license - The license string
    • hostAllowsMultipleLicenses

      public boolean hostAllowsMultipleLicenses()
      Specified by:
      hostAllowsMultipleLicenses in interface com.atlassian.sal.api.license.LicenseHandler
    • hostAllowsCustomProducts

      public boolean hostAllowsCustomProducts()
      Specified by:
      hostAllowsCustomProducts in interface com.atlassian.sal.api.license.LicenseHandler
    • getProductKeys

      public Set<String> getProductKeys()
      Specified by:
      getProductKeys in interface com.atlassian.sal.api.license.LicenseHandler
    • addProductLicense

      public void addProductLicense(@Nonnull String productKey, @Nonnull String license) throws com.atlassian.sal.api.i18n.InvalidOperationException
      Specified by:
      addProductLicense in interface com.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:
      addProductLicenses in interface com.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:
      removeProductLicense in interface com.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:
      validateProductLicense in interface com.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:
      validateMultipleProductLicenses in interface com.atlassian.sal.api.license.LicenseHandler
      Since:
      8.9
    • getServerId

      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 (-).
      Specified by:
      getServerId in interface com.atlassian.sal.api.license.LicenseHandler
      Returns:
      the server ID
      Since:
      2.7
    • getSupportEntitlementNumber

      public String getSupportEntitlementNumber()
      Deprecated.
      use BaseLicenseDetails.getSupportEntitlementNumber() instead
      Gets the Support Entitlement Number (SEN) for the currently running application.
      Specified by:
      getSupportEntitlementNumber in interface com.atlassian.sal.api.license.LicenseHandler
      Returns:
      the Support Entitlement Number, or null if there is no current support entitlement.
    • getAllSupportEntitlementNumbers

      @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.

      Specified by:
      getAllSupportEntitlementNumbers in interface com.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

      @Nullable public String getRawProductLicense(String productKey)
      Specified by:
      getRawProductLicense in interface com.atlassian.sal.api.license.LicenseHandler
    • getProductLicenseDetails

      @Nullable public com.atlassian.sal.api.license.SingleProductLicenseDetailsView getProductLicenseDetails(@Nonnull String productKey)
      Specified by:
      getProductLicenseDetails in interface com.atlassian.sal.api.license.LicenseHandler
    • getAllProductLicenses

      @Nonnull public List<com.atlassian.sal.api.license.MultiProductLicenseDetails> getAllProductLicenses()
      Specified by:
      getAllProductLicenses in interface com.atlassian.sal.api.license.LicenseHandler
    • decodeLicenseDetails

      @Nonnull public com.atlassian.sal.api.license.MultiProductLicenseDetails decodeLicenseDetails(@Nonnull String license)
      Specified by:
      decodeLicenseDetails in interface com.atlassian.sal.api.license.LicenseHandler
    • onLicenseChanged

      @EventListener public void onLicenseChanged(LicenseChangedEvent event)
    • afterPropertiesSet

      public void afterPropertiesSet()
      Specified by:
      afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
    • destroy

      public void destroy()
      Specified by:
      destroy in interface org.springframework.beans.factory.DisposableBean
    • validateApplicationForConfiguration

      protected static LicenseValidationInformation validateApplicationForConfiguration(@Nonnull LicenseValidationInformation licenseValidationInfo, @Nonnull ApplicationConfigurationHelper appConfigHelper, @Nonnull JiraAuthenticationContext jiraAuthenticationContext)