Class RuleEngine

java.lang.Object
edu.internet2.middleware.grouper.rules.RuleEngine

public class RuleEngine extends Object
processes rules and kicks off actions
  • Constructor Details

    • RuleEngine

      public RuleEngine()
  • Method Details

    • getRuleDefinitions

      public Set<RuleDefinition> getRuleDefinitions()
      rule definitions
      Returns:
      the ruleDefinitions
    • getRuleDefinitions

      public Set<RuleDefinition> getRuleDefinitions(boolean onlyValid)
    • ruleCheckIndexDefinitionsByNameOrId

      public Set<RuleDefinition> ruleCheckIndexDefinitionsByNameOrId(RuleCheck ruleCheck)
      get rule definitions from cache based on name or id
      Parameters:
      ruleCheck -
      Returns:
      the definitions
    • ruleCheckIndexDefinitionsByNameOrIdInFolder

      public Set<RuleDefinition> ruleCheckIndexDefinitionsByNameOrIdInFolder(RuleCheck ruleCheck)
      get rule definitions from cache based on name or id
      Parameters:
      ruleCheck -
      Returns:
      the definitions
    • setRuleDefinitions

      public void setRuleDefinitions(Set<RuleDefinition> ruleDefinitions)
      rule definitions
      Parameters:
      ruleDefinitions - the ruleDefinitions to set
    • ruleEngine

      public static RuleEngine ruleEngine()
      Returns:
      all the rule definitions, cached
    • getRuleCheckIndex

      public Map<RuleCheck,Set<RuleDefinition>> getRuleCheckIndex()
      map of checks to sets of relevant rules
      Returns:
      the ruleCheckIndex
    • ruleCheckIndexDefinitionsByNameOrIdInFolderPickOneArgOptional

      public Set<RuleDefinition> ruleCheckIndexDefinitionsByNameOrIdInFolderPickOneArgOptional(RuleCheck ruleCheck)
      get rule definitions from cache based on name or id
      Parameters:
      ruleCheck -
      Returns:
      the definitions
    • fireRule

      public static void fireRule(RuleCheckType ruleCheckType, RulesBean rulesBean)
      find rules and fire them
      Parameters:
      ruleCheckType -
      rulesBean -
    • allRulesAttributeAssignValueContainers

      public static Map<AttributeAssign,Set<AttributeAssignValueContainer>> allRulesAttributeAssignValueContainers(QueryOptions queryOptions)
      get all rules from the DB in the form of attribute assignments
      Parameters:
      queryOptions -
      Returns:
      the assigns of all rules
    • daemon

      public static int daemon()
      validate the rules, and run the daemon stuff in rules
      Returns:
      the number of records changed
    • daemon

      public static int daemon(Hib3GrouperLoaderLog hib3GrouperLoaderLog)
      validate the rules, and run the daemon stuff in rules
      Parameters:
      hib3GrouperLoaderLog -
      Returns:
      the number of records changed
    • clearRuleEngineCache

      public static void clearRuleEngineCache()
      clear this for testing
    • hasAccessToElApi

      public static boolean hasAccessToElApi(Subject subject)
      see if a subejct (e.g. act as subject) has access to the EL api
      Parameters:
      subject -
      Returns:
      true if has access, flase if not, use the cache