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, com.atlassian.core.ofbiz.association.AssociationManager associationManager, IssueIndexManager indexManager, IssueManager issueManager)
           
 
Method Summary
 boolean addVote(User user, org.ofbiz.core.entity.GenericValue issue)
          Add vote to issue - returns if vote was successfully added
 Collection getVoters(Locale usersLocale, org.ofbiz.core.entity.GenericValue issue)
          Return a list of users that have voted on the specified issue
 Collection getVoterUsernames(org.ofbiz.core.entity.GenericValue issue)
          Return a collection of usernames of users that voted for given issue
 boolean hasVoted(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(User user, org.ofbiz.core.entity.GenericValue issue)
          Remove vote from issue - returns if vote was successfully removed
 void removeVotesForUser(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(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(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 Collection 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 Collection getVoters(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(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(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-2009 Atlassian. All Rights Reserved.