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 java.lang.Object
implements VoteManager


Constructor Summary
DefaultVoteManager(ApplicationProperties applicationProperties, com.atlassian.core.ofbiz.association.AssociationManager associationManager, IssueIndexManager indexManager, IssueManager issueManager)
           
 
Method Summary
 boolean addVote(com.opensymphony.user.User user, org.ofbiz.core.entity.GenericValue issue)
          Add vote to issue - returns if vote was successfully added
 java.util.Collection<com.opensymphony.user.User> getVoters(java.util.Locale usersLocale, org.ofbiz.core.entity.GenericValue issue)
          Return a list of users that have voted on the specified issue
 java.util.Collection<java.lang.String> getVoterUsernames(org.ofbiz.core.entity.GenericValue issue)
          Return a collection of usernames of users that voted for given issue
 boolean hasVoted(com.opensymphony.user.User user, org.ofbiz.core.entity.GenericValue issue)
          Check if user has already voted on this issue
 boolean isVotingEnabled()
          Check if voting has been enabled
 boolean removeVote(com.opensymphony.user.User user, org.ofbiz.core.entity.GenericValue issue)
          Remove vote from issue - returns if vote was successfully removed
 void removeVotesForUser(com.opensymphony.user.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,
                          com.atlassian.core.ofbiz.association.AssociationManager associationManager,
                          IssueIndexManager indexManager,
                          IssueManager issueManager)
Method Detail

addVote

public boolean addVote(com.opensymphony.user.User user,
                       org.ofbiz.core.entity.GenericValue issue)
Add vote to issue - returns if vote was successfully added

Specified by:
addVote in interface VoteManager
Parameters:
user - user who votes for given issue
issue - issue being voted for
Returns:
successful

removeVote

public boolean removeVote(com.opensymphony.user.User user,
                          org.ofbiz.core.entity.GenericValue issue)
Remove vote from issue - returns if vote was successfully removed

Specified by:
removeVote in interface VoteManager
Parameters:
user - user who no longer votes for given issue
issue - issue being voted for
Returns:
successful

getVoterUsernames

public java.util.Collection<java.lang.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

getVoters

public java.util.Collection<com.opensymphony.user.User> getVoters(java.util.Locale usersLocale,
                                                                  org.ofbiz.core.entity.GenericValue issue)
Return a list of users that have voted on the specified issue

Specified by:
getVoters in interface VoteManager
Parameters:
usersLocale - the locale of the user making this call.
Returns:
A collection of Users

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.opensymphony.user.User user,
                        org.ofbiz.core.entity.GenericValue issue)
Check if user has already voted on this issue

Specified by:
hasVoted in interface VoteManager
Returns:
True if the user has voted.

removeVotesForUser

public void removeVotesForUser(com.opensymphony.user.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.


Copyright © 2002-2010 Atlassian. All Rights Reserved.