com.atlassian.greenhopper.service.rank
Class RankDaoImpl

java.lang.Object
  extended by com.atlassian.greenhopper.global.AbstractLoggable
      extended by com.atlassian.greenhopper.service.rank.RankDaoImpl
All Implemented Interfaces:
RankDao

@Service
public class RankDaoImpl
extends AbstractLoggable
implements RankDao


Field Summary
 
Fields inherited from class com.atlassian.greenhopper.global.AbstractLoggable
logger
 
Constructor Summary
RankDaoImpl()
           
 
Method Summary
 void executeOutstandingTransaction()
          Executes any outstanding transactions.
 boolean hasOutstandingTransactions()
          Returns whether outstanding transactions are available
 void insert(java.lang.Long customFieldId, java.lang.Long issueId, java.lang.Long newNext, java.lang.Long newPrevious)
          Insert a new rank.
 void loadAll(java.lang.Long customFieldId, com.atlassian.jira.util.Consumer<IssueRankingAO> consumer)
          Loads all data
 void move(java.lang.Long customFieldId, java.lang.Long issueId, java.lang.Long oldNext, java.lang.Long oldPrevious, java.lang.Long newNext, java.lang.Long newPrevious)
          Move a rank to a new position.
 void remove(java.lang.Long customFieldId, java.lang.Long issueId, java.lang.Long oldNext, java.lang.Long oldPrevious)
          Remove a rank.
 
Methods inherited from class com.atlassian.greenhopper.global.AbstractLoggable
logDebug, logError, logException, logInfo, logTrace, logWarn, setInfoLogLevel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RankDaoImpl

public RankDaoImpl()
Method Detail

loadAll

public void loadAll(java.lang.Long customFieldId,
                    com.atlassian.jira.util.Consumer<IssueRankingAO> consumer)
Description copied from interface: RankDao
Loads all data

Specified by:
loadAll in interface RankDao
Parameters:
customFieldId - the ID of the rank custom field

insert

public void insert(java.lang.Long customFieldId,
                   java.lang.Long issueId,
                   java.lang.Long newNext,
                   java.lang.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(java.lang.Long customFieldId,
                 java.lang.Long issueId,
                 java.lang.Long oldNext,
                 java.lang.Long oldPrevious,
                 java.lang.Long newNext,
                 java.lang.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(java.lang.Long customFieldId,
                   java.lang.Long issueId,
                   java.lang.Long oldNext,
                   java.lang.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.

hasOutstandingTransactions

public boolean hasOutstandingTransactions()
Description copied from interface: RankDao
Returns whether outstanding transactions are available

Specified by:
hasOutstandingTransactions in interface RankDao

executeOutstandingTransaction

public void executeOutstandingTransaction()
Executes any outstanding transactions. Does nothing if no outstanding transactions are found.

Specified by:
executeOutstandingTransaction in interface RankDao


Copyright © 2007-2012 Atlassian. All Rights Reserved.