Package com.atlassian.jira.license
Class DefaultLicensedApplications
java.lang.Object
com.atlassian.jira.license.DefaultLicensedApplications
- All Implemented Interfaces:
LicensedApplications
Default implementation of
LicensedApplications.
This implementation fails fast (in the constructor) on detection of invalid license or license application/role details.
- Since:
- v7.0
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDefaultLicensedApplications(String license, com.atlassian.extras.decoder.api.LicenseDecoder licenseDecoder) -
Method Summary
Modifier and TypeMethodDescriptionstatic final StringgetApplicationLicensePropertyName(com.atlassian.application.api.ApplicationKey app, String property) Returns a fully-qualified license property name for the givenapplicationand license property.Returns a user-friendly string version of theApplications encoded in the sourcelicense, or the empty string if there are no Applications in the source license.Set<com.atlassian.application.api.ApplicationKey>getKeys()Returns theApplicationKeys encoded in the sourcelicense.intgetUserLimit(com.atlassian.application.api.ApplicationKey key) Returns the number of seats for the givenApplicationKey.booleanIndicates 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.
-
Field Details
-
APPLICATION_NAMESPACE
String that identifies a license key as being part of an application, as distinct from an addon.- See Also:
-
JIRA_PRODUCT_NAMESPACE
String that prefixes a license key as being a JIRA role-based application (product), typically "jira.product.".
-
-
Constructor Details
-
DefaultLicensedApplications
public DefaultLicensedApplications(@Nonnull String license, @Nonnull com.atlassian.extras.decoder.api.LicenseDecoder licenseDecoder) throws com.atlassian.extras.api.LicenseException - Parameters:
license- An encoded license string.licenseDecoder- A license decoder capable of decoding the given license.- Throws:
com.atlassian.extras.api.LicenseException- on detection of invalid applications or application user counts.
-
-
Method Details
-
getKeys
Returns theApplicationKeys encoded in the sourcelicense. This may return an empty set, but never returns null.Note: This implementation returns an unmodifiable
Set.- Specified by:
getKeysin interfaceLicensedApplications
-
getUserLimit
public int getUserLimit(@Nonnull com.atlassian.application.api.ApplicationKey key) Description copied from interface:LicensedApplicationsReturns the number of seats for the givenApplicationKey. It will return:- 0 if the passed
ApplicationKeyis not licensed. -
LicensePropertiesConstants.UNLIMITED_USERSif the passedApplicationKeyhas no limit. positive numberwhen the passedApplicationKeyhas that exact limit.
- Specified by:
getUserLimitin interfaceLicensedApplications- Returns:
- the number of users/seats for the given
ApplicationKey, 0, orLicensePropertiesConstants.UNLIMITED_USERS.
- 0 if the passed
-
getDescription
Description copied from interface:LicensedApplicationsReturns a user-friendly string version of theApplications encoded in the sourcelicense, or the empty string if there are no Applications in the source license.- Specified by:
getDescriptionin interfaceLicensedApplications
-
getApplicationLicensePropertyName
@Nonnull public static final String getApplicationLicensePropertyName(@Nonnull com.atlassian.application.api.ApplicationKey app, @Nonnull String property) Returns a fully-qualified license property name for the givenapplicationand 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:
-
LicensePropertiesConstantsJIRA_PRODUCT_NAMESPACE
-
hasNativeRole
public boolean hasNativeRole()Description copied from interface:LicensedApplicationsIndicates 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.- Specified by:
hasNativeRolein interfaceLicensedApplications- 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.
-