public class

MockLicenseDetails

extends Object
implements LicenseDetails
java.lang.Object
   ↳ com.atlassian.jira.license.MockLicenseDetails

Summary

Public Constructors
MockLicenseDetails()
Public Methods
String getBriefMaintenanceStatusMessage(I18nHelper i18n)
Return the single word description of the maintenance status of the license.
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()
JiraLicense getJiraLicense()
Retrieve the JiraLicense object corresponding to this license.
String getLicenseExpiryStatusMessage(I18nHelper i18n, OutlookDate ignored)
Return the HTML message that briefly describes the expiry status of the license.
String getLicenseExpiryStatusMessage(User user)
Return the HTML message that briefly describes the expiry status of the license.
LicenseRoleDetails getLicenseRoles()
Returns the license role information contained within this license.
LicenseDetails.LicenseStatusMessage getLicenseStatusMessage(I18nHelper i18n)
Return the all messages which contain status message.
String getLicenseStatusMessage(I18nHelper i18n, OutlookDate ignored, String delimiter)
Return the HTML message that describes the current status of the license.
String getLicenseStatusMessage(User user, String delimiter)
Return the HTML message that describes the current status of the license.
String getLicenseString()
int getLicenseVersion()
Gets the version of the current license, 0 if not set.
String getMaintenanceEndString(OutlookDate outlookDate)
Return the date string representing the end of maintenance of the license, whether the license is Evaluation, New Build Old License or otherwise.
int getMaximumNumberOfUsers()
Gets the maximum number of users allowed by the current license
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
String getSupportRequestMessage(User user)
Return the HTML message for support request denial or send e-mail success page.
String getSupportRequestMessage(I18nHelper i18n, OutlookDate ignored)
Return the HTML message for support request denial or send e-mail success page.
boolean hasLicenseTooOldForBuildConfirmationBeenDone()
Tells whether the admin has acknowledged that the JIRA instance is running on a too old license for its build number.
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.
boolean isLicenseAlmostExpired()
If the license is Evaluation or Extended (New Build, Old License), returns true if we are within 7 days of the expiry date.
boolean isLicenseSet()
Tells whether a license has been set or not for this JIRA instance.
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 isPersonalLicense()
Tells whether this is a personal license or not
boolean isStarter()
Tells wheter this is a starter license or not
boolean isUnlimitedNumberOfUsers()
Tells whether the current license authorise an unlimited number of users.
MockLicenseDetails makeUnset()
MockLicenseDetails setDaysToLicenseExpiry(int days)
MockLicenseDetails setDaysToMaintenanceExpiry(int days)
MockLicenseDetails setDeveloper(boolean developer)
MockLicenseDetails setEvaluation(boolean eval)
MockLicenseDetails setMaxUsers(int users)
MockLicenseDetails setUnlimitedUsers()
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.atlassian.jira.license.LicenseDetails

Public Constructors

public MockLicenseDetails ()

Public Methods

public String getBriefMaintenanceStatusMessage (I18nHelper i18n)

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

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

public String getLicenseExpiryStatusMessage (I18nHelper i18n, OutlookDate ignored)

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

public String getLicenseExpiryStatusMessage (User user)

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

public LicenseRoleDetails getLicenseRoles ()

Returns the license role information contained within this license.

public LicenseDetails.LicenseStatusMessage getLicenseStatusMessage (I18nHelper i18n)

Return the all messages which contain status message.

Parameters
i18n i18n bean
Returns
  • the status message

public String getLicenseStatusMessage (I18nHelper i18n, OutlookDate ignored, String delimiter)

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
Returns
  • the status message

public String getLicenseStatusMessage (User user, String delimiter)

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
Returns
  • the status message

public String getLicenseString ()

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.

public String getMaintenanceEndString (OutlookDate outlookDate)

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)

public int getMaximumNumberOfUsers ()

Gets the maximum number of users allowed by the current license

Returns
  • the maximum number of user allowed by the license, -1 if unlimited

public String getOrganisation ()

Gets the organisation this license belongs to

Returns
  • the organisation this license belongs to

public String getPartnerName ()

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 String getSupportRequestMessage (User user)

Return the HTML message for support request denial or send e-mail success page.

Parameters
user a User object for the calling user
Returns
  • the support request message

public String getSupportRequestMessage (I18nHelper i18n, OutlookDate ignored)

Return the HTML message for support request denial or send e-mail success page.

Parameters
i18n i18n bean
ignored ignored
Returns
  • the support request message

public boolean hasLicenseTooOldForBuildConfirmationBeenDone ()

Tells whether the admin has acknowledged that the JIRA instance is running on a too old license for its build number. Typically JIRA allows for a 30 days grace period when doing so.

Returns
  • true if the license in use is too old with regards to the build number, false otherwise.

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

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.

public boolean isLicenseAlmostExpired ()

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 isLicenseSet ()

Tells whether a license has been set or not for this JIRA instance.

Returns
  • true if a license has been set, 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 isPersonalLicense ()

Tells whether this is a personal license or not

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

public boolean isStarter ()

Tells wheter this is a starter license or not

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

public boolean isUnlimitedNumberOfUsers ()

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

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

public MockLicenseDetails makeUnset ()

public MockLicenseDetails setDaysToLicenseExpiry (int days)

public MockLicenseDetails setDaysToMaintenanceExpiry (int days)

public MockLicenseDetails setDeveloper (boolean developer)

public MockLicenseDetails setEvaluation (boolean eval)

public MockLicenseDetails setMaxUsers (int users)

public MockLicenseDetails setUnlimitedUsers ()