public class MockLicenseDetails extends Object implements LicenseDetails
LicenseDetails.LicenseContact, LicenseDetails.LicenseStatusMessage| Constructor and Description |
|---|
MockLicenseDetails() |
| Modifier and Type | Method and Description |
|---|---|
String |
getApplicationDescription()
Returns a user-friendly
String description of the Application(s)
granted by this license. |
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()
Returns the literal description of the current license as given in the license itself.
|
com.atlassian.extras.api.jira.JiraLicense |
getJiraLicense()
Retrieve the JiraLicense object corresponding to this license.
|
LicensedApplications |
getLicensedApplications()
Returns all the application/role information contained within this license, even if they are non active.
|
String |
getLicenseExpiryStatusMessage(ApplicationUser user)
Return the HTML message that briefly describes the expiry status of the license.
|
String |
getLicenseExpiryStatusMessage(I18nHelper i18n,
OutlookDate ignored)
Return the HTML message that briefly describes the expiry status of the license.
|
String |
getLicenseStatusMessage(ApplicationUser user,
String delimiter,
UserManager userManager)
Return the HTML message that describes the current status of the license.
|
String |
getLicenseStatusMessage(I18nHelper i18n,
OutlookDate ignored,
String delimiter,
UserManager userManager)
Return the HTML message that describes the current status of the license.
|
LicenseDetails.LicenseStatusMessage |
getLicenseStatusMessage(I18nHelper i18n,
UserManager userManager)
Return the all messages which contain status message.
|
String |
getLicenseString() |
com.atlassian.extras.api.LicenseType |
getLicenseType() |
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.
|
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(com.atlassian.application.api.ApplicationKey application)
Returns true if the given
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.
|
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 |
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
|
boolean |
isUnlimitedNumberOfUsers()
Tells whether the current license authorise an unlimited number of users.
|
MockLicenseDetails |
setBriefDescription(String description) |
MockLicenseDetails |
setDaysToLicenseExpiry(int days) |
MockLicenseDetails |
setDaysToMaintenanceExpiry(int days) |
MockLicenseDetails |
setDeveloper(boolean developer) |
MockLicenseDetails |
setEvaluation(boolean eval) |
MockLicenseDetails |
setLicensedApplications(com.atlassian.application.api.ApplicationKey... keys) |
MockLicenseDetails |
setLicensedApplications(LicensedApplications licensedApplications) |
MockLicenseDetails |
setLicenseString(String licensString) |
MockLicenseDetails |
setMaintenanceDate(Date maintenanceDate) |
MockLicenseDetails |
setSupportEntitlementNumber(String sen) |
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetPurchaseDatepublic int getLicenseVersion()
LicenseDetailsgetLicenseVersion in interface LicenseDetailspublic boolean isEntitledToSupport()
isEntitledToSupport in interface LicenseDetailspublic boolean isLicenseAlmostExpired()
LicenseDetailsisLicenseAlmostExpired in interface LicenseDetailspublic com.atlassian.extras.api.jira.JiraLicense getJiraLicense()
LicenseDetailsgetJiraLicense in interface LicenseDetails@Nonnull public LicensedApplications getLicensedApplications()
LicenseDetailsgetLicensedApplications in interface LicenseDetailspublic boolean hasApplication(@Nonnull com.atlassian.application.api.ApplicationKey application)
LicenseDetailsapplication is contained within this license.hasApplication in interface LicenseDetailsapplication - the application to querypublic MockLicenseDetails setLicensedApplications(LicensedApplications licensedApplications)
public LicenseDetails.LicenseStatusMessage getLicenseStatusMessage(I18nHelper i18n, UserManager userManager)
LicenseDetailsgetLicenseStatusMessage in interface LicenseDetailsi18n - i18n beanuserManager - used to get user context if necessarypublic LicenseDetails.LicenseStatusMessage getMaintenanceMessage(@Nonnull I18nHelper i18n, String applicationName)
LicenseDetailsLicenseDetails.LicenseStatusMessage.hasAnyMessages()
would return false.getMaintenanceMessage in interface LicenseDetailsi18n - i18n helperapplicationName - JIRA Application name (trademark for display)public String getLicenseStatusMessage(@Nullable ApplicationUser user, String delimiter, UserManager userManager)
LicenseDetailsgetLicenseStatusMessage in interface LicenseDetailsuser - the user for whom the message should be i18n'eddelimiter - the line delimiter for the messageuserManager - used to get user context if necessarypublic String getLicenseStatusMessage(I18nHelper i18n, @Nullable OutlookDate ignored, String delimiter, UserManager userManager)
LicenseDetailsgetLicenseStatusMessage in interface LicenseDetailsi18n - i18n beanignored - ignoreddelimiter - the line delimiter for the messageuserManager - used to get user context if necessarypublic String getLicenseExpiryStatusMessage(@Nullable ApplicationUser user)
LicenseDetailsgetLicenseExpiryStatusMessage in interface LicenseDetailsuser - the user for whom the message should be i18n'edpublic String getLicenseExpiryStatusMessage(I18nHelper i18n, @Nullable OutlookDate ignored)
LicenseDetailsgetLicenseExpiryStatusMessage in interface LicenseDetailsi18n - i18n beanignored - outlookDate beanpublic String getBriefMaintenanceStatusMessage(I18nHelper i18n)
LicenseDetailsgetBriefMaintenanceStatusMessage in interface LicenseDetailsi18n - i18n bean@Nullable public Date getMaintenanceExpiryDate()
LicenseDetailsDate of this license, or null if the maintenance period of this
license is unlimited.getMaintenanceExpiryDate in interface LicenseDetailsDate of this license, or null if the maintenance period of this
license is unlimited.public String getMaintenanceEndString(OutlookDate outlookDate)
LicenseDetailsNote 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.
getMaintenanceEndString in interface LicenseDetailsoutlookDate - outlookDate beanpublic boolean isUnlimitedNumberOfUsers()
LicenseDetailsisUnlimitedNumberOfUsers in interface LicenseDetailstrue if the license authorise an unlimited number of users, false otherwise.public String getDescription()
LicenseDetailsgetDescription in interface LicenseDetailspublic String getPartnerName()
getPartnerName in interface LicenseDetailspublic boolean isExpired()
LicenseDetailsisExpired in interface LicenseDetailspublic String getPurchaseDate(OutlookDate outlookDate)
LicenseDetailsgetPurchaseDate in interface LicenseDetailsoutlookDate - the date formatterpublic MockLicenseDetails setEvaluation(boolean eval)
public boolean isEvaluation()
LicenseDetailsisEvaluation in interface LicenseDetailstrue if this is an evaluation license, false otherwise.public boolean isStarter()
LicenseDetailsisStarter in interface LicenseDetailstrue if this is a starter license, false otherwise.public boolean isPaidType()
LicenseDetailsisPaidType in interface LicenseDetailstrue if the license is a paid type, false otherwise.public boolean isCommercial()
LicenseDetailsisCommercial in interface LicenseDetailstrue if this is a commercial license, false otherwise.public boolean isPersonalLicense()
LicenseDetailsisPersonalLicense in interface LicenseDetailstrue if this is a personal license, false otherwise.public boolean isCommunity()
LicenseDetailsisCommunity in interface LicenseDetailstrue if this is a community license, false otherwise.public boolean isOpenSource()
LicenseDetailsisOpenSource in interface LicenseDetailstrue if this is an open source license, false otherwise.public boolean isNonProfit()
LicenseDetailsisNonProfit in interface LicenseDetailstrue if this is a non profit license, false otherwise.public boolean isDemonstration()
LicenseDetailsisDemonstration in interface LicenseDetailstrue if this is a demonstration license, false otherwise.public boolean isOnDemand()
LicenseDetailsisOnDemand in interface LicenseDetailstrue if this is a OnDemand, false otherwise.public boolean isDataCenter()
LicenseDetailsisDataCenter in interface LicenseDetailspublic boolean isEnterpriseLicenseAgreement()
LicenseDetailsisEnterpriseLicenseAgreement in interface LicenseDetailspublic boolean isDeveloper()
LicenseDetailsisDeveloper in interface LicenseDetailstrue if this is a developer license, false otherwise.public MockLicenseDetails setDeveloper(boolean developer)
public String getOrganisation()
LicenseDetailsgetOrganisation in interface LicenseDetailspublic String getLicenseString()
getLicenseString in interface LicenseDetailspublic boolean isMaintenanceValidForBuildDate(Date currentBuildDate)
LicenseDetailsisMaintenanceValidForBuildDate in interface LicenseDetailscurrentBuildDate - the current build datetrue if the build date is within the maintenance period, false otherwise.public String getSupportEntitlementNumber()
LicenseDetailsgetSupportEntitlementNumber in interface LicenseDetailspublic Collection<LicenseDetails.LicenseContact> getContacts()
LicenseDetailsgetContacts in interface LicenseDetailspublic int getDaysToLicenseExpiry()
LicenseDetails
0 indicates that license will expire today (but is still valid).Integer.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.
getDaysToLicenseExpiry in interface LicenseDetailspublic MockLicenseDetails setDaysToLicenseExpiry(int days)
public int getDaysToMaintenanceExpiry()
LicenseDetails
0 indicates that license maintenance will expire today (but is still valid).Integer.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.
getDaysToMaintenanceExpiry in interface LicenseDetailspublic com.atlassian.extras.api.LicenseType getLicenseType()
getLicenseType in interface LicenseDetails@Nonnull public String getApplicationDescription()
LicenseDetailsString description of the Application(s)
granted by this license. This method differs from LicenseDetails.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".
getApplicationDescription in interface LicenseDetailspublic MockLicenseDetails setBriefDescription(String description)
public MockLicenseDetails setDaysToMaintenanceExpiry(int days)
public MockLicenseDetails setSupportEntitlementNumber(@Nonnull String sen)
public MockLicenseDetails setMaintenanceDate(Date maintenanceDate)
public MockLicenseDetails setLicenseString(String licensString)
public MockLicenseDetails setLicensedApplications(com.atlassian.application.api.ApplicationKey... keys)
Copyright © 2002-2017 Atlassian. All Rights Reserved.