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 TypeMethodDescriptionboolean
addVote
(ApplicationUser user, Issue issue) Adds a new vote for the user and issue specified.boolean
addVote
(ApplicationUser user, org.ofbiz.core.entity.GenericValue 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.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 issueboolean
hasVoted
(ApplicationUser user, Issue issue) Checks if the given User has voted on 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
Check if voting has been enabledboolean
removeVote
(ApplicationUser user, Issue issue) Removes a vote for the user and issue specified.boolean
removeVote
(ApplicationUser user, org.ofbiz.core.entity.GenericValue issue) Removes a vote for the user and issue specified.void
Removes 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:VoteManager
Adds a new vote for the user and issue specified.- Specified by:
addVote
in 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:VoteManager
Adds a new vote for the user and issue specified.- Specified by:
addVote
in 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:VoteManager
Removes a vote for the user and issue specified.- Specified by:
removeVote
in 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:VoteManager
Removes a vote for the user and issue specified.- Specified by:
removeVote
in interfaceVoteManager
- Parameters:
user
- the Userissue
- the Issue- Returns:
- true if removing a vote succeeded.
-
getVoterUsernames
Description copied from interface:VoteManager
Return a collection of usernames of users that voted for the given issue.- Specified by:
getVoterUsernames
in interfaceVoteManager
- Parameters:
issue
- the Issue- Returns:
- a collection of usernames, never null
-
getVoterUsernames
Description copied from interface:VoteManager
Return a collection of usernames of users that voted for given issue- Specified by:
getVoterUsernames
in interfaceVoteManager
- Parameters:
issue
- issue voted for- Returns:
- a collection of usernames, never null
-
getVoterUserkeys
Description copied from interface:VoteManager
Return a collection of userkeys of users that voted for given issue- Specified by:
getVoterUserkeys
in interfaceVoteManager
- Parameters:
issue
- issue voted for- Returns:
- a collection of userkeys, never null
-
getVoteCount
Description copied from interface:VoteManager
Return the number of users that have voted for the given issue.- Specified by:
getVoteCount
in interfaceVoteManager
- Parameters:
issue
- issue voted for- Returns:
- the number of users that have voted for the given issue.
-
getVoteHistory
Description copied from interface:VoteManager
Get the list of vote history for an issue. The history will be in time sequence.- Specified by:
getVoteHistory
in interfaceVoteManager
- Parameters:
issue
- the issue to view- Returns:
- List of Vote History Entries
-
getVoters
Description copied from interface:VoteManager
Returns an ordered list of voters for a particular issue.- Specified by:
getVoters
in 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:VoteManager
Returns an ordered list of voters for a particular issue.- Specified by:
getVotersFor
in 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:
isVotingEnabled
in interfaceVoteManager
- Returns:
- True if voting is enabled
-
hasVoted
Description copied from interface:VoteManager
Checks if the given User has voted on the given Issue.- Specified by:
hasVoted
in interfaceVoteManager
- Parameters:
user
- the Userissue
- the Issue- Returns:
- True if the user has voted.
-
hasVoted
Description copied from interface:VoteManager
Checks if the given User has voted on the given Issue. the user supplied.- Specified by:
hasVoted
in interfaceVoteManager
- Parameters:
user
- the Userissue
- the Issue- Returns:
- True if the user has voted.
-
removeVotesForUser
Description copied from interface:VoteManager
Removes all votes made by user. Usually means user is being deleted.- Specified by:
removeVotesForUser
in interfaceVoteManager
- Parameters:
user
- user to remove vote associations for.
-
getVotersCache
-