@PublicApi public interface

LicenseDetails

com.atlassian.jira.license.LicenseDetails
Known Indirect Subclasses

@PublicApi

This interface is designed for plugins to consume (call its methods).

Clients of @PublicApi can expect that programs compiled against a given version will remain binary compatible with later versions of the @PublicApi as per each product's API policy as long as the client does not implement/extend @PublicApi interfaces or classes (refer to each product's API policy for the exact guarantee---usually binary compatibility is guaranteed at least across minor versions).

Note: since @PublicApi interfaces and classes are not designed to be implemented or extended by clients, we may perform certain types of binary-incompatible changes to these classes and interfaces, but these will not affect well-behaved clients that do not extend/implement these types (in general, only classes and interfaces annotated with @PublicSpi are safe to extend/implement).

Class Overview

A set of methods which describe the state of the currently installed license.

Summary

Nested Classes
interface LicenseDetails.LicenseContact Represents a license contact name/email pair. 
interface LicenseDetails.LicenseStatusMessage Encapsulates a collection of unordered, internationalised license-related status messages. 
Public Methods
@Nonnull String getApplicationDescription()
Returns a user-friendly String description of the com.atlassian.application.api.Application(s) granted by this license.
@Deprecated String getBriefMaintenanceStatusMessage(I18nHelper i18n)
This method is deprecated. since 7.0.0 No replacement, generate your own message
Collection<LicenseDetails.LicenseContact> getContacts()
Gets the contact people for the license (e.g.
int getDaysToLicenseExpiry()
Returns the number of days until the license expires (i.e.
int getDaysToMaintenanceExpiry()
Returns the number of days until the license maintenance expires (i.e.
String getDescription()
Returns the literal description of the current license as given in the license itself.
JiraLicense getJiraLicense()
Retrieve the JiraLicense object corresponding to this license.
@Deprecated String getLicenseExpiryStatusMessage(I18nHelper i18n, OutlookDate ignored)
This method is deprecated. since 5.0 No replacement, generate your own message
@Deprecated String getLicenseExpiryStatusMessage(ApplicationUser user)
This method is deprecated. since 7.0.0 No replacement, generate your own message
@Deprecated String getLicenseStatusMessage(I18nHelper i18n, OutlookDate ignored, String delimiter, UserManager userManager)
LicenseDetails.LicenseStatusMessage getLicenseStatusMessage(I18nHelper i18n, UserManager userManager)
Return the all messages which contain status message.
@Deprecated String getLicenseStatusMessage(ApplicationUser user, String delimiter, UserManager userManager)
String getLicenseString()
LicenseType getLicenseType()
int getLicenseVersion()
Gets the version of the current license, 0 if not set.
@Nonnull LicensedApplications getLicensedApplications()
Returns all the application/role information contained within this license, even if they are non active.
@Deprecated String getMaintenanceEndString(OutlookDate outlookDate)
This method is deprecated. since 7.0.0 No replacement, generate your own message
@Nullable Date getMaintenanceExpiryDate()
Returns the maintenance expiry Date of this license, or null if the maintenance period of this license is unlimited.
LicenseDetails.LicenseStatusMessage 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.
String getOrganisation()
Gets the organisation this license belongs to
String getPartnerName()
String getPurchaseDate(OutlookDate outlookDate)
Gets a nicely formatted purchase date for the current license
String getSupportEntitlementNumber()
Gets the SEN from the license
boolean hasApplication(ApplicationKey application)
Returns true if the given ApplicationKey application is contained within this license.
boolean isCommercial()
Tells whether this is a commercial license or not
boolean isCommunity()
Tells whether this is a community license or not
boolean isDataCenter()
Returns true if this is a DataCenter license.
boolean isDemonstration()
Tells whether this is a demonstration license or not
boolean isDeveloper()
Tells whether this is a developer license or not
boolean isEnterpriseLicenseAgreement()
Indicates whether this licence is a subscription-based Enterprise License Agreement (ELA).
boolean isEntitledToSupport()
boolean isEvaluation()
Tells whether this is an evaluation license or not
boolean isExpired()
Checks whether the license is either expired or the grace period for an extended license (after upgrade) is over.
@Deprecated boolean isLicenseAlmostExpired()
This method is deprecated. since 7.0.0 use getMaintenanceExpiryDate() instead
boolean isMaintenanceValidForBuildDate(Date currentBuildDate)
Tells whether the current build date is within the maintenance of the license
boolean isNonProfit()
Tells whether this is a non profit license or not
boolean isOnDemand()
Tells whether this is an OnDemand license or not
boolean isOpenSource()
Tells whether this is an open source license or not
boolean isPaidType()
Checks whether the license type is a paid type.
boolean isPersonalLicense()
Tells whether this is a personal license or not
boolean isStarter()
Tells whether this is a starter license or not
@Deprecated boolean isUnlimitedNumberOfUsers()
This method is deprecated. Use use getLicensedApplications() and getKeys() getUserLimit(com.atlassian.application.api.ApplicationKey) instead. Since 7.0

Public Methods

@Nonnull public String getApplicationDescription ()

Returns a user-friendly String description of the com.atlassian.application.api.Application(s) granted by this license. This method differs from getDescription() in that the returned String is Application-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".

@Deprecated public String getBriefMaintenanceStatusMessage (I18nHelper i18n)

This method is deprecated.
since 7.0.0 No replacement, generate your own message

Return 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"

public 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

public int getDaysToLicenseExpiry ()

Returns the number of days until the license expires (i.e. JIRA will enter read-only mode).

  • A value of 0 indicates 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 MAX_VALUE indicates that the license will never expire.

A partial day will be rounded down. For example, 1.5 days will be reported as 1 while -0.5 days will be reported as -1 days.

Returns
  • the number of days until the license expires (i.e. JIRA will enter read-only mode)

public int getDaysToMaintenanceExpiry ()

Returns the number of days until the license maintenance expires (i.e. support and upgrades will cease).

  • A value of 0 indicates 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 MAX_VALUE indicates that the license maintenance will never expire.

A partial day will be rounded down. For example, 1.5 days will be reported as 1 while -0.5 days will be reported as -1 days.

Returns
  • the number of days until the license maintenance expires (i.e. support and upgrades will cease).

public 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.

public JiraLicense getJiraLicense ()

Retrieve the JiraLicense object corresponding to this license. This will be useful to cross-product code that wants to deal with licenses from different products consistently using the ProductLicense interface (which JiraLicense extends).

Returns
  • the JiraLicense object corresponding to this license

@Deprecated public String getLicenseExpiryStatusMessage (I18nHelper i18n, OutlookDate ignored)

This method is deprecated.
since 5.0 No replacement, generate your own message

Return the HTML message that briefly describes the expiry status of the license. Intended for use with the Admin Portlet.

Parameters
i18n i18n bean
ignored outlookDate bean
Returns
  • the status message, null for normal license outside of support period

@Deprecated public String getLicenseExpiryStatusMessage (ApplicationUser user)

This method is deprecated.
since 7.0.0 No replacement, generate your own message

Return 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

@Deprecated public String getLicenseStatusMessage (I18nHelper i18n, OutlookDate ignored, String delimiter, UserManager userManager)

This method is deprecated.
use getLicenseStatusMessage(com.atlassian.jira.util.I18nHelper, UserManager)

Return the HTML message that describes the current status of the license.

Parameters
i18n i18n bean
ignored ignored
delimiter the line delimiter for the message
userManager used to get user context if necessary
Returns
  • the status message

public LicenseDetails.LicenseStatusMessage getLicenseStatusMessage (I18nHelper i18n, UserManager userManager)

Return the all messages which contain status message.

Parameters
i18n i18n bean
userManager used to get user context if necessary
Returns
  • the status message

@Deprecated public String getLicenseStatusMessage (ApplicationUser user, String delimiter, UserManager userManager)

This method is deprecated.
use getLicenseStatusMessage(com.atlassian.jira.util.I18nHelper, UserManager)

Return the HTML message that describes the current status of the license.

Parameters
user the user for whom the message should be i18n'ed
delimiter the line delimiter for the message
userManager used to get user context if necessary
Returns
  • the status message

public 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

public LicenseType getLicenseType ()

public 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.

@Nonnull public LicensedApplications 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.

@Deprecated public String getMaintenanceEndString (OutlookDate outlookDate)

This method is deprecated.
since 7.0.0 No replacement, generate your own message

Return 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)

@Nullable public Date getMaintenanceExpiryDate ()

Returns the maintenance expiry Date of this license, or null if the maintenance period of this license is unlimited.

Returns
  • the maintenance expiry Date of this license, or null if the maintenance period of this license is unlimited.

public LicenseDetails.LicenseStatusMessage 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. For subscription license no message would be returned hasAnyMessages() would return false.

Parameters
i18n i18n helper
applicationName JIRA Application name (trademark for display)
Returns
  • the status message, subscription license would return no messages.

public String getOrganisation ()

Gets the organisation this license belongs to

Returns
  • the organisation this license belongs to

public String getPartnerName ()

Returns
  • the Partner name inside the current license or null if its not set

public String getPurchaseDate (OutlookDate outlookDate)

Gets a nicely formatted purchase date for the current license

Parameters
outlookDate the date formatter
Returns
  • a formatted purchased date.

public String getSupportEntitlementNumber ()

Gets the SEN from the license

Returns
  • the SEN from the license

public boolean hasApplication (ApplicationKey application)

Returns true if the given ApplicationKey application is contained within this license.

Parameters
application the application to query
Returns
  • true if the application is found in this license

public boolean isCommercial ()

Tells whether this is a commercial license or not

Returns
  • true if this is a commercial license, false otherwise.

public boolean isCommunity ()

Tells whether this is a community license or not

Returns
  • true if this is a community license, false otherwise.

public boolean isDataCenter ()

Returns true if this is a DataCenter license.

Returns
  • true if this is a DataCenter license.

public boolean isDemonstration ()

Tells whether this is a demonstration license or not

Returns
  • true if this is a demonstration license, false otherwise.

public boolean isDeveloper ()

Tells whether this is a developer license or not

Returns
  • true if this is a developer license, false otherwise.

public 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).

public 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.

public boolean isEvaluation ()

Tells whether this is an evaluation license or not

Returns
  • true if this is an evaluation license, false otherwise.

public 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.

@Deprecated public boolean isLicenseAlmostExpired ()

This method is deprecated.
since 7.0.0 use getMaintenanceExpiryDate() instead

If the license is Evaluation or Extended (New Build, Old License), returns true if we are within 7 days of the expiry date. Otherwise, returns true if within 6 weeks before the supported period end date.

Returns
  • true if the license is close to expiry; false otherwise.

public boolean isMaintenanceValidForBuildDate (Date currentBuildDate)

Tells whether the current build date is within the maintenance of the license

Parameters
currentBuildDate the current build date
Returns
  • true if the build date is within the maintenance period, false otherwise.

public boolean isNonProfit ()

Tells whether this is a non profit license or not

Returns
  • true if this is a non profit license, false otherwise.

public boolean isOnDemand ()

Tells whether this is an OnDemand license or not

Returns
  • true if this is a OnDemand, false otherwise.

public boolean isOpenSource ()

Tells whether this is an open source license or not

Returns
  • true if this is an open source license, false otherwise.

public boolean isPaidType ()

Checks whether the license type is a paid type. The paid types are ACADEMIC, COMMERCIAL, and STARTER.

Returns
  • true if the license is a paid type, false otherwise.

public boolean isPersonalLicense ()

Tells whether this is a personal license or not

Returns
  • true if this is a personal license, false otherwise.

public boolean isStarter ()

Tells whether this is a starter license or not

Returns
  • true if this is a starter license, false otherwise.

@Deprecated public boolean isUnlimitedNumberOfUsers ()

This method is deprecated.
Use use getLicensedApplications() and getKeys() getUserLimit(com.atlassian.application.api.ApplicationKey) instead. Since 7.0

Tells whether the current license authorise an unlimited number of users.

Returns
  • true if the license authorise an unlimited number of users, false otherwise.