Class Jira6xServiceDeskPluginEncodedLicenseSupplier

java.lang.Object
com.atlassian.jira.license.Jira6xServiceDeskPluginEncodedLicenseSupplier
All Implemented Interfaces:
com.atlassian.cache.Supplier<io.atlassian.fugue.Option<String>>, Supplier<io.atlassian.fugue.Option<String>>

public class Jira6xServiceDeskPluginEncodedLicenseSupplier extends Object implements com.atlassian.cache.Supplier<io.atlassian.fugue.Option<String>>
Supplies a encoded plugin license for Service Desk version 1 or 2.

This class is intended to be used solely for the purposes of checking & migrating pre-7.0 Service Desk licenses. It is not a general-purposes SD license supplier, instead, see {@link JiraLicenseManager#getLicense(com.atlassian.application.api.ApplicationKey).

To start and upgrade JIRA it needs to have all its licenses in maintenance. JIRA forces the admin to add/remove licenses until this is the case. This means that we can remove the old UPM SD license before migration has run which is very bad because we need it to migrate (MoveJira6xABPServiceDeskPermissions). To work around this problem we move the license moveToUpgradeStore() into a new location that means it becomes inactive but is still available to upgrade tasks through getUpgrade() or getCurrentOrUpgrade().

Since:
7.0
  • Constructor Details

    • Jira6xServiceDeskPluginEncodedLicenseSupplier

      public Jira6xServiceDeskPluginEncodedLicenseSupplier(ApplicationProperties applicationProperties)
  • Method Details

    • get

      public io.atlassian.fugue.Option<String> get()
      Retrieves encoded Service Desk license string from plugin store. No validation is performed, so returned license may be malformed or may not be a Service Desk license.
      Specified by:
      get in interface com.atlassian.cache.Supplier<io.atlassian.fugue.Option<String>>
      Specified by:
      get in interface Supplier<io.atlassian.fugue.Option<String>>
      Returns:
      Option containing encoded license or Option.none() if there was no license in the plugin location.
    • getUpgrade

      public io.atlassian.fugue.Option<String> getUpgrade()
      Retrieves encoded Service Desk license from the upgrade location. No validation is performed, so returned license may be malformed or may not be a Service Desk license.
      Returns:
      Option containing encoded license or Option.none() if there was no such license.
    • getCurrentOrUpgrade

      public io.atlassian.fugue.Option<String> getCurrentOrUpgrade()
      Retrieves encoded Service Desk license string from plugin store or the upgrade location if it exists. No validation is performed, so returned license may be malformed or may not be a Service Desk license.
      Returns:
      the encoded Service Desk license string from plugin store or the upgrade location if it exists.
    • moveToUpgradeStore

      public void moveToUpgradeStore()
      Move the license from the UPM store into a location for upgrade. This logically removes the license from JIRA but leaves it accessible to upgrade tasks through getUpgrade() or getCurrentOrUpgrade().
    • clear

      public void clear()
      Remove the SD license from the plugin store and/or upgrade location.