Class RuleScopeServiceImpl
java.lang.Object
com.codebarrel.automation.api.service.RuleScopeServiceImpl
- All Implemented Interfaces:
RuleScopeService
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
doesRuleScopeMatchProjectScope
(TenantContext context, Set<String> projectIds, com.codebarrel.automation.api.config.RuleConfigBean rule) Checks if the scope of the specified rule matches the scope set by the specified projects.Collection
<com.codebarrel.automation.api.config.RuleConfigBean> filterMatchingRules
(TenantContext context, Set<String> projectIds, Collection<com.codebarrel.automation.api.config.RuleConfigBean> rules) Filter the specified rules and return a collection containing only those rules whose scope matches the scope set by the specified projects.
-
Constructor Details
-
RuleScopeServiceImpl
-
-
Method Details
-
filterMatchingRules
public Collection<com.codebarrel.automation.api.config.RuleConfigBean> filterMatchingRules(TenantContext context, Set<String> projectIds, Collection<com.codebarrel.automation.api.config.RuleConfigBean> rules) Description copied from interface:RuleScopeService
Filter the specified rules and return a collection containing only those rules whose scope matches the scope set by the specified projects. A project scoped rule is considered a match if it is scoped by at least one of the specified projects. A project type scoped rule is considered a match if at least one project types scoping the rule matches the types of the specified projects.- Specified by:
filterMatchingRules
in interfaceRuleScopeService
- Parameters:
context
- The tenant for which the filtering is doneprojectIds
- Projects that set the scope being used to filter the rulesrules
- Rules to filter- Returns:
- A collection of rules whose scope matches the scope set by the specified projects
-
doesRuleScopeMatchProjectScope
public boolean doesRuleScopeMatchProjectScope(TenantContext context, Set<String> projectIds, com.codebarrel.automation.api.config.RuleConfigBean rule) Description copied from interface:RuleScopeService
Checks if the scope of the specified rule matches the scope set by the specified projects. The definition of match is the same asRuleScopeService.filterMatchingRules(TenantContext, Set, Collection)
- Specified by:
doesRuleScopeMatchProjectScope
in interfaceRuleScopeService
- Parameters:
context
- The tenant for which the check is doneprojectIds
- Projects that set the scope being used to match the rulerule
- Rule to check- Returns:
- true if the scope of the specified rule matches the scope set by the specified projects
-