com.atlassian.jira.issue.vote
Class DefaultVoteManager

java.lang.Object
  extended by com.atlassian.jira.issue.vote.DefaultVoteManager
All Implemented Interfaces:
VoteManager

public class DefaultVoteManager
extends Object
implements VoteManager


Constructor Summary
DefaultVoteManager(ApplicationProperties applicationProperties, UserAssociationStore userAssociationStore, IssueIndexManager indexManager, VoteHistoryStore voteHistoryStore, IssueManager issueManager)
           
 
Method Summary
 boolean addVote(ApplicationUser user, Issue issue)
          Adds a new vote for the user and issue specified.
 boolean addVote(com.atlassian.crowd.embedded.api.User user, org.ofbiz.core.entity.GenericValue issue)
          Adds a new vote for the user and issue specified.
 boolean addVote(com.atlassian.crowd.embedded.api.User 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<com.atlassian.crowd.embedded.api.User> getVoters(Issue issue, Locale usersLocale)
          Returns an ordered list of voters for a particular issue.
 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, Issue issue)
          Checks if the given User has voted on the given Issue.
 boolean hasVoted(com.atlassian.crowd.embedded.api.User user, org.ofbiz.core.entity.GenericValue issue)
          Checks if the given User has voted on the given Issue.
 boolean hasVoted(com.atlassian.crowd.embedded.api.User 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, Issue issue)
          Removes a vote for the user and issue specified.
 boolean removeVote(com.atlassian.crowd.embedded.api.User user, org.ofbiz.core.entity.GenericValue issue)
          Removes a vote for the user and issue specified.
 boolean removeVote(com.atlassian.crowd.embedded.api.User user, Issue issue)
          Removes a vote for the user and issue specified.
 void removeVotesForUser(ApplicationUser user)
          Removes all votes made by user.
 void removeVotesForUser(com.atlassian.crowd.embedded.api.User user)
          Removes all votes made by user.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultVoteManager

public DefaultVoteManager(ApplicationProperties applicationProperties,
                          UserAssociationStore userAssociationStore,
                          IssueIndexManager indexManager,
                          VoteHistoryStore voteHistoryStore,
                          IssueManager issueManager)
Method Detail

addVote

public boolean addVote(com.atlassian.crowd.embedded.api.User user,
                       Issue issue)
Description copied from interface: VoteManager
Adds a new vote for the user and issue specified.

Specified by:
addVote in interface VoteManager
Parameters:
user - the User
issue - 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

public boolean addVote(ApplicationUser user,
                       Issue issue)
Description copied from interface: VoteManager
Adds a new vote for the user and issue specified.

Specified by:
addVote in interface VoteManager
Parameters:
user - the User
issue - 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

public boolean addVote(com.atlassian.crowd.embedded.api.User user,
                       org.ofbiz.core.entity.GenericValue issue)
Description copied from interface: VoteManager
Adds a new vote for the user and issue specified.

Specified by:
addVote in interface VoteManager
Parameters:
user - the User
issue - 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

public boolean removeVote(com.atlassian.crowd.embedded.api.User user,
                          Issue issue)
Description copied from interface: VoteManager
Removes a vote for the user and issue specified.

Specified by:
removeVote in interface VoteManager
Parameters:
user - the User
issue - the Issue
Returns:
true if removing a vote succeeded.

removeVote

public boolean removeVote(ApplicationUser user,
                          Issue issue)
Description copied from interface: VoteManager
Removes a vote for the user and issue specified.

Specified by:
removeVote in interface VoteManager
Parameters:
user - the User
issue - the Issue
Returns:
true if removing a vote succeeded.

removeVote

public boolean removeVote(com.atlassian.crowd.embedded.api.User user,
                          org.ofbiz.core.entity.GenericValue issue)
Description copied from interface: VoteManager
Removes a vote for the user and issue specified.

Specified by:
removeVote in interface VoteManager
Parameters:
user - the User
issue - 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.

getVoterUsernames

public Collection<String> getVoterUsernames(Issue issue)
Description copied from interface: VoteManager
Return a collection of usernames of users that voted for the given issue.

Specified by:
getVoterUsernames in interface VoteManager
Parameters:
issue - the Issue
Returns:
a collection of usernames, never null

getVoterUsernames

public Collection<String> getVoterUsernames(org.ofbiz.core.entity.GenericValue issue)
Description copied from interface: VoteManager
Return a collection of usernames of users that voted for given issue

Specified by:
getVoterUsernames in interface VoteManager
Parameters:
issue - issue voted for
Returns:
a collection of usernames, never null

getVoterUserkeys

public Collection<String> getVoterUserkeys(Issue issue)
Description copied from interface: VoteManager
Return a collection of userkeys of users that voted for given issue

Specified by:
getVoterUserkeys in interface VoteManager
Parameters:
issue - issue voted for
Returns:
a collection of userkeys, never null

getVoteCount

public int getVoteCount(Issue issue)
Description copied from interface: VoteManager
Return the number of users that have voted for the given issue.

Specified by:
getVoteCount in interface VoteManager
Parameters:
issue - issue voted for
Returns:
the number of users that have voted for the given issue.

getVoteHistory

public List<VoteHistoryEntry> getVoteHistory(Issue issue)
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 interface VoteManager
Parameters:
issue - the issue to view
Returns:
List of Vote History Entries

getVoters

public List<com.atlassian.crowd.embedded.api.User> getVoters(Issue issue,
                                                             Locale usersLocale)
Description copied from interface: VoteManager
Returns an ordered list of voters for a particular issue.

Specified by:
getVoters in interface VoteManager
Parameters:
issue - the Issue
usersLocale - 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

public List<ApplicationUser> getVotersFor(Issue issue,
                                          Locale usersLocale)
Description copied from interface: VoteManager
Returns an ordered list of voters for a particular issue.

Specified by:
getVotersFor in interface VoteManager
Parameters:
issue - the Issue
usersLocale - 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 interface VoteManager
Returns:
True if voting is enabled

hasVoted

public boolean hasVoted(com.atlassian.crowd.embedded.api.User user,
                        Issue issue)
Description copied from interface: VoteManager
Checks if the given User has voted on the given Issue.

Specified by:
hasVoted in interface VoteManager
Parameters:
user - the User
issue - the Issue
Returns:
True if the user has voted.

hasVoted

public boolean hasVoted(ApplicationUser user,
                        Issue issue)
Description copied from interface: VoteManager
Checks if the given User has voted on the given Issue.

Specified by:
hasVoted in interface VoteManager
Parameters:
user - the User
issue - the Issue
Returns:
True if the user has voted.

hasVoted

public boolean hasVoted(com.atlassian.crowd.embedded.api.User user,
                        org.ofbiz.core.entity.GenericValue issue)
Description copied from interface: VoteManager
Checks if the given User has voted on the given Issue. the user supplied.

Specified by:
hasVoted in interface VoteManager
Parameters:
user - the User
issue - the Issue
Returns:
True if the user has voted.

removeVotesForUser

public void removeVotesForUser(com.atlassian.crowd.embedded.api.User user)
Description copied from interface: VoteManager
Removes all votes made by user. Usually means user is being deleted.

Specified by:
removeVotesForUser in interface VoteManager
Parameters:
user - user to remove vote associations for.

removeVotesForUser

public void removeVotesForUser(ApplicationUser user)
Description copied from interface: VoteManager
Removes all votes made by user. Usually means user is being deleted.

Specified by:
removeVotesForUser in interface VoteManager
Parameters:
user - user to remove vote associations for.


Copyright © 2002-2015 Atlassian. All Rights Reserved.