Class DefaultVoteManager

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

public class DefaultVoteManager extends Object implements VoteManager
  • Constructor Details

  • Method Details

    • 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(ApplicationUser 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(ApplicationUser 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.
    • 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.
    • 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<ApplicationUser> 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(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(ApplicationUser 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(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.
    • getVotersCache

      @Nonnull protected com.google.common.cache.LoadingCache<Long,com.google.common.collect.ImmutableSet<String>> getVotersCache()