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)
VoteManager
addVote
in interface VoteManager
user
- the Userissue
- the Issuepublic boolean addVote(ApplicationUser user, org.ofbiz.core.entity.GenericValue issue)
VoteManager
addVote
in interface VoteManager
user
- the Userissue
- the Issuepublic boolean removeVote(ApplicationUser user, org.ofbiz.core.entity.GenericValue issue)
VoteManager
removeVote
in interface VoteManager
user
- the Userissue
- the Issuepublic boolean removeVote(ApplicationUser user, Issue issue)
VoteManager
removeVote
in interface VoteManager
user
- the Userissue
- the Issuepublic Collection<String> getVoterUsernames(Issue issue)
VoteManager
getVoterUsernames
in interface VoteManager
issue
- the Issuepublic Collection<String> getVoterUsernames(org.ofbiz.core.entity.GenericValue issue)
VoteManager
getVoterUsernames
in interface VoteManager
issue
- issue voted forpublic Collection<String> getVoterUserkeys(Issue issue)
VoteManager
getVoterUserkeys
in interface VoteManager
issue
- issue voted forpublic int getVoteCount(Issue issue)
VoteManager
getVoteCount
in interface VoteManager
issue
- issue voted forpublic List<VoteHistoryEntry> getVoteHistory(Issue issue)
VoteManager
getVoteHistory
in interface VoteManager
issue
- the issue to viewpublic List<ApplicationUser> getVoters(Issue issue, Locale usersLocale)
VoteManager
getVoters
in interface VoteManager
issue
- 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)
VoteManager
getVotersFor
in interface VoteManager
issue
- the IssueusersLocale
- the locale of the user making this call which is used to sort the results.public boolean isVotingEnabled()
isVotingEnabled
in interface VoteManager
public boolean hasVoted(ApplicationUser user, Issue issue)
VoteManager
hasVoted
in interface VoteManager
user
- the Userissue
- the Issuepublic boolean hasVoted(ApplicationUser user, org.ofbiz.core.entity.GenericValue issue)
VoteManager
hasVoted
in interface VoteManager
user
- the Userissue
- the Issuepublic void removeVotesForUser(ApplicationUser user)
VoteManager
removeVotesForUser
in interface VoteManager
user
- user to remove vote associations for.Copyright © 2002-2019 Atlassian. All Rights Reserved.