public final class DefaultLicensedApplications extends Object implements LicensedApplications
LicensedApplications.
This implementation fails fast (in the constructor) on detection of invalid license or license application/role details.
| Modifier and Type | Field and Description |
|---|---|
static String |
APPLICATION_NAMESPACE
String that identifies a license key as being part of an application, as distinct from an addon.
|
static String |
JIRA_PRODUCT_NAMESPACE
String that prefixes a license key as being a JIRA role-based application (product), typically "jira.product.".
|
| Constructor and Description |
|---|
DefaultLicensedApplications(String license,
com.atlassian.extras.decoder.api.LicenseDecoder licenseDecoder) |
| Modifier and Type | Method and Description |
|---|---|
static String |
getApplicationLicensePropertyName(com.atlassian.application.api.ApplicationKey app,
String property)
Returns a fully-qualified license property name for the given
application and license
property. |
String |
getDescription()
Returns a user-friendly string version of the
Applications
encoded in the source license, or the empty string
if there are no Applications in the source license. |
Set<com.atlassian.application.api.ApplicationKey> |
getKeys()
Returns the
ApplicationKeys encoded in the source
license. |
int |
getUserLimit(com.atlassian.application.api.ApplicationKey key)
Returns the number of seats for the given
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.
|
public static final String APPLICATION_NAMESPACE
public static final String JIRA_PRODUCT_NAMESPACE
public DefaultLicensedApplications(@Nonnull String license, @Nonnull com.atlassian.extras.decoder.api.LicenseDecoder licenseDecoder) throws com.atlassian.extras.api.LicenseException
license - An encoded license string.licenseDecoder - A license decoder capable of decoding the given license.com.atlassian.extras.api.LicenseException - on detection of invalid applications or application user counts.@Nonnull public Set<com.atlassian.application.api.ApplicationKey> getKeys()
ApplicationKeys encoded in the source
license. This may return an empty set, but never
returns null.
Note: This implementation returns an unmodifiable Set.
getKeys in interface LicensedApplicationspublic int getUserLimit(@Nonnull com.atlassian.application.api.ApplicationKey key)
LicensedApplicationsApplicationKey. It will return:
ApplicationKey is not licensed.LicensePropertiesConstants.UNLIMITED_USERS if the passed
ApplicationKey has no limit.
positive number when the passed ApplicationKey has that exact limit.getUserLimit in interface LicensedApplicationsApplicationKey, 0, or
LicensePropertiesConstants.UNLIMITED_USERS.@Nonnull public String getDescription()
LicensedApplicationsApplications
encoded in the source license, or the empty string
if there are no Applications in the source license.getDescription in interface LicensedApplications@Nonnull public static final String getApplicationLicensePropertyName(@Nonnull com.atlassian.application.api.ApplicationKey app, @Nonnull String property)
application and license
property. Currently, the returned string is of form "jira.product.[application-key].[property]".app - application identifier (key)property - a license propertyLicensePropertiesConstants,
JIRA_PRODUCT_NAMESPACEpublic boolean hasNativeRole()
LicensedApplicationshasNativeRole in interface LicensedApplicationsCopyright © 2002-2019 Atlassian. All Rights Reserved.