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.longReturns the maximum number of allowed rule executions per month.longReturns the number of used rule executions this month.booleanisLite(TenantContext tenant) booleanisRuleLicensed(TenantContext tenant, com.codebarrel.automation.api.config.RuleConfigBean rule) If the rule is licensed to executevoidnotifyLicenseOrLimitExceeded(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:AutomationLicenseServiceIf 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:
getLicenseStatusin 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:AutomationLicenseServiceIf the rule is licensed to execute- Specified by:
isRuleLicensedin 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:
isLitein interfaceAutomationLicenseService- Returns:
- true if this tenant currently is running the lite version of automation
-
getAppKey
Description copied from interface:AutomationLicenseServiceReturns the currently active application key for this tenant.- Specified by:
getAppKeyin interfaceAutomationLicenseService- Parameters:
tenantContext- The tenant- Returns:
- Either the LITE or PRO app key
-
getUsedMonthlyRuleExecutions
Description copied from interface:AutomationLicenseServiceReturns the number of used rule executions this month. Does not check if this is the lite version.- Specified by:
getUsedMonthlyRuleExecutionsin interfaceAutomationLicenseService- Returns:
- total number of rule exectuions this month.
-
getMaxMonthlyRuleExecutions
Description copied from interface:AutomationLicenseServiceReturns the maximum number of allowed rule executions per month.- Specified by:
getMaxMonthlyRuleExecutionsin interfaceAutomationLicenseService- Returns:
- the maximum number of allowed rule executions per month.
-
notifyLicenseOrLimitExceeded
Description copied from interface:AutomationLicenseServiceSends e-mails to the users provided letting them know they have exceeded their license limit.- Specified by:
notifyLicenseOrLimitExceededin interfaceAutomationLicenseService- Parameters:
context- The tenant contextauthorsToNotify- Users to notify.
-