Package com.atlassian.jira.issue.vote
Class DefaultVoteManager
java.lang.Object
com.atlassian.jira.issue.vote.DefaultVoteManager
- All Implemented Interfaces:
VoteManager
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultVoteManager(ApplicationProperties applicationProperties, UserAssociationStore userAssociationStore, IssueIndexManager indexManager, VoteHistoryStore voteHistoryStore, IssueManager issueManager, IssueFactory issueFactory, UserManager userManager, com.atlassian.event.api.EventPublisher eventPublisher) -
Method Summary
Modifier and TypeMethodDescriptionbooleanaddVote(ApplicationUser user, Issue issue) Adds a new vote for the user and issue specified.booleanaddVote(ApplicationUser user, org.ofbiz.core.entity.GenericValue issue) Adds a new vote for the user and issue specified.intgetVoteCount(Issue issue) Return the number of users that have voted for the given issue.getVoteHistory(Issue issue) Get the list of vote history for an issue.Returns an ordered list of voters for a particular issue.getVotersFor(Issue issue, Locale usersLocale) Returns an ordered list of voters for a particular issue.getVoterUserkeys(Issue issue) Return a collection of userkeys of users that voted for given issuegetVoterUsernames(Issue issue) Return a collection of usernames of users that voted for the given issue.getVoterUsernames(org.ofbiz.core.entity.GenericValue issue) Return a collection of usernames of users that voted for given issuebooleanhasVoted(ApplicationUser user, Issue issue) Checks if the given User has voted on the given Issue.booleanhasVoted(ApplicationUser user, org.ofbiz.core.entity.GenericValue issue) Checks if the given User has voted on the given Issue.booleanCheck if voting has been enabledbooleanremoveVote(ApplicationUser user, Issue issue) Removes a vote for the user and issue specified.booleanremoveVote(ApplicationUser user, org.ofbiz.core.entity.GenericValue issue) Removes a vote for the user and issue specified.voidRemoves all votes made by user.
-
Constructor Details
-
DefaultVoteManager
public DefaultVoteManager(ApplicationProperties applicationProperties, UserAssociationStore userAssociationStore, IssueIndexManager indexManager, VoteHistoryStore voteHistoryStore, IssueManager issueManager, IssueFactory issueFactory, UserManager userManager, com.atlassian.event.api.EventPublisher eventPublisher)
-
-
Method Details
-
addVote
Description copied from interface:VoteManagerAdds a new vote for the user and issue specified.- Specified by:
addVotein interfaceVoteManager- Parameters:
user- the Userissue- the Issue- Returns:
- True if the vote succeeded. False if the user or issue supplied were null, or if the resolution is set or if voting is disabled.
-
addVote
Description copied from interface:VoteManagerAdds a new vote for the user and issue specified.- Specified by:
addVotein interfaceVoteManager- Parameters:
user- the Userissue- the Issue- Returns:
- false, if the user or issue supplied were null, or if the resolution is set or if voting is disabled. True if the vote succeeded.
-
removeVote
Description copied from interface:VoteManagerRemoves a vote for the user and issue specified.- Specified by:
removeVotein interfaceVoteManager- Parameters:
user- the Userissue- the Issue- Returns:
- false, if the user or issue supplied were null, or if the resolution is set or if voting is disabled. True if removing a vote succeeded.
-
removeVote
Description copied from interface:VoteManagerRemoves a vote for the user and issue specified.- Specified by:
removeVotein interfaceVoteManager- Parameters:
user- the Userissue- the Issue- Returns:
- true if removing a vote succeeded.
-
getVoterUsernames
Description copied from interface:VoteManagerReturn a collection of usernames of users that voted for the given issue.- Specified by:
getVoterUsernamesin interfaceVoteManager- Parameters:
issue- the Issue- Returns:
- a collection of usernames, never null
-
getVoterUsernames
Description copied from interface:VoteManagerReturn a collection of usernames of users that voted for given issue- Specified by:
getVoterUsernamesin interfaceVoteManager- Parameters:
issue- issue voted for- Returns:
- a collection of usernames, never null
-
getVoterUserkeys
Description copied from interface:VoteManagerReturn a collection of userkeys of users that voted for given issue- Specified by:
getVoterUserkeysin interfaceVoteManager- Parameters:
issue- issue voted for- Returns:
- a collection of userkeys, never null
-
getVoteCount
Description copied from interface:VoteManagerReturn the number of users that have voted for the given issue.- Specified by:
getVoteCountin interfaceVoteManager- Parameters:
issue- issue voted for- Returns:
- the number of users that have voted for the given issue.
-
getVoteHistory
Description copied from interface:VoteManagerGet the list of vote history for an issue. The history will be in time sequence.- Specified by:
getVoteHistoryin interfaceVoteManager- Parameters:
issue- the issue to view- Returns:
- List of Vote History Entries
-
getVoters
Description copied from interface:VoteManagerReturns an ordered list of voters for a particular issue.- Specified by:
getVotersin interfaceVoteManager- Parameters:
issue- the IssueusersLocale- the locale of the user making this call which is used to sort the results.- Returns:
- an ordered list of voters for a particular issue.
-
getVotersFor
Description copied from interface:VoteManagerReturns an ordered list of voters for a particular issue.- Specified by:
getVotersForin interfaceVoteManager- Parameters:
issue- the IssueusersLocale- the locale of the user making this call which is used to sort the results.- Returns:
- an ordered list of voters for the given issue.
-
isVotingEnabled
public boolean isVotingEnabled()Check if voting has been enabled- Specified by:
isVotingEnabledin interfaceVoteManager- Returns:
- True if voting is enabled
-
hasVoted
Description copied from interface:VoteManagerChecks if the given User has voted on the given Issue.- Specified by:
hasVotedin interfaceVoteManager- Parameters:
user- the Userissue- the Issue- Returns:
- True if the user has voted.
-
hasVoted
Description copied from interface:VoteManagerChecks if the given User has voted on the given Issue. the user supplied.- Specified by:
hasVotedin interfaceVoteManager- Parameters:
user- the Userissue- the Issue- Returns:
- True if the user has voted.
-
removeVotesForUser
Description copied from interface:VoteManagerRemoves all votes made by user. Usually means user is being deleted.- Specified by:
removeVotesForUserin interfaceVoteManager- Parameters:
user- user to remove vote associations for.
-
getVotersCache
-