Interface LicenseDetailsFactory

All Known Implementing Classes:
LicenseDetailsFactoryImpl, MockLicenseDetailsFactory

@Internal public interface LicenseDetailsFactory
Provides the ability to extract a LicenseDetails object from a license String.
Since:
7.0
  • Method Summary

    Modifier and Type
    Method
    Description
    getLicense(String licenseString)
    Converts an encoded license key into a LicenseDetails.
    boolean
    isDecodeable(String licenseString)
    Determines whether a license string can be decoded by this factory.
  • Method Details

    • getLicense

      @Nonnull LicenseDetails getLicense(@Nonnull String licenseString) throws com.atlassian.extras.api.LicenseException
      Converts an encoded license key into a LicenseDetails. This method never returns null, if the provided license key is undecodable or not for a JIRA Product a LicenseException is thrown.
      Parameters:
      licenseString - the encoded license key.
      Returns:
      the corresponding license details.
      Throws:
      com.atlassian.extras.api.LicenseException - if licenseString was null or could not be decoded (see isDecodeable(String).
    • isDecodeable

      boolean isDecodeable(@Nonnull String licenseString)
      Determines whether a license string can be decoded by this factory. If this returns true, then getLicense is guaranteed to return a valid non-placeholder LicenseDetails object.
      Parameters:
      licenseString - the (usually encrypted) license string to test
      Returns:
      true if the license string can be interpreted by this factory, false otherwise