Class RuleService


  • public class RuleService
    extends Object
    • Field Detail

      • ruleDAO

        protected final RuleDAO ruleDAO
      • ruleMapper

        protected final RuleMapper ruleMapper
    • Constructor Detail

      • RuleService

        public RuleService()
    • Method Detail

      • findEnableRuleByTitle

        public RuleDTO findEnableRuleByTitle​(String ruleTitle)
        Find enable RuleEntity by title
        Parameters:
        ruleTitle - : rule's title param
        Returns:
        an instance of RuleDTO
      • findRuleById

        public RuleDTO findRuleById​(Long id)
        Get RuleEntity by id
        Parameters:
        id - : rule's id param
        Returns:
        an instance of RuleDTO
      • findEnabledRulesByEvent

        public List<RuleDTO> findEnabledRulesByEvent​(String ruleTitle)
        Find enable RuleEntity by title
        Parameters:
        ruleTitle - : rule's title param
        Returns:
        an instance of RuleDTO
      • findRuleByTitle

        public RuleDTO findRuleByTitle​(String ruleTitle)
        Find a RuleEntity by title
        Parameters:
        ruleTitle - : rule's title param
        Returns:
        an instance of RuleDTO
      • findRuleByEventAndDomain

        public RuleDTO findRuleByEventAndDomain​(String ruleTitle,
                                                String domain)
        Find a RuleEntity by title
        Parameters:
        ruleTitle - : rule's title param
        domain - : rule's domain param
        Returns:
        an instance of RuleDTO
      • getAllRules

        public List<RuleDTO> getAllRules()
        Get all Rules from DB
        Returns:
        RuleDTO list
      • getAllRulesByDomain

        public List<RuleDTO> getAllRulesByDomain​(String domain)
        Get all Rules by Domain from DB * @param domain : rule's domain param
        Returns:
        RuleDTO list
      • getAllRulesWithNullDomain

        public List<RuleDTO> getAllRulesWithNullDomain()
        Get all Rules by with null DomainDTO from DB
        Returns:
        RuleDTO list
      • getAllEvents

        public List<String> getAllEvents()
        Get all Events from rules
        Returns:
        RuleDTO list
      • getDomainListFromRules

        public List<String> getDomainListFromRules()
        Get all Domains from Rules from DB
        Returns:
        String list
      • addRule

        public RuleDTO addRule​(RuleDTO ruleDTO)
                        throws Exception
        Add Rule to DB
        Parameters:
        ruleDTO - : an object of type RuleDTO
        Returns:
        RuleDTO object
        Throws:
        Exception
      • updateRule

        public RuleDTO updateRule​(RuleDTO ruleDTO)
                           throws Exception
        Update Rule to DB
        Parameters:
        ruleDTO - : an object of type RuleDTO
        Returns:
        RuleDTO object
        Throws:
        Exception