public class DefaultVoteManager extends Object implements VoteManager
| Constructor and Description |
|---|
DefaultVoteManager(ApplicationProperties applicationProperties,
UserAssociationStore userAssociationStore,
IssueIndexManager indexManager,
VoteHistoryStore voteHistoryStore,
IssueManager issueManager,
IssueFactory issueFactory,
UserManager userManager) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
addVote(ApplicationUser user,
org.ofbiz.core.entity.GenericValue issue)
Adds a new vote for the user and issue specified.
|
boolean |
addVote(ApplicationUser user,
Issue issue)
Adds a new vote for the user and issue specified.
|
int |
getVoteCount(Issue issue)
Return the number of users that have voted for the given issue.
|
List<VoteHistoryEntry> |
getVoteHistory(Issue issue)
Get the list of vote history for an issue.
|
List<ApplicationUser> |
getVoters(Issue issue,
Locale usersLocale)
Returns an ordered list of voters for a particular issue.
|
protected com.google.common.cache.LoadingCache<Long,com.google.common.collect.ImmutableSet<String>> |
getVotersCache() |
List<ApplicationUser> |
getVotersFor(Issue issue,
Locale usersLocale)
Returns an ordered list of voters for a particular issue.
|
Collection<String> |
getVoterUserkeys(Issue issue)
Return a collection of userkeys of users that voted for given issue
|
Collection<String> |
getVoterUsernames(org.ofbiz.core.entity.GenericValue issue)
Return a collection of usernames of users that voted for given issue
|
Collection<String> |
getVoterUsernames(Issue issue)
Return a collection of usernames of users that voted for the given issue.
|
boolean |
hasVoted(ApplicationUser user,
org.ofbiz.core.entity.GenericValue issue)
Checks if the given User has voted on the given Issue.
|
boolean |
hasVoted(ApplicationUser user,
Issue issue)
Checks if the given User has voted on the given Issue.
|
boolean |
isVotingEnabled()
Check if voting has been enabled
|
boolean |
removeVote(ApplicationUser user,
org.ofbiz.core.entity.GenericValue issue)
Removes a vote for the user and issue specified.
|
boolean |
removeVote(ApplicationUser user,
Issue issue)
Removes a vote for the user and issue specified.
|
void |
removeVotesForUser(ApplicationUser user)
Removes all votes made by user.
|
public DefaultVoteManager(ApplicationProperties applicationProperties, UserAssociationStore userAssociationStore, IssueIndexManager indexManager, VoteHistoryStore voteHistoryStore, IssueManager issueManager, IssueFactory issueFactory, UserManager userManager)
public boolean addVote(ApplicationUser user, Issue issue)
VoteManageraddVote in interface VoteManageruser - the Userissue - the Issuepublic boolean addVote(ApplicationUser user, org.ofbiz.core.entity.GenericValue issue)
VoteManageraddVote in interface VoteManageruser - the Userissue - the Issuepublic boolean removeVote(ApplicationUser user, org.ofbiz.core.entity.GenericValue issue)
VoteManagerremoveVote in interface VoteManageruser - the Userissue - the Issuepublic boolean removeVote(ApplicationUser user, Issue issue)
VoteManagerremoveVote in interface VoteManageruser - the Userissue - the Issuepublic Collection<String> getVoterUsernames(Issue issue)
VoteManagergetVoterUsernames in interface VoteManagerissue - the Issuepublic Collection<String> getVoterUsernames(org.ofbiz.core.entity.GenericValue issue)
VoteManagergetVoterUsernames in interface VoteManagerissue - issue voted forpublic Collection<String> getVoterUserkeys(Issue issue)
VoteManagergetVoterUserkeys in interface VoteManagerissue - issue voted forpublic int getVoteCount(Issue issue)
VoteManagergetVoteCount in interface VoteManagerissue - issue voted forpublic List<VoteHistoryEntry> getVoteHistory(Issue issue)
VoteManagergetVoteHistory in interface VoteManagerissue - the issue to viewpublic List<ApplicationUser> getVoters(Issue issue, Locale usersLocale)
VoteManagergetVoters in interface VoteManagerissue - the IssueusersLocale - the locale of the user making this call which is used to sort the results.public List<ApplicationUser> getVotersFor(Issue issue, Locale usersLocale)
VoteManagergetVotersFor in interface VoteManagerissue - the IssueusersLocale - the locale of the user making this call which is used to sort the results.public boolean isVotingEnabled()
isVotingEnabled in interface VoteManagerpublic boolean hasVoted(ApplicationUser user, Issue issue)
VoteManagerhasVoted in interface VoteManageruser - the Userissue - the Issuepublic boolean hasVoted(ApplicationUser user, org.ofbiz.core.entity.GenericValue issue)
VoteManagerhasVoted in interface VoteManageruser - the Userissue - the Issuepublic void removeVotesForUser(ApplicationUser user)
VoteManagerremoveVotesForUser in interface VoteManageruser - user to remove vote associations for.Copyright © 2002-2024 Atlassian. All Rights Reserved.