Interface RuleDao

  • All Known Implementing Classes:
    DefaultRuleDao

    public interface RuleDao
    • Method Detail

      • findAllRulesByType

        <T extends AbstractRuleModel> java.util.List<T> findAllRulesByType​(java.lang.Class<T> type)
        Finds all rules by a specified type
        Parameters:
        type - - type of the rule. Must extend AbstractRuleModel
        Returns:
        list of all rules of specified type
      • findAllActiveRulesByType

        <T extends AbstractRuleModel> java.util.List<T> findAllActiveRulesByType​(java.lang.Class<T> type)
        Finds all active rules by a specified type
        Parameters:
        type - - type of the rule. Must extend AbstractRuleModel
        Returns:
        list of all active rules of specified type
      • findAllToBePublishedRules

        @Deprecated(since="1811",
                    forRemoval=true)
        <T extends AbstractRuleModel> java.util.List<T> findAllToBePublishedRules()
        Deprecated, for removal: This API element is subject to removal in a future version.
        since 1811
        Finds all rules to be published AbstractRuleModels
        Returns:
        List of AbstractRuleModels
      • findAllToBePublishedRulesByType

        @Deprecated(since="1811",
                    forRemoval=true)
        <T extends AbstractRuleModel> java.util.List<T> findAllToBePublishedRulesByType​(java.lang.Class<T> type)
        Deprecated, for removal: This API element is subject to removal in a future version.
        since 1811
        Finds all rules to be published by a specified type
        Parameters:
        type - - type of the rule. Must extend AbstractRuleModel
        Returns:
        list of all rules to be published of specified type
      • findAllRuleVersionsByCode

        <T extends AbstractRuleModel> java.util.List<T> findAllRuleVersionsByCode​(java.lang.String code)
        Finds all versions of AbstractRuleModel by code.
        Parameters:
        code - - code of the rule
        Returns:
        list of rules, extending AbstractRuleModel
      • findEngineRuleTypeByRuleType

        RuleType findEngineRuleTypeByRuleType​(java.lang.Class<?> type)
        Finds engine rule type for given rule type.
        Parameters:
        type - - type of the rule.
        Returns:
        RuleType of the engine rule
      • getRuleVersion

        java.lang.Long getRuleVersion​(java.lang.String code)
        Return the last version of a rule with a given code
        Parameters:
        code - the Rule code
        Returns:
        last version number of a rule. Null if not found
      • findRuleByCodeAndStatus

        java.util.Optional<AbstractRuleModel> findRuleByCodeAndStatus​(java.lang.String code,
                                                                      RuleStatus ruleStatus)
        Return a rule, having latest version with the status
        Parameters:
        code - the Rule code
        ruleStatus - the rule status
        Returns:
        an optional of the rule with latest version with the specified status
      • findAllRuleVersionsByCodeAndStatus

        <T extends AbstractRuleModel> java.util.List<T> findAllRuleVersionsByCodeAndStatus​(java.lang.String code,
                                                                                           RuleStatus ruleStatus)
        Return all rule versions with a given code and status
        Parameters:
        code - the Rule code
        ruleStatus - the rule status
        Returns:
        list of rules extending AbstractRuleModel
      • findAllRuleVersionsByCodeAndStatuses

        <T extends AbstractRuleModel> java.util.List<T> findAllRuleVersionsByCodeAndStatuses​(java.lang.String code,
                                                                                             RuleStatus... ruleStatuses)
        Return all rule versions with a given code and one of the statuses listed in ruleStatuses param. If no status is provided, the method fallback to findAllRuleVersionsByCode(String)
        Parameters:
        code - the Rule code
        ruleStatuses - the rule status array
        Returns:
        list of rules extending AbstractRuleModel
      • findAllRulesWithStatuses

        <T extends AbstractRuleModel> java.util.List<T> findAllRulesWithStatuses​(RuleStatus... ruleStatuses)
        Return all rule versions with one of the statuses listed in ruleStatuses param
        Parameters:
        ruleStatuses - the rule status array
        Returns:
        list of rules extending AbstractRuleModel
      • findByVersionAndStatuses

        <T extends AbstractRuleModel> java.util.List<T> findByVersionAndStatuses​(java.lang.Long version,
                                                                                 RuleStatus... ruleStatuses)
        Return all rules within statuses and version
        Parameters:
        version - the rule version
        ruleStatuses - the rule statuses
        Returns:
        list of rules extending AbstractRuleModel
      • findRuleByCodeAndVersion

        java.util.Optional<AbstractRuleModel> findRuleByCodeAndVersion​(java.lang.String code,
                                                                       java.lang.Long version)
        Return a rule with a specified version
        Parameters:
        code - the Rule code
        version - the version number
        Returns:
        an optional of the rule with code and version