public final class

DefaultLicensedApplications

extends Object
implements LicensedApplications
java.lang.Object
   ↳ com.atlassian.jira.license.DefaultLicensedApplications

Class Overview

Default implementation of LicensedApplications.

This implementation fails fast (in the constructor) on detection of invalid license or license application/role details.

Summary

Constants
String APPLICATION_NAMESPACE String that identifies a license key as being part of an application, as distinct from an addon.
Fields
public static final String JIRA_PRODUCT_NAMESPACE String that prefixes a license key as being a JIRA role-based application (product), typically "jira.product.".
Public Constructors
DefaultLicensedApplications(String license, LicenseDecoder licenseDecoder)
Public Methods
@Nonnull final static String getApplicationLicensePropertyName(ApplicationKey app, String property)
Returns a fully-qualified license property name for the given ApplicationKey application and license property.
@Nonnull String getDescription()
Returns a user-friendly string version of the com.atlassian.application.api.Applications encoded in the source license, or the empty string if there are no Applications in the source license.
@Nonnull Set<ApplicationKey> getKeys()
Returns the com.atlassian.application.api.ApplicationKeys encoded in the source license.

Note: This implementation returns an unmodifiable Set.

int getUserLimit(ApplicationKey key)
Returns the number of seats for the given com.atlassian.application.api.ApplicationKey.
boolean hasNativeRole()
Indicates whether the license key has been issued as an JIRA Application license ( role based license ) or whether we have interpreted it as an JIRA Application license.
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.atlassian.jira.license.LicensedApplications

Constants

public static final String APPLICATION_NAMESPACE

String that identifies a license key as being part of an application, as distinct from an addon.

Constant Value: ".product."

Fields

public static final String JIRA_PRODUCT_NAMESPACE

String that prefixes a license key as being a JIRA role-based application (product), typically "jira.product.".

Public Constructors

public DefaultLicensedApplications (String license, LicenseDecoder licenseDecoder)

Parameters
license An encoded license string.
licenseDecoder A license decoder capable of decoding the given license.
Throws
LicenseException on detection of invalid applications or application user counts.

Public Methods

@Nonnull public static final String getApplicationLicensePropertyName (ApplicationKey app, String property)

Returns a fully-qualified license property name for the given ApplicationKey application and license property. Currently, the returned string is of form "jira.product.[application-key].[property]".

Parameters
app application identifier (key)
property a license property
Returns
  • a fully-qualified license property
See Also

@Nonnull public String getDescription ()

Returns a user-friendly string version of the com.atlassian.application.api.Applications encoded in the source license, or the empty string if there are no Applications in the source license.

@Nonnull public Set<ApplicationKey> getKeys ()

Returns the com.atlassian.application.api.ApplicationKeys encoded in the source license. This may return an empty set, but never returns null.

Note: This implementation returns an unmodifiable Set.

public int getUserLimit (ApplicationKey key)

Returns the number of seats for the given com.atlassian.application.api.ApplicationKey. It will return:

  1. 0 if the passed ApplicationKey is not licensed.
  2. UNLIMITED_USERS if the passed ApplicationKey has no limit.
  3. positive number when the passed ApplicationKey has that exact limit.

Returns
  • the number of users/seats for the given ApplicationKey, 0, or UNLIMITED_USERS.

public boolean hasNativeRole ()

Indicates whether the license key has been issued as an JIRA Application license ( role based license ) or whether we have interpreted it as an JIRA Application license.

Returns
  • true if license key was issued as an JIRA Application license ( role based license ), false if we have interpreted license as JIRA Application license or when no interpretation occurred.