Interface RuleLabelService
- All Known Implementing Classes:
RuleLabelServiceImpl
public interface RuleLabelService
-
Field Summary
Fields -
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 context) 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
-
Field Details
-
RULE_COUNT_THRESHOLD
static final int RULE_COUNT_THRESHOLD- See Also:
-
-
Method Details
-
getLabels
Retrieves all the rule labels for a tenant- Parameters:
remoteUser- the user requesting the labelscontext- The database tenant context- Returns:
- the complete list or rule labels for the tenant
-
getLabelsWithUsageOutsideScope
List<RuleLabelWithUsageBean> getLabelsWithUsageOutsideScope(RemoteConnectUser remoteUser, TenantContext context, List<com.codebarrel.automation.api.config.RuleConfigBean> rulesInScope) Retrieves rule labels with usage outside current scope.- 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
Gets a single rule label by id- Parameters:
remoteUser- the user requesting the labelscontext- The database tenant contextlabelId- The id of the label- Returns:
- an optional of the label
-
getLabelToRuleUsage
LabelRuleUsageBean getLabelToRuleUsage(RemoteConnectUser remoteUser, TenantContext context, long labelId) Gets the usage of rules associated with a specific label.- 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
io.atlassian.fugue.Either<ErrorCollection,RuleLabelBean> updateLabel(RemoteConnectUser remoteUser, TenantContext context, RuleLabelBean label) Updates given label if it passes validation- 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
io.atlassian.fugue.Either<ErrorCollection,RuleLabelBean> createLabel(RemoteConnectUser remoteUser, TenantContext context, RuleLabelBean label) Creates label if it passes validation- Parameters:
remoteUser- the user requesting the labelscontext- The database tenant contextlabel- The label to create- Returns:
- The created label or validation errors
-
deleteLabel
Deletes label if it passes validation- 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
Should the rule label feature be visible to tenant- Parameters:
context- The database tenant context- Returns:
- Whether or not to surface the feature to tenant
-