Interface ChallengeService
- All Known Implementing Classes:
ChallengeServiceImpl
public interface ChallengeService
-
Method Summary
Modifier and TypeMethodDescriptionvoidclear challenges cache.intcountChallengesByFilterAndUser(RuleFilter challengeFilter, String username) Count all challenges by user and a selected domain identified by its technical idcreateChallenge(Challenge challenge) Creates a new challengecreateChallenge(Challenge challenge, String username) Creates a new challengevoiddeleteChallenge(Long challengeId, String username) Retrieves all challenges by user.getChallengeById(long challengeId) Retrieves a challenge identified by its technical identifier.getChallengeById(long challengeId, String username) Retrieves a challenge identified by its technical identifier.getChallengesByFilterAndUser(RuleFilter challengeFilter, int offset, int limit, String username) Retrieves all challenges by user.updateChallenge(Challenge challenge, String username) Updates an existing challenge
-
Method Details
-
createChallenge
Creates a new challenge- Parameters:
challenge-Challengeobject to createusername- User name creating challenge- Returns:
- created
Challengewith generated technical identifier - Throws:
IllegalAccessException- when user is not authorized to create a challenge for the designated owner defined in object
-
createChallenge
Creates a new challenge -
getChallengeById
Retrieves a challenge identified by its technical identifier.- Parameters:
challengeId- technical identifier of a challengeusername- User name accessing challenge- Returns:
- A
Challengeobject - Throws:
IllegalAccessException- when user is not authorized to access challenge
-
getChallengeById
Retrieves a challenge identified by its technical identifier.- Parameters:
challengeId- technical identifier of a challenge- Returns:
- A
Challengeobject
-
updateChallenge
Challenge updateChallenge(Challenge challenge, String username) throws IllegalArgumentException, org.exoplatform.commons.exception.ObjectNotFoundException, IllegalAccessException Updates an existing challenge- Parameters:
challenge-Challengeobject to updateusername- User name updating challenge- Returns:
- updated
Challenge - Throws:
IllegalArgumentException- when user is not authorized to update the challengeorg.exoplatform.commons.exception.ObjectNotFoundException- when the challenge identified by its technical identifier is not foundIllegalAccessException- 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- Offsetusername- Username who want to delete challenge- Throws:
IllegalAccessException- when user is not authorized to delete challengesorg.exoplatform.commons.exception.ObjectNotFoundException- challenge not foundIllegalArgumentException- 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-RuleFilterused to filter challengesoffset- index of the searchlimit- limit of results to returnusername- User name accessing challenges- Returns:
- A
<Challenge>object
-
countChallengesByFilterAndUser
Count all challenges by user and a selected domain identified by its technical id- Parameters:
challengeFilter-RuleFilterused to filter challengesusername- Username accessing challenges- Returns:
- challenges count
-
clearUserChallengeCache
void clearUserChallengeCache()clear challenges cache.
-