Class RuleScopeServiceImpl

java.lang.Object
com.codebarrel.automation.api.service.RuleScopeServiceImpl
All Implemented Interfaces:
RuleScopeService

public class RuleScopeServiceImpl extends Object implements RuleScopeService
  • Constructor Details

    • RuleScopeServiceImpl

      @Inject public RuleScopeServiceImpl(ProjectService projectService)
  • 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 interface RuleScopeService
      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

      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 as RuleScopeService.filterMatchingRules(TenantContext, Set, Collection)
      Specified by:
      doesRuleScopeMatchProjectScope in interface RuleScopeService
      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