Interface RuleService
- All Known Implementing Classes:
RuleServiceImpl
public interface RuleService
-
Method Summary
Modifier and TypeMethodDescriptionintcountAllRules(RuleFilter ruleFilter) createRule(RuleDTO ruleDTO) Add Rule to DBcreateRule(RuleDTO ruleDTO, String username) Add Rule to DBdeleteRuleById(Long ruleId, String username) Deletes an existing ruleDeprecated, for removal: This API element is subject to removal in a future version.use methods with pagination instead to avoid performance and memory issuesfindAllRules(int offset, int limit) Get all Rules using offset and limit.findEnabledRulesByEvent(String ruleTitle) Find enable RuleEntity by titlefindEnableRuleByTitle(String ruleTitle) Find enable RuleEntity by titlefindRuleByEventAndDomain(String ruleTitle, long domainId) Find a RuleEntity by titlefindRuleById(long id) Get RuleEntity by idfindRuleByTitle(String ruleTitle) Find a RuleEntity by titleGet all active Rules from DBGet all Events from rulesgetAllRulesByDomain(String domain) Get all Rules by Domain from DB * @param domain : rule's domain paramGet all Rules by with null DomainDTO from DBGet all Domains from Rules from DBgetRulesByFilter(RuleFilter ruleFilter, int offset, int limit) Get Rules by filter using offset and limit.longgetRulesTotalScoreByDomain(long domainId) default RuleDTOupdateRule(RuleDTO ruleDTO) Update Rule to DBupdateRule(RuleDTO ruleDTO, String username) Update Rule to DB
-
Method Details
-
findEnableRuleByTitle
Find enable RuleEntity by title- Parameters:
ruleTitle- : rule's title param- Returns:
- an instance of RuleDTO
-
findRuleById
Get RuleEntity by id- Parameters:
id- : rule's id param- Returns:
- an instance of RuleDTO
-
findEnabledRulesByEvent
Find enable RuleEntity by title- Parameters:
ruleTitle- : rule's title param- Returns:
- an instance of RuleDTO
-
findRuleByTitle
Find a RuleEntity by title- Parameters:
ruleTitle- : rule's title param- Returns:
- an instance of RuleDTO
-
findRuleByEventAndDomain
Find a RuleEntity by title- Parameters:
ruleTitle- : rule's title paramdomainId- domain id- Returns:
- an instance of RuleDTO
-
findAllRules
Deprecated, for removal: This API element is subject to removal in a future version.use methods with pagination instead to avoid performance and memory issuesGet all Rules from DB- Returns:
- RuleDTO list
- Since:
- Meeds 1.4.0
-
findAllRules
Get all Rules using offset and limit. -
getRulesByFilter
Get Rules by filter using offset and limit.- Parameters:
ruleFilter-RuleFilterused to filter rulesoffset- Offset of resultlimit- Limit of result- Returns:
ListofRuleDTO
-
countAllRules
- Parameters:
ruleFilter-RuleFilterused to count associated rules- Returns:
- count rules by filter
-
getActiveRules
Get all active Rules from DB- Returns:
- RuleDTO list
-
getAllRulesByDomain
Get all Rules by Domain from DB * @param domain : rule's domain param- Returns:
- RuleDTO list
-
getAllRulesWithNullDomain
Get all Rules by with null DomainDTO from DB- Returns:
- RuleDTO list
-
getAllEvents
Get all Events from rules- Returns:
- RuleDTO list
-
getDomainListFromRules
Get all Domains from Rules from DB- Returns:
- String list
-
getRulesTotalScoreByDomain
long getRulesTotalScoreByDomain(long domainId) - Parameters:
domainId- domain id- Returns:
- rules total scores that can be earned
-
deleteRuleById
RuleDTO deleteRuleById(Long ruleId, String username) throws IllegalAccessException, org.exoplatform.commons.exception.ObjectNotFoundException Deletes an existing rule- Parameters:
ruleId- Rule technical identifier to deleteusername- User name of user attempting to delete a rule- Returns:
- deleted
RuleDTO - Throws:
IllegalAccessException- when user is not authorized to delete the ruleorg.exoplatform.commons.exception.ObjectNotFoundException- when the rule identified by its technical identifier is not found
-
createRule
RuleDTO createRule(RuleDTO ruleDTO, String username) throws IllegalAccessException, org.exoplatform.commons.ObjectAlreadyExistsException Add Rule to DB- Parameters:
ruleDTO-RuleDTOto createusername- User name of user attempting to create a rule- Returns:
- created
RuleDTO - Throws:
IllegalAccessException- when user is not authorized to create a ruleorg.exoplatform.commons.ObjectAlreadyExistsException- when rule already exists
-
createRule
Add Rule to DB -
updateRule
RuleDTO updateRule(RuleDTO ruleDTO, String username) throws org.exoplatform.commons.exception.ObjectNotFoundException, IllegalAccessException Update Rule to DB- Parameters:
ruleDTO-RuleDTOto updateusername- User name of user attempting to update a rule- Returns:
- updated
RuleDTO - Throws:
org.exoplatform.commons.exception.ObjectNotFoundException- when rule doesn't existsIllegalAccessException- when user sin't allowed to update chosen rule
-
updateRule
default RuleDTO updateRule(RuleDTO ruleDTO) throws org.exoplatform.commons.exception.ObjectNotFoundException Update Rule to DB
-