Package io.meeds.poll.service
Interface PollService
-
public interface PollService
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description PollcreatePoll(Poll poll, List<PollOption> pollOptions, String spaceId, String message, org.exoplatform.services.security.Identity currentIdentity, List<org.exoplatform.social.core.activity.model.ActivityFile> files)Creates a new pollPollgetPollById(long pollId, org.exoplatform.services.security.Identity currentIdentity)Retrieves a poll identified by its technical identifier.PollOptiongetPollOptionById(long pollOptionId, org.exoplatform.services.security.Identity currentIdentity)Retrieves a poll option identified by its technical identifier.List<PollOption>getPollOptionsByPollId(long pollId, org.exoplatform.services.security.Identity currentIdentity)Retrieves options of a poll identified by its technical identifier.intgetPollOptionsNumber(long pollId, org.exoplatform.services.security.Identity currentIdentity)Retrieves the number of poll options identified by its technical identifierintgetPollOptionTotalVotes(long pollOptionId, String spaceId, org.exoplatform.services.security.Identity currentIdentity)Retrieves total votes of a poll option identified by its technical identifierintgetPollTotalVotes(long pollId, org.exoplatform.services.security.Identity currentIdentity)Retrieves total votes of a poll identified by its technical identifierbooleanisPollOptionVoted(long pollOptionId, String spaceId, org.exoplatform.services.security.Identity currentIdentity)Checks if a the current user has voted a poll option identified by its technical identifier.PollVotevote(String pollOptionId, String spaceId, org.exoplatform.services.security.Identity currentIdentity)Votes a poll option
-
-
-
Method Detail
-
createPoll
Poll createPoll(Poll poll, List<PollOption> pollOptions, String spaceId, String message, org.exoplatform.services.security.Identity currentIdentity, List<org.exoplatform.social.core.activity.model.ActivityFile> files) throws IllegalAccessException
Creates a new poll- Parameters:
poll-Pollobject to createpollOptions-Polloptions objects to createspaceId-Spaceid related to thepollto be createdmessage- Message ofPollactivity to be createdcurrentIdentity- User identity creating thepoll- Returns:
- created
Pollwith generated technical identifier - Throws:
IllegalAccessException- when the current user is not authorized to create apoll
-
getPollById
Poll getPollById(long pollId, org.exoplatform.services.security.Identity currentIdentity) throws IllegalAccessException
Retrieves a poll identified by its technical identifier.- Parameters:
pollId- technical identifier of apollcurrentIdentity- User identity getting thepoll- Returns:
- A
Pollobject - Throws:
IllegalAccessException- when the current user is not authorized to get apoll
-
getPollOptionById
PollOption getPollOptionById(long pollOptionId, org.exoplatform.services.security.Identity currentIdentity) throws IllegalAccessException
Retrieves a poll option identified by its technical identifier.- Parameters:
pollId- technical identifier of apollcurrentIdentity- User identity getting thepolloption- Returns:
- A
Polloption object - Throws:
IllegalAccessException- when the current user is not authorized to get apolloption
-
getPollOptionsByPollId
List<PollOption> getPollOptionsByPollId(long pollId, org.exoplatform.services.security.Identity currentIdentity) throws IllegalAccessException
Retrieves options of a poll identified by its technical identifier.- Parameters:
pollId- technical identifier of apollcurrentIdentity- User identity getting thepolloptions- Returns:
- A
Pollobject - Throws:
IllegalAccessException- when the current user is not authorized to get poll options of apoll
-
vote
PollVote vote(String pollOptionId, String spaceId, org.exoplatform.services.security.Identity currentIdentity) throws IllegalAccessException
Votes a poll option- Parameters:
pollOptionId-Polloption id to be votedspaceId-Spaceid related to the votedpollcurrentIdentity- User identity voting in thepoll- Returns:
- created
Pollvote with generated technical identifier - Throws:
IllegalAccessException- when the current user is not authorized to vote
-
getPollOptionTotalVotes
int getPollOptionTotalVotes(long pollOptionId, String spaceId, org.exoplatform.services.security.Identity currentIdentity) throws IllegalAccessExceptionRetrieves total votes of a poll option identified by its technical identifier- Parameters:
pollOptionId-Polloption technical identifierspaceId-Spaceid related to thepolloptioncurrentIdentity- User identity- Returns:
- The
Polloption total votes - Throws:
IllegalAccessException- when the current user is not authorized to get thepolloption total votes
-
isPollOptionVoted
boolean isPollOptionVoted(long pollOptionId, String spaceId, org.exoplatform.services.security.Identity currentIdentity) throws IllegalAccessExceptionChecks if a the current user has voted a poll option identified by its technical identifier.- Parameters:
pollOptionId-Polloption technical identifier to be checked if it is votedspaceId-Spaceid related to thepolloptioncurrentIdentity- User identity to be checked if he has voted thepolloption- Returns:
- A
booleanwhich indicates if the current identity has voted thepolloption - Throws:
IllegalAccessException- when the current user is not authorized to check if thepolloption is voted
-
getPollOptionsNumber
int getPollOptionsNumber(long pollId, org.exoplatform.services.security.Identity currentIdentity) throws IllegalAccessExceptionRetrieves the number of poll options identified by its technical identifier- Parameters:
pollId- technical identifier of apollcurrentIdentity- User identifier getting thepolloptions number- Returns:
- The
polloptions number - Throws:
IllegalAccessException- when the current user is not authorized to getpolloptions number
-
getPollTotalVotes
int getPollTotalVotes(long pollId, org.exoplatform.services.security.Identity currentIdentity) throws IllegalAccessExceptionRetrieves total votes of a poll identified by its technical identifier- Parameters:
pollId- technical identifier of apollcurrentIdentity- User identifier getting thepolltotal votes- Returns:
- The
Polltotal votes - Throws:
IllegalAccessException- when the current user is not authorized to getpolltotal votes
-
-