Class RuleLabelServiceImpl
java.lang.Object
com.codebarrel.automation.api.service.RuleLabelServiceImpl
- All Implemented Interfaces:
RuleLabelService
-
Field Summary
Fields inherited from interface com.codebarrel.automation.api.service.RuleLabelService
RULE_COUNT_THRESHOLD -
Constructor Summary
ConstructorsConstructorDescriptionRuleLabelServiceImpl(RuleLabelStore ruleLabelStore, I18nFactory i18nFactory, AutomationLicenseService automationLicenseService, AddonProperties addonProperties, AutomationConfigService automationConfigService) -
Method Summary
Modifier and TypeMethodDescriptionio.atlassian.fugue.Either<ErrorCollection, RuleLabelBean> createLabel(RemoteConnectUser remoteUser, TenantContext context, RuleLabelBean label) Creates label if it passes validationbooleandeleteLabel(RemoteConnectUser remoteUser, TenantContext context, Long labelId) Deletes label if it passes validationgetLabel(RemoteConnectUser remoteUser, TenantContext context, long labelId) Gets a single rule label by idgetLabels(RemoteConnectUser remoteUser, TenantContext context) Retrieves all the rule labels for a tenantgetLabelsWithUsageOutsideScope(RemoteConnectUser remoteUser, TenantContext context, List<com.codebarrel.automation.api.config.RuleConfigBean> rulesInScope) Retrieves rule labels with usage outside current scope.getLabelToRuleUsage(RemoteConnectUser remoteUser, TenantContext context, long labelId) Gets the usage of rules associated with a specific label.booleanisFeatureEnabled(TenantContext tenantContext) Should the rule label feature be visible to tenantio.atlassian.fugue.Either<ErrorCollection, RuleLabelBean> updateLabel(RemoteConnectUser remoteUser, TenantContext context, RuleLabelBean label) Updates given label if it passes validation
-
Constructor Details
-
RuleLabelServiceImpl
@Inject public RuleLabelServiceImpl(RuleLabelStore ruleLabelStore, I18nFactory i18nFactory, AutomationLicenseService automationLicenseService, AddonProperties addonProperties, AutomationConfigService automationConfigService)
-
-
Method Details
-
getLabels
Description copied from interface:RuleLabelServiceRetrieves all the rule labels for a tenant- Specified by:
getLabelsin interfaceRuleLabelService- Parameters:
remoteUser- the user requesting the labelscontext- The database tenant context- Returns:
- the complete list or rule labels for the tenant
-
getLabelsWithUsageOutsideScope
public List<RuleLabelWithUsageBean> getLabelsWithUsageOutsideScope(RemoteConnectUser remoteUser, TenantContext context, List<com.codebarrel.automation.api.config.RuleConfigBean> rulesInScope) Description copied from interface:RuleLabelServiceRetrieves rule labels with usage outside current scope.- Specified by:
getLabelsWithUsageOutsideScopein interfaceRuleLabelService- Parameters:
remoteUser- the user requesting the labelscontext- The database tenant contextrulesInScope- The list of rules in current scope- Returns:
- the list of rule labels with usage outside current scope
-
getLabel
public Optional<RuleLabelBean> getLabel(RemoteConnectUser remoteUser, TenantContext context, long labelId) Description copied from interface:RuleLabelServiceGets a single rule label by id- Specified by:
getLabelin interfaceRuleLabelService- Parameters:
remoteUser- the user requesting the labelscontext- The database tenant contextlabelId- The id of the label- Returns:
- an optional of the label
-
getLabelToRuleUsage
public LabelRuleUsageBean getLabelToRuleUsage(RemoteConnectUser remoteUser, TenantContext context, long labelId) Description copied from interface:RuleLabelServiceGets the usage of rules associated with a specific label.- Specified by:
getLabelToRuleUsagein interfaceRuleLabelService- Parameters:
remoteUser- the user requesting the label to rule countcontext- the database tenant contextlabelId- the id of the label- Returns:
- a bean containing the label id and the count of associated rules
-
updateLabel
public io.atlassian.fugue.Either<ErrorCollection,RuleLabelBean> updateLabel(RemoteConnectUser remoteUser, TenantContext context, RuleLabelBean label) Description copied from interface:RuleLabelServiceUpdates given label if it passes validation- Specified by:
updateLabelin interfaceRuleLabelService- Parameters:
remoteUser- the user requesting the labelscontext- The database tenant contextlabel- The label with the updates to apply- Returns:
- The updated label or validation errors
-
createLabel
public io.atlassian.fugue.Either<ErrorCollection,RuleLabelBean> createLabel(RemoteConnectUser remoteUser, TenantContext context, RuleLabelBean label) Description copied from interface:RuleLabelServiceCreates label if it passes validation- Specified by:
createLabelin interfaceRuleLabelService- Parameters:
remoteUser- the user requesting the labelscontext- The database tenant contextlabel- The label to create- Returns:
- The created label or validation errors
-
deleteLabel
Description copied from interface:RuleLabelServiceDeletes label if it passes validation- Specified by:
deleteLabelin interfaceRuleLabelService- Parameters:
remoteUser- the user requesting the labelscontext- The database tenant contextlabelId- The id of label to delete- Returns:
- true when deleted, false when doesn't exist
-
isFeatureEnabled
Description copied from interface:RuleLabelServiceShould the rule label feature be visible to tenant- Specified by:
isFeatureEnabledin interfaceRuleLabelService- Parameters:
tenantContext- The database tenant context- Returns:
- Whether or not to surface the feature to tenant
-