Interface ChallengeService

All Known Implementing Classes:
ChallengeServiceImpl

public interface ChallengeService
  • Method Details

    • createChallenge

      Challenge createChallenge(Challenge challenge, String username) throws IllegalAccessException
      Creates a new challenge
      Parameters:
      challenge - Challenge object to create
      username - User name creating challenge
      Returns:
      created Challenge with generated technical identifier
      Throws:
      IllegalAccessException - when user is not authorized to create a challenge for the designated owner defined in object
    • createChallenge

      Challenge createChallenge(Challenge challenge)
      Creates a new challenge
      Parameters:
      challenge - Challenge object to create
      Returns:
      created Challenge with generated technical identifier
    • getChallengeById

      Challenge getChallengeById(long challengeId, String username) throws IllegalAccessException
      Retrieves a challenge identified by its technical identifier.
      Parameters:
      challengeId - technical identifier of a challenge
      username - User name accessing challenge
      Returns:
      A Challenge object
      Throws:
      IllegalAccessException - when user is not authorized to access challenge
    • getChallengeById

      Challenge getChallengeById(long challengeId)
      Retrieves a challenge identified by its technical identifier.
      Parameters:
      challengeId - technical identifier of a challenge
      Returns:
      A Challenge object
    • updateChallenge

      Challenge updateChallenge(Challenge challenge, String username) throws IllegalArgumentException, org.exoplatform.commons.exception.ObjectNotFoundException, IllegalAccessException
      Updates an existing challenge
      Parameters:
      challenge - Challenge object to update
      username - User name updating challenge
      Returns:
      updated Challenge
      Throws:
      IllegalArgumentException - when user is not authorized to update the challenge
      org.exoplatform.commons.exception.ObjectNotFoundException - when the challenge identified by its technical identifier is not found
      IllegalAccessException - when user is not authorized to create a challenge for the designated owner defined in object
    • deleteChallenge

      void deleteChallenge(Long challengeId, String username) throws IllegalAccessException, org.exoplatform.commons.exception.ObjectNotFoundException
      Retrieves all challenges by user.
      Parameters:
      challengeId - Offset
      username - Username who want to delete challenge
      Throws:
      IllegalAccessException - when user is not authorized to delete challenges
      org.exoplatform.commons.exception.ObjectNotFoundException - challenge not found
      IllegalArgumentException - when challenge has announcements or did not ended yet
    • getChallengesByFilterAndUser

      List<Challenge> getChallengesByFilterAndUser(RuleFilter challengeFilter, int offset, int limit, String username)
      Retrieves all challenges by user.
      Parameters:
      challengeFilter - RuleFilter used to filter challenges
      offset - index of the search
      limit - limit of results to return
      username - User name accessing challenges
      Returns:
      A <Challenge> object
    • countChallengesByFilterAndUser

      int countChallengesByFilterAndUser(RuleFilter challengeFilter, String username)
      Count all challenges by user and a selected domain identified by its technical id
      Parameters:
      challengeFilter - RuleFilter used to filter challenges
      username - Username accessing challenges
      Returns:
      challenges count
    • clearUserChallengeCache

      void clearUserChallengeCache()
      clear challenges cache.