Interface ChallengeService
-
- All Known Implementing Classes:
ChallengeServiceImpl
public interface ChallengeService
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleancanAddChallenge()Return a boolean that indicates if the current user can add a challenge or notvoidclearUserChallengeCache()clear challenges cache.ChallengecreateChallenge(Challenge challenge)Creates a new challengeChallengecreateChallenge(Challenge challenge, String username)Creates a new challengevoiddeleteChallenge(Long challengeId, String username)Retrieves all challenges by user.List<Challenge>getAllChallengesByUser(int offset, int limit, String username)Retrieves all challenges by user.ChallengegetChallengeById(long challengeId, String username)Retrieves a challenge identified by its technical identifier.ChallengeupdateChallenge(Challenge challenge, String username)Updates an existing challenge
-
-
-
Method Detail
-
createChallenge
Challenge createChallenge(Challenge challenge, String username) throws IllegalAccessException
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
Challenge createChallenge(Challenge challenge)
Creates a new challenge- Parameters:
challenge-Challengeobject to create- Returns:
- created
Challengewith generated technical identifier - Throws:
IllegalAccessException- when user is not authorized to create a challenge for the designated owner defined in object
-
getChallengeById
Challenge getChallengeById(long challengeId, String username) throws IllegalAccessException
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
-
updateChallenge
Challenge updateChallenge(Challenge challenge, String username) throws IllegalArgumentException, org.exoplatform.commons.exception.ObjectNotFoundException, IllegalAccessException
Updates an existing challenge- Parameters:
challenge-Challengeobject to updateusername- Username updating 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
-
canAddChallenge
boolean canAddChallenge()
Return a boolean that indicates if the current user can add a challenge or not- Returns:
- if the user can add a challenge or not
-
getAllChallengesByUser
List<Challenge> getAllChallengesByUser(int offset, int limit, String username) throws Exception
Retrieves all challenges by user.- Parameters:
offset- Offsetlimit- Limitusername- Username accessing challenge- Returns:
- A
object - Throws:
IllegalAccessException- when user is not authorized to access challengesException- can't get list of spaces
-
clearUserChallengeCache
void clearUserChallengeCache()
clear challenges cache.
-
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
-
-