Interface LicenseDetails
- All Known Implementing Classes:
DefaultLicenseDetails,MockLicenseDetails,SubscriptionLicenseDetails
- Since:
- v3.13
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceRepresents a license contact name/email pair.static interfaceEncapsulates a collection of unordered, internationalised license-related status messages. -
Method Summary
Modifier and TypeMethodDescriptionReturns a user-friendlyStringdescription of theApplication(s) granted by this license.Deprecated.since 7.0.0 No replacement, generate your own messageGets the contact people for the license (e.g.intReturns the number of days until the license expires (i.e.intReturns the number of days until the license maintenance expires (i.e.Returns the literal description of the current license as given in the license itself.com.atlassian.extras.api.jira.JiraLicenseRetrieve the JiraLicense object corresponding to this license.Returns all the application/role information contained within this license, even if they are non active.Deprecated.since 7.0.0 No replacement, generate your own messagegetLicenseExpiryStatusMessage(I18nHelper i18n, OutlookDate ignored) Deprecated.since 5.0 No replacement, generate your own messagegetLicenseStatusMessage(I18nHelper i18n, UserManager userManager) Return the all messages which contain status message.com.atlassian.extras.api.LicenseTypeintGets the version of the current license, 0 if not set.getMaintenanceEndString(OutlookDate outlookDate) Deprecated.since 7.0.0 No replacement, generate your own messageReturns the maintenance expiryDateof this license, or null if the maintenance period of this license is unlimited.getMaintenanceMessage(I18nHelper i18n, String applicationName) Get the maintenance message for this license, this does not evaluate the maintenance date, it only provides the message that should be displayed when license out of maintenance for a given JIRA Application.Gets the organisation this license belongs todefault StringgetPurchaseDate(DateTimeFormatter dateTimeFormatter) Gets a nicely formatted purchase date for the current licensegetPurchaseDate(OutlookDate outlookDate) Deprecated.UsegetPurchaseDate(DateTimeFormatter)instead.Gets the SEN from the licensebooleanhasApplication(com.atlassian.application.api.ApplicationKey application) Returns true if the givenapplicationis contained within this license.booleanTells whether this is a commercial license or notbooleanTells whether this is a community license or notbooleanReturns true if this is a DataCenter license.booleanTells whether this is a demonstration license or notbooleanTells whether this is a developer license or notbooleanIndicates whether this licence is a subscription-based Enterprise License Agreement (ELA).booleanbooleanTells whether this is an evaluation license or notbooleanChecks whether the license is either expired or the grace period for an extended license (after upgrade) is over.booleanisMaintenanceValidForBuildDate(Date currentBuildDate) Tells whether the current build date is within the maintenance of the licensebooleanTells whether this is a non profit license or notbooleanTells whether this is an OnDemand license or notbooleanTells whether this is an open source license or notbooleanChecks whether the license type is a paid type.booleanTells whether this is a personal license or notbooleanTells whether this is a starter license or notboolean
-
Method Details
-
getLicenseVersion
int getLicenseVersion()Gets the version of the current license, 0 if not set. This is the version of encoder/decoder that was used with this license.- Returns:
- the version of the current license, 0 if not set.
-
isEntitledToSupport
boolean isEntitledToSupport()- Returns:
- true for licenses that are entitled to support and updates of JIRA. This includes everything which is not a Personal License or Non-Commercial-Non-Renewable.
-
getJiraLicense
com.atlassian.extras.api.jira.JiraLicense getJiraLicense()Retrieve the JiraLicense object corresponding to this license.Jira 7.0 introduced a new licensing model where a license can contain multiple applications. This method will return the JiraLicense object and has no knowledge of the applications contained within the license.
To find the user limit for a specific application, use
getLicensedApplications()andLicensedApplications.getUserLimit(ApplicationKey).The values returned by
ProductLicense.getMaximumNumberOfUsers()andProductLicense.isUnlimitedNumberOfUsers()should not be used.- Returns:
- the JiraLicense object corresponding to this license
-
getLicensedApplications
Returns all the application/role information contained within this license, even if they are non active.- Returns:
- the application/role information contained within this license.
- Since:
- 7.0
-
hasApplication
boolean hasApplication(@Nonnull com.atlassian.application.api.ApplicationKey application) Returns true if the givenapplicationis contained within this license.- Parameters:
application- the application to query- Returns:
- true if the application is found in this license
- Since:
- 7.0
-
getLicenseStatusMessage
LicenseDetails.LicenseStatusMessage getLicenseStatusMessage(I18nHelper i18n, UserManager userManager) Return the all messages which contain status message.- Parameters:
i18n- i18n beanuserManager- used to get user context if necessary- Returns:
- the status message
-
getMaintenanceMessage
LicenseDetails.LicenseStatusMessage getMaintenanceMessage(@Nonnull I18nHelper i18n, String applicationName) Get the maintenance message for this license, this does not evaluate the maintenance date, it only provides the message that should be displayed when license out of maintenance for a given JIRA Application. For subscription license no message would be returnedLicenseDetails.LicenseStatusMessage.hasAnyMessages()would return false.- Parameters:
i18n- i18n helperapplicationName- JIRA Application name (trademark for display)- Returns:
- the status message, subscription license would return no messages.
- Since:
- v7.0
-
getLicenseExpiryStatusMessage
Deprecated.since 7.0.0 No replacement, generate your own messageReturn the HTML message that briefly describes the expiry status of the license. Intended for use with the Admin Portlet.- Parameters:
user- the user for whom the message should be i18n'ed- Returns:
- the status message, null for normal license outside of support period
-
getLicenseExpiryStatusMessage
Deprecated.since 5.0 No replacement, generate your own messageReturn the HTML message that briefly describes the expiry status of the license. Intended for use with the Admin Portlet.- Parameters:
i18n- i18n beanignored- outlookDate bean- Returns:
- the status message, null for normal license outside of support period
-
getBriefMaintenanceStatusMessage
Deprecated.since 7.0.0 No replacement, generate your own messageReturn the single word description of the maintenance status of the license. Intended for use with the Support Request and System Info pages.- Parameters:
i18n- i18n bean- Returns:
- the status message - either "Supported", "Expired" or "Unsupported"
-
getMaintenanceExpiryDate
Returns the maintenance expiryDateof this license, or null if the maintenance period of this license is unlimited.- Returns:
- the maintenance expiry
Dateof this license, or null if the maintenance period of this license is unlimited. - Since:
- 7.0
-
getMaintenanceEndString
Deprecated.since 7.0.0 No replacement, generate your own messageReturn the date string representing the end of maintenance of the license, whether the license is Evaluation, New Build Old License or otherwise.Note that the return type here is a String to intentionally signify that this value should not be used in any logic calculations and only for displaying to the user.
- Parameters:
outlookDate- outlookDate bean- Returns:
- the date as a string (should never be null)
-
isUnlimitedNumberOfUsers
Deprecated.Tells whether the current license authorise an unlimited number of users.- Returns:
trueif the license authorise an unlimited number of users,falseotherwise.
-
getDescription
String getDescription()Returns the literal description of the current license as given in the license itself.- Returns:
- the literal description of the current license as given in the license itself.
-
getPartnerName
String getPartnerName()- Returns:
- the Partner name inside the current license or null if its not set
-
isExpired
boolean isExpired()Checks whether the license is either expired or the grace period for an extended license (after upgrade) is over.- Returns:
- true if has, false otherwise.
-
getPurchaseDate
Deprecated.UsegetPurchaseDate(DateTimeFormatter)instead. Since v7.1Gets a nicely formatted purchase date for the current license- Parameters:
outlookDate- the date formatter- Returns:
- a formatted purchased date.
-
getPurchaseDate
Gets a nicely formatted purchase date for the current license- Parameters:
dateTimeFormatter- the date formatter- Returns:
- a formatted purchased date.
-
isEvaluation
boolean isEvaluation()Tells whether this is an evaluation license or not- Returns:
trueif this is an evaluation license,falseotherwise.
-
isStarter
boolean isStarter()Tells whether this is a starter license or not- Returns:
trueif this is a starter license,falseotherwise.
-
isPaidType
boolean isPaidType()Checks whether the license type is a paid type. The paid types are ACADEMIC, COMMERCIAL, and STARTER.- Returns:
trueif the license is a paid type,falseotherwise.- Since:
- v7.0
-
isCommercial
boolean isCommercial()Tells whether this is a commercial license or not- Returns:
trueif this is a commercial license,falseotherwise.
-
isPersonalLicense
boolean isPersonalLicense()Tells whether this is a personal license or not- Returns:
trueif this is a personal license,falseotherwise.
-
isCommunity
boolean isCommunity()Tells whether this is a community license or not- Returns:
trueif this is a community license,falseotherwise.
-
isOpenSource
boolean isOpenSource()Tells whether this is an open source license or not- Returns:
trueif this is an open source license,falseotherwise.
-
isNonProfit
boolean isNonProfit()Tells whether this is a non profit license or not- Returns:
trueif this is a non profit license,falseotherwise.
-
isDemonstration
boolean isDemonstration()Tells whether this is a demonstration license or not- Returns:
trueif this is a demonstration license,falseotherwise.
-
isOnDemand
boolean isOnDemand()Tells whether this is an OnDemand license or not- Returns:
trueif this is a OnDemand,falseotherwise.
-
isDataCenter
boolean isDataCenter()Returns true if this is a DataCenter license.- Returns:
- true if this is a DataCenter license.
- Since:
- v6.3
-
isDeveloper
boolean isDeveloper()Tells whether this is a developer license or not- Returns:
trueif this is a developer license,falseotherwise.
-
getOrganisation
String getOrganisation()Gets the organisation this license belongs to- Returns:
- the organisation this license belongs to
-
getLicenseString
String getLicenseString()- Returns:
- the encoded license string that was was decode to produce the current license. This will return null if it is not set
-
isMaintenanceValidForBuildDate
Tells whether the current build date is within the maintenance of the license- Parameters:
currentBuildDate- the current build date- Returns:
trueif the build date is within the maintenance period,falseotherwise.
-
getSupportEntitlementNumber
String getSupportEntitlementNumber()Gets the SEN from the license- Returns:
- the SEN from the license
-
getContacts
Collection<LicenseDetails.LicenseContact> getContacts()Gets the contact people for the license (e.g. Name and Email of whoever first signed up for the OD license)- Returns:
- collection of contact people for the license
-
isEnterpriseLicenseAgreement
boolean isEnterpriseLicenseAgreement()Indicates whether this licence is a subscription-based Enterprise License Agreement (ELA).- Returns:
- true if this licence is a subscription-based Enterprise License Agreement (ELA).
- Since:
- v6.3
-
getDaysToLicenseExpiry
int getDaysToLicenseExpiry()Returns the number of days until the license expires (i.e. JIRA will enter read-only mode).- A value of
0indicates that license will expire today (but is still valid). - A negative value indicates the number of days the license is expired.
- A positive value indicates the number of days the license will be valid for.
A value of
Integer.MAX_VALUEindicates that the license will never expire.
A partial day will be rounded down. For example,
1.5days will be reported as1while-0.5days will be reported as-1days.- Returns:
- the number of days until the license expires (i.e. JIRA will enter read-only mode)
- A value of
-
getDaysToMaintenanceExpiry
int getDaysToMaintenanceExpiry()Returns the number of days until the license maintenance expires (i.e. support and upgrades will cease).- A value of
0indicates that license maintenance will expire today (but is still valid). - A negative value indicates the number of days the license maintenance is expired.
- A positive value indicates the number of days the license maintenance will be value for.
value of
Integer.MAX_VALUEindicates that the license maintenance will never expire.
A partial day will be rounded down. For example,
1.5days will be reported as1while-0.5days will be reported as-1days.- Returns:
- the number of days until the license maintenance expires (i.e. support and upgrades will cease).
- A value of
-
getLicenseType
com.atlassian.extras.api.LicenseType getLicenseType() -
getApplicationDescription
Returns a user-friendlyStringdescription of theApplication(s) granted by this license. This method differs fromgetDescription()in that the returned String isApplication-focused and heuristically determined, and does not include license type information, number of seats etc.If there are no
Applications in the current license, then this method returns the String"JIRA".
-