Interface RuleScopeService

All Known Implementing Classes:
RuleScopeServiceImpl

public interface RuleScopeService
Service to handle scope related operations, such as: filtering.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    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.
  • Method Details

    • filterMatchingRules

      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. 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.
      Parameters:
      context - The tenant for which the filtering is done
      projectIds - Projects that set the scope being used to filter the rules
      rules - Rules to filter
      Returns:
      A collection of rules whose scope matches the scope set by the specified projects
    • doesRuleScopeMatchProjectScope

      boolean 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. The definition of match is the same as filterMatchingRules(TenantContext, Set, Collection)
      Parameters:
      context - The tenant for which the check is done
      projectIds - Projects that set the scope being used to match the rule
      rule - Rule to check
      Returns:
      true if the scope of the specified rule matches the scope set by the specified projects