Class RankDaoImpl

java.lang.Object
com.atlassian.greenhopper.manager.rank.RankDaoImpl
All Implemented Interfaces:
RankDao

@Service public class RankDaoImpl extends Object implements RankDao
Implementation of RankDao Ranking in the database happens in two steps: 1. Write a "transaction" of what should be done 2. Execute the "transaction" The second step is composed of two substeps. The first one checks whether the input parameters are correct
  • Field Details

  • Constructor Details

    • RankDaoImpl

      public RankDaoImpl()
  • Method Details

    • loadAll

      public void loadAll(Long customFieldId, com.atlassian.jira.util.Consumer<IssueRankingAO> consumer)
      Description copied from interface: RankDao
      Loads all data for a given field into the provided consumer
      Specified by:
      loadAll in interface RankDao
      Parameters:
      customFieldId - the ID of the rank custom field
    • insert

      public void insert(Long customFieldId, Long issueId, Long newNext, Long newPrevious)
      Description copied from interface: RankDao
      Insert a new rank. This involves two operations: wire the new previous and the issue => issue becomes child of new previous wire the new next and the issue => new next (former child of new previous) becomes child of issue
      Specified by:
      insert in interface RankDao
      Parameters:
      customFieldId - the ID of the rank custom field
      issueId - : the issueId of the issue to insert
      newNext - : the next issue from the new position, after the move. Can be null if moved to the last position.
      newPrevious - : the previous issue from the new position, after the move. Can be null if moved to the first position.
    • move

      public void move(Long customFieldId, Long issueId, Long oldNext, Long oldPrevious, Long newNext, Long newPrevious)
      Description copied from interface: RankDao
      Move a rank to a new position. This involves three operations: wire the old previous and next issues to fill the gap => old next becomes child of old previous wire the new previous and the issue => issue becomes child of new previous wire the new next and the issue => new next (former child of new previous) becomes child of issue
      Specified by:
      move in interface RankDao
      Parameters:
      customFieldId - the ID of the rank custom field
      issueId - : the issueId of the issue to move
      oldNext - : the next issue from the former position, before the move. Can be null in case the last issue is moved.
      oldPrevious - : the previous issue from the former position, before the move. Can be null in case the first issue is moved.
      newNext - : the next issue from the new position, after the move. Can be null if moved to the last position.
      newPrevious - : the previous issue from the new position, after the move. Can be null if moved to the first position.
    • remove

      public void remove(Long customFieldId, Long issueId, Long oldNext, Long oldPrevious)
      Description copied from interface: RankDao
      Remove a rank. This involves two operations: remove the issue wire the old previous and next issues to fill the gap => old next becomes child of old previous
      Specified by:
      remove in interface RankDao
      Parameters:
      customFieldId - the ID of the rank custom field
      issueId - : the issueId of the issue to remove
      oldNext - : the next issue from the former position, before the removal. Can be null in case the last issue is removed.
      oldPrevious - : the previous issue from the former position, before the removal. Can be null in case the first issue is removed.