Class JiraAutomationLicenseService
java.lang.Object
com.codebarrel.jira.plugin.automation.service.JiraAutomationLicenseService
- All Implemented Interfaces:
AutomationLicenseService
-
Field Summary
Fields inherited from interface com.codebarrel.automation.api.service.AutomationLicenseService
ADDON_KEY_PRO, SERVER_ADDON_KEY_LITE
-
Constructor Summary
ConstructorsConstructorDescriptionJiraAutomationLicenseService
(JiraAddonInfoService jiraAddonInfoService, CompatibilityCheck versionInfo, ClusterManager clusterManager) -
Method Summary
Modifier and TypeMethodDescriptiongetAppKey
(TenantContext tenantContext) Returns the currently active application key for this tenant.getLicenseStatus
(TenantContext tenant) If this tenant is running automation lite, this method will check if we are currently below the monthly limit of rule executions.long
Returns the maximum number of allowed rule executions per month.long
Returns the number of used rule executions this month.boolean
isLite
(TenantContext tenant) boolean
isRuleLicensed
(TenantContext tenant, com.codebarrel.automation.api.config.RuleConfigBean rule) If the rule is licensed to executevoid
notifyLicenseOrLimitExceeded
(TenantContext context, Set<String> authorsToNotify) Sends e-mails to the users provided letting them know they have exceeded their license limit.
-
Constructor Details
-
JiraAutomationLicenseService
@Inject public JiraAutomationLicenseService(JiraAddonInfoService jiraAddonInfoService, CompatibilityCheck versionInfo, ClusterManager clusterManager)
-
-
Method Details
-
getLicenseStatus
Description copied from interface:AutomationLicenseService
If this tenant is running automation lite, this method will check if we are currently below the monthly limit of rule executions.Otherwise it performs a license check to ensure this tenant's license is active.
- Specified by:
getLicenseStatus
in interfaceAutomationLicenseService
- Parameters:
tenant
- The tenant context- Returns:
- true only if this tenant is licensed, or below the usage limit allowed for the lite version
-
isRuleLicensed
public boolean isRuleLicensed(TenantContext tenant, com.codebarrel.automation.api.config.RuleConfigBean rule) Description copied from interface:AutomationLicenseService
If the rule is licensed to execute- Specified by:
isRuleLicensed
in interfaceAutomationLicenseService
- Parameters:
tenant
- The tenant contextrule
- The rule configuration- Returns:
- false if the rule contains "pro only components" and the user has downgraded from pro to lite, or has an expired "in-product" pro trial (Server Only).
-
isLite
- Specified by:
isLite
in interfaceAutomationLicenseService
- Returns:
- true if this tenant currently is running the lite version of automation
-
getAppKey
Description copied from interface:AutomationLicenseService
Returns the currently active application key for this tenant.- Specified by:
getAppKey
in interfaceAutomationLicenseService
- Parameters:
tenantContext
- The tenant- Returns:
- Either the LITE or PRO app key
-
getUsedMonthlyRuleExecutions
Description copied from interface:AutomationLicenseService
Returns the number of used rule executions this month. Does not check if this is the lite version.- Specified by:
getUsedMonthlyRuleExecutions
in interfaceAutomationLicenseService
- Returns:
- total number of rule exectuions this month.
-
getMaxMonthlyRuleExecutions
Description copied from interface:AutomationLicenseService
Returns the maximum number of allowed rule executions per month.- Specified by:
getMaxMonthlyRuleExecutions
in interfaceAutomationLicenseService
- Returns:
- the maximum number of allowed rule executions per month.
-
notifyLicenseOrLimitExceeded
Description copied from interface:AutomationLicenseService
Sends e-mails to the users provided letting them know they have exceeded their license limit.- Specified by:
notifyLicenseOrLimitExceeded
in interfaceAutomationLicenseService
- Parameters:
context
- The tenant contextauthorsToNotify
- Users to notify.
-