com.atlassian.jira.bc.issue.vote
Class DefaultVoteService
java.lang.Object
com.atlassian.jira.bc.issue.vote.DefaultVoteService
- All Implemented Interfaces:
- VoteService
public class DefaultVoteService
- extends Object
- implements VoteService
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DefaultVoteService
public DefaultVoteService(VoteManager voteManager,
I18nHelper.BeanFactory beanFactory,
ApplicationProperties applicationProperties,
PermissionManager permissionManager)
validateAddVote
public VoteService.VoteValidationResult validateAddVote(User remoteUser,
User voter,
Issue issue)
- Description copied from interface:
VoteService
- Validates if the user currently logged in may add a vote by the user supplied for the issue provided.
The remoteUser and user arguments may be the same if the current user is voting him/herself. The
VoteService.VoteValidationResult
produced by this method should be
used in conjunction with the VoteService.addVote(com.opensymphony.user.User, com.atlassian.jira.bc.issue.vote.VoteService.VoteValidationResult)
method.
The following conditions will fail validation:
- remoteUser is null (i.e. not logged in)
- the user is the reporter of the issue
- the issue has already been resolved
- the user has already voted for this issue
- voting has been disabled system wide
- the user doesn't have permission to browse the issue
- Specified by:
validateAddVote
in interface VoteService
- Parameters:
remoteUser
- The currently logged in uservoter
- The user for whom a vote is being addedissue
- The issue being voted on
- Returns:
- A validation result containing all errors, as well as the user and issue being voted on
addVote
public int addVote(User remoteUser,
VoteService.VoteValidationResult validationResult)
- Description copied from interface:
VoteService
- Adds a new vote using the specified validation result
- Specified by:
addVote
in interface VoteService
- Parameters:
remoteUser
- The currently logged in uservalidationResult
- Validation result for adding a new vote
- Returns:
- The updated number of votes for the issue being voted for
validateRemoveVote
public VoteService.VoteValidationResult validateRemoveVote(User remoteUser,
User voter,
Issue issue)
- Description copied from interface:
VoteService
- Validates if the user currently logged in may remove a vote for the user supplied for the issue provided.
The remoteUser and user arguments may be the same if the current user is voting him/herself. The
VoteService.VoteValidationResult
produced by this method should be
used in conjunction with the VoteService.removeVote(com.opensymphony.user.User, com.atlassian.jira.bc.issue.vote.VoteService.VoteValidationResult)
method.
The following conditions will fail validation:
- remoteUser is null (i.e. not logged in)
- the user is the reporter of the issue
- the issue has already been resolved
- the user has not yet voted for this issue
- voting has been disabled system wide
- the user doesn't have permission to browse the issue
- Specified by:
validateRemoveVote
in interface VoteService
- Parameters:
remoteUser
- The currently logged in uservoter
- The user for whom a vote is being removedissue
- The issue being voted on
- Returns:
- A validation result containing all errors, as well as the user and issue being voted on
removeVote
public int removeVote(User remoteUser,
VoteService.VoteValidationResult validationResult)
- Description copied from interface:
VoteService
- Removes a new vote using the specified validation result
- Specified by:
removeVote
in interface VoteService
- Parameters:
remoteUser
- The currently logged in uservalidationResult
- Validation result for removing a new vote
- Returns:
- The updated number of votes for the issue being voted for
Copyright © 2002-2010 Atlassian. All Rights Reserved.