Interface RuleRegistry

All Superinterfaces:
Registry<Rule,String>
All Known Implementing Classes:
RuleSupportRuleRegistryDelegate

@NonNullByDefault public interface RuleRegistry extends Registry<Rule,String>
The RuleRegistry provides basic functionality for managing Rules. It can be used to

The RuleRegistry manages the status of the Rules:

Author:
Yordan Mihaylov - Initial contribution
  • Method Details

    • add

      Rule add(Rule rule)
      This method is used to register a Rule into the RuleRegistry. First the Rule become RuleStatus.UNINITIALIZED. Then verification procedure will be done and the Rule become RuleStatus.IDLE. If the verification fails, the Rule will stay RuleStatus.UNINITIALIZED.
      Specified by:
      add in interface Registry<Rule,String>
      Parameters:
      rule - a Rule instance which have to be added into the RuleRegistry.
      Returns:
      a copy of the added Rule
      Throws:
      IllegalArgumentException - when a rule with the same UID already exists or some of the conditions or actions has wrong format of input reference.
      IllegalStateException - when the RuleManagedProvider is unavailable.
    • getByTag

      Collection<Rule> getByTag(@Nullable String tag)
      Gets a collection of Rules which shares same tag.
      Parameters:
      tag - specifies a tag that will filter the rules.
      Returns:
      collection of Rules having specified tag.
    • getByTags

      Collection<Rule> getByTags(String... tags)
      Gets a collection of Rules which has specified tags.
      Parameters:
      tags - specifies tags that will filter the rules.
      Returns:
      collection of Rules having specified tags.
    • regenerateFromTemplate

      void regenerateFromTemplate(String ruleUID)
      This method triggers a new generation of the rule from its template by reverting the rule to its "rule stub" state only containing the template configuration.
      Parameters:
      ruleUID - the UID of the Rule.
      Throws:
      IllegalArgumentException - if the rule doesn't exist or isn't linked to a template.