Class RuleServiceImpl
- java.lang.Object
-
- org.exoplatform.addons.gamification.service.configuration.RuleServiceImpl
-
- All Implemented Interfaces:
RuleService
public class RuleServiceImpl extends Object implements RuleService
-
-
Constructor Summary
Constructors Constructor Description RuleServiceImpl(RuleStorage ruleStorage)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RuleDTOaddRule(RuleDTO ruleDTO)Add Rule to DBvoiddeleteRule(Long id)delete rule with specific idList<RuleDTO>findAllRules()Get all Rules from DBList<RuleDTO>findEnabledRulesByEvent(String event)Find enable RuleEntity by titleRuleDTOfindEnableRuleByTitle(String ruleTitle)Find enable RuleEntity by titleRuleDTOfindRuleByEventAndDomain(String ruleTitle, String domain)Find a RuleEntity by titleRuleDTOfindRuleById(Long id)Get RuleEntity by idRuleDTOfindRuleByTitle(String ruleTitle)Find a RuleEntity by titleList<RuleDTO>getActiveRules()Get all active Rules from DBList<RuleDTO>getAllAutomaticRules()Get all Automatic Rules from DBList<String>getAllEvents()Get all Events from rulesList<RuleDTO>getAllRulesByDomain(String domain)Get all Rules by Domain from DB * @param domain : rule's domain paramList<RuleDTO>getAllRulesWithNullDomain()Get all Rules by with null DomainDTO from DBList<String>getDomainListFromRules()Get all Domains from Rules from DBRuleDTOupdateRule(RuleDTO ruleDTO)Update Rule to DB
-
-
-
Constructor Detail
-
RuleServiceImpl
public RuleServiceImpl(RuleStorage ruleStorage)
-
-
Method Detail
-
findEnableRuleByTitle
public RuleDTO findEnableRuleByTitle(String ruleTitle) throws IllegalArgumentException
Description copied from interface:RuleServiceFind enable RuleEntity by title- Specified by:
findEnableRuleByTitlein interfaceRuleService- Parameters:
ruleTitle- : rule's title param- Returns:
- an instance of RuleDTO
- Throws:
IllegalArgumentException
-
findRuleById
public RuleDTO findRuleById(Long id) throws IllegalArgumentException
Description copied from interface:RuleServiceGet RuleEntity by id- Specified by:
findRuleByIdin interfaceRuleService- Parameters:
id- : rule's id param- Returns:
- an instance of RuleDTO
- Throws:
IllegalArgumentException
-
findEnabledRulesByEvent
public List<RuleDTO> findEnabledRulesByEvent(String event) throws IllegalArgumentException
Description copied from interface:RuleServiceFind enable RuleEntity by title- Specified by:
findEnabledRulesByEventin interfaceRuleService- Parameters:
event- : rule's title param- Returns:
- an instance of RuleDTO
- Throws:
IllegalArgumentException
-
findRuleByTitle
public RuleDTO findRuleByTitle(String ruleTitle) throws IllegalArgumentException
Description copied from interface:RuleServiceFind a RuleEntity by title- Specified by:
findRuleByTitlein interfaceRuleService- Parameters:
ruleTitle- : rule's title param- Returns:
- an instance of RuleDTO
- Throws:
IllegalArgumentException
-
findRuleByEventAndDomain
public RuleDTO findRuleByEventAndDomain(String ruleTitle, String domain) throws IllegalArgumentException
Description copied from interface:RuleServiceFind a RuleEntity by title- Specified by:
findRuleByEventAndDomainin interfaceRuleService- Parameters:
ruleTitle- : rule's title paramdomain- : rule's domain param- Returns:
- an instance of RuleDTO
- Throws:
IllegalArgumentException
-
getAllAutomaticRules
public List<RuleDTO> getAllAutomaticRules()
Description copied from interface:RuleServiceGet all Automatic Rules from DB- Specified by:
getAllAutomaticRulesin interfaceRuleService- Returns:
- RuleDTO list
-
findAllRules
public List<RuleDTO> findAllRules()
Description copied from interface:RuleServiceGet all Rules from DB- Specified by:
findAllRulesin interfaceRuleService- Returns:
- RuleDTO list
-
getActiveRules
public List<RuleDTO> getActiveRules()
Description copied from interface:RuleServiceGet all active Rules from DB- Specified by:
getActiveRulesin interfaceRuleService- Returns:
- RuleDTO list
-
getAllRulesByDomain
public List<RuleDTO> getAllRulesByDomain(String domain) throws IllegalArgumentException
Description copied from interface:RuleServiceGet all Rules by Domain from DB * @param domain : rule's domain param- Specified by:
getAllRulesByDomainin interfaceRuleService- Returns:
- RuleDTO list
- Throws:
IllegalArgumentException
-
getAllRulesWithNullDomain
public List<RuleDTO> getAllRulesWithNullDomain()
Description copied from interface:RuleServiceGet all Rules by with null DomainDTO from DB- Specified by:
getAllRulesWithNullDomainin interfaceRuleService- Returns:
- RuleDTO list
-
getAllEvents
public List<String> getAllEvents()
Description copied from interface:RuleServiceGet all Events from rules- Specified by:
getAllEventsin interfaceRuleService- Returns:
- RuleDTO list
-
getDomainListFromRules
public List<String> getDomainListFromRules()
Description copied from interface:RuleServiceGet all Domains from Rules from DB- Specified by:
getDomainListFromRulesin interfaceRuleService- Returns:
- String list
-
deleteRule
public void deleteRule(Long id) throws IllegalArgumentException, org.exoplatform.commons.exception.ObjectNotFoundException
Description copied from interface:RuleServicedelete rule with specific id- Specified by:
deleteRulein interfaceRuleService- Throws:
IllegalArgumentExceptionorg.exoplatform.commons.exception.ObjectNotFoundException
-
addRule
public RuleDTO addRule(RuleDTO ruleDTO) throws IllegalArgumentException, javax.persistence.EntityExistsException
Description copied from interface:RuleServiceAdd Rule to DB- Specified by:
addRulein interfaceRuleService- Parameters:
ruleDTO- : an object of type RuleDTO- Returns:
- RuleDTO object
- Throws:
IllegalArgumentExceptionjavax.persistence.EntityExistsException
-
updateRule
public RuleDTO updateRule(RuleDTO ruleDTO) throws org.exoplatform.commons.exception.ObjectNotFoundException
Description copied from interface:RuleServiceUpdate Rule to DB- Specified by:
updateRulein interfaceRuleService- Parameters:
ruleDTO- : an object of type RuleDTO- Returns:
- RuleDTO object
- Throws:
org.exoplatform.commons.exception.ObjectNotFoundException
-
-