All Known Implementing Classes:
RuleServiceImpl

public interface RuleService
  • Method Details

    • findEnableRuleByTitle

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

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

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

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

      RuleDTO findRuleByEventAndDomain(String ruleTitle, long domainId)
      Find a RuleEntity by title
      Parameters:
      ruleTitle - : rule's title param
      domainId - domain id
      Returns:
      an instance of RuleDTO
    • findAllRules

      @Deprecated(since="Meeds 1.4.0", forRemoval=true) List<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 issues
      Get all Rules from DB
      Returns:
      RuleDTO list
      Since:
      Meeds 1.4.0
    • findAllRules

      List<RuleDTO> findAllRules(int offset, int limit)
      Get all Rules using offset and limit.
      Parameters:
      offset - Offset of result
      limit - Limit of result
      Returns:
      List of RuleDTO
    • getRulesByFilter

      List<RuleDTO> getRulesByFilter(RuleFilter ruleFilter, int offset, int limit)
      Get Rules by filter using offset and limit.
      Parameters:
      ruleFilter - RuleFilter used to filter rules
      offset - Offset of result
      limit - Limit of result
      Returns:
      List of RuleDTO
    • countAllRules

      int countAllRules(RuleFilter ruleFilter)
      Parameters:
      ruleFilter - RuleFilter used to count associated rules
      Returns:
      count rules by filter
    • getActiveRules

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

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

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

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

      List<String> 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 delete
      username - User name of user attempting to delete a rule
      Returns:
      deleted RuleDTO
      Throws:
      IllegalAccessException - when user is not authorized to delete the rule
      org.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 - RuleDTO to create
      username - User name of user attempting to create a rule
      Returns:
      created RuleDTO
      Throws:
      IllegalAccessException - when user is not authorized to create a rule
      org.exoplatform.commons.ObjectAlreadyExistsException - when rule already exists
    • createRule

      RuleDTO createRule(RuleDTO ruleDTO)
      Add Rule to DB
      Parameters:
      ruleDTO - RuleDTO to create
      Returns:
      created RuleDTO
    • updateRule

      RuleDTO updateRule(RuleDTO ruleDTO, String username) throws org.exoplatform.commons.exception.ObjectNotFoundException, IllegalAccessException
      Update Rule to DB
      Parameters:
      ruleDTO - RuleDTO to update
      username - User name of user attempting to update a rule
      Returns:
      updated RuleDTO
      Throws:
      org.exoplatform.commons.exception.ObjectNotFoundException - when rule doesn't exists
      IllegalAccessException - 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
      Parameters:
      ruleDTO - RuleDTO to update
      Returns:
      updated RuleDTO
      Throws:
      org.exoplatform.commons.exception.ObjectNotFoundException - when rule doesn't exists