Interface RuleDao
-
- All Known Implementing Classes:
DefaultRuleDao
public interface RuleDao
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description <T extends AbstractRuleModel>
java.util.List<T>findAllActiveRules()
Finds all activeAbstractRuleModel
s<T extends AbstractRuleModel>
java.util.List<T>findAllActiveRulesByType(java.lang.Class<T> type)
Finds all active rules by a specified type<T extends AbstractRuleModel>
java.util.List<T>findAllRules()
Finds all rules with latest version<T extends AbstractRuleModel>
java.util.List<T>findAllRulesByType(java.lang.Class<T> type)
Finds all rules by a specified type<T extends AbstractRuleModel>
java.util.List<T>findAllRulesWithStatuses(RuleStatus... ruleStatuses)
Return all rule versions with one of the statuses listed in ruleStatuses param<T extends AbstractRuleModel>
java.util.List<T>findAllRuleVersionsByCode(java.lang.String code)
Finds all versions ofAbstractRuleModel
by code.<T extends AbstractRuleModel>
java.util.List<T>findAllRuleVersionsByCodeAndStatus(java.lang.String code, RuleStatus ruleStatus)
Return all rule versions with a given code and status<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.<T extends AbstractRuleModel>
java.util.List<T>findAllToBePublishedRules()
Deprecated, for removal: This API element is subject to removal in a future version.since 1811<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<T extends AbstractRuleModel>
java.util.List<T>findByVersionAndStatuses(java.lang.Long version, RuleStatus... ruleStatuses)
Return all rules within statuses and versionRuleType
findEngineRuleTypeByRuleType(java.lang.Class<?> type)
Finds engine rule type for given rule type.<T extends AbstractRuleModel>
TfindRuleByCode(java.lang.String code)
Finds the latest version ofAbstractRuleModel
by code.java.util.Optional<AbstractRuleModel>
findRuleByCodeAndStatus(java.lang.String code, RuleStatus ruleStatus)
Return a rule, having latest version with the status<T extends AbstractRuleModel>
TfindRuleByCodeAndType(java.lang.String code, java.lang.Class<T> type)
FindsAbstractRuleModel
by code.java.util.Optional<AbstractRuleModel>
findRuleByCodeAndVersion(java.lang.String code, java.lang.Long version)
Return a rule with a specified versionjava.lang.Long
getRuleVersion(java.lang.String code)
Return the last version of a rule with a given code
-
-
-
Method Detail
-
findAllRules
<T extends AbstractRuleModel> java.util.List<T> findAllRules()
Finds all rules with latest version- Returns:
- List of
AbstractRuleModel
s
-
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 extendAbstractRuleModel
- Returns:
- list of all rules of specified type
-
findAllActiveRules
<T extends AbstractRuleModel> java.util.List<T> findAllActiveRules()
Finds all activeAbstractRuleModel
s- Returns:
- List of
AbstractRuleModel
s
-
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 extendAbstractRuleModel
- 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 1811Finds all rules to be publishedAbstractRuleModel
s- Returns:
- List of
AbstractRuleModel
s
-
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 1811Finds all rules to be published by a specified type- Parameters:
type
- - type of the rule. Must extendAbstractRuleModel
- Returns:
- list of all rules to be published of specified type
-
findRuleByCode
<T extends AbstractRuleModel> T findRuleByCode(java.lang.String code)
Finds the latest version ofAbstractRuleModel
by code.- Parameters:
code
- - code of the rule- Returns:
- a rule, extending
AbstractRuleModel
or null if not found
-
findAllRuleVersionsByCode
<T extends AbstractRuleModel> java.util.List<T> findAllRuleVersionsByCode(java.lang.String code)
Finds all versions ofAbstractRuleModel
by code.- Parameters:
code
- - code of the rule- Returns:
- list of rules, extending
AbstractRuleModel
-
findRuleByCodeAndType
<T extends AbstractRuleModel> T findRuleByCodeAndType(java.lang.String code, java.lang.Class<T> type)
FindsAbstractRuleModel
by code.- Parameters:
code
- - code of the ruletype
- - type of the rule. Must extendAbstractRuleModel
- Returns:
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 coderuleStatus
- 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 coderuleStatus
- 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 tofindAllRuleVersionsByCode(String)
- Parameters:
code
- the Rule coderuleStatuses
- 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 versionruleStatuses
- 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 codeversion
- the version number- Returns:
- an optional of the rule with code and version
-
-