com.atlassian.jira.issue.vote
Interface VoteManager

All Known Implementing Classes:
DefaultVoteManager

public interface VoteManager

The vote manager is responsible for counting issue votes.


Method Summary
 boolean addVote(User user, org.ofbiz.core.entity.GenericValue issue)
          Adds a new vote for the user and issue specified.
 Collection getVoters(org.ofbiz.core.entity.GenericValue issue)
          Return a list of voters for a particular 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)
          Checks if the collection of getVoters(org.ofbiz.core.entity.GenericValue) contains the user supplied.
 boolean isVotingEnabled()
          Retrieves the 'jira.option.voting' property
 boolean removeVote(User user, org.ofbiz.core.entity.GenericValue issue)
          Removes a vote for the user and issue specified.
 void removeVotesForUser(User user)
          Removes all votes made by user.
 

Method Detail

addVote

boolean addVote(User user,
                org.ofbiz.core.entity.GenericValue issue)
Adds a new vote for the user and issue specified.

Parameters:
user -
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

boolean removeVote(User user,
                   org.ofbiz.core.entity.GenericValue issue)
Removes a vote for the user and issue specified.

Parameters:
user -
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.

getVoters

Collection getVoters(org.ofbiz.core.entity.GenericValue issue)
Return a list of voters for a particular issue.

Parameters:
issue -
Returns:
A collection of Users

getVoterUsernames

Collection getVoterUsernames(org.ofbiz.core.entity.GenericValue issue)
Return a collection of usernames of users that voted for given issue

Parameters:
issue - issue voted for
Returns:
a collection of usernames, never null
Since:
v3.13

isVotingEnabled

boolean isVotingEnabled()
Retrieves the 'jira.option.voting' property

Returns:
True if voting is enabled

hasVoted

boolean hasVoted(User user,
                 org.ofbiz.core.entity.GenericValue issue)
Checks if the collection of getVoters(org.ofbiz.core.entity.GenericValue) contains the user supplied.

Parameters:
user -
issue -
Returns:
True if the user has voted.

removeVotesForUser

void removeVotesForUser(User user)
Removes all votes made by user. Usually means user is being deleted.

Parameters:
user - user to remove vote associations for.
Since:
v3.13


Copyright © 2002-2009 Atlassian. All Rights Reserved.