|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface LexoRankDao
DAO for LexoRank AOs.
Method Summary | |
---|---|
LockOutcome |
acquireLock(LexoRankRow[] rowsToLock,
LexoRankDaoContext ctx)
Attempts the acquire a database lock on the given LexoRankRows that represent rows in the LexoRank table. |
LockOutcome |
acquireLock(LexoRankRow rowToLock,
LexoRankDaoContext ctx)
Attempts the acquire a database lock on the given LexoRankRow that represents a row in the LexoRank table. |
LockOutcome |
acquireLock(java.lang.Long rowIdToLock,
LexoRankDaoContext ctx)
Attempts the acquire a database lock on the ID that represents a row in the LexoRank table. |
LockOutcome |
acquireLock(java.util.Set<LexoRankRow> rowsToLock,
LexoRankDaoContext ctx)
Attempts the acquire a database lock on the given LexoRankRows that represent rows in the LexoRank table. |
LockOutcome |
acquireLockByFieldId(java.lang.Long fieldId,
LexoRankDaoContext ctx)
Attempts the acquire a database lock on all rows in the LexoRank table whom's fieldId matches the given fieldId. |
java.util.Map<java.lang.String,java.lang.Long> |
countDuplicateRowsForFieldId(java.lang.Long fieldId,
LexoRankDaoContext ctx)
Returns a map of duplicate rank values and the amount of occurences of that rank value. |
LexoRankRow |
create(long fieldId,
long issueId,
java.lang.String rank)
Create a row in the db for the given rank, issueId and fieldId |
int |
createBulk(long fieldId,
java.util.Map<java.lang.Long,java.lang.String> issuesIdToRankMap)
Creates a batch of LexoRank rows in one statement |
void |
createMarkerRowsForRankField(long fieldId)
Creates the 'marker' rows for the given fieldId in the db. |
ServiceOutcome<java.lang.Void> |
deleteAll(LexoRankDaoContext ctx)
Deletes all rows. |
LockProcessOutcome<ServiceOutcome<java.lang.Void>> |
deleteByFieldId(Lock lock,
java.lang.Long fieldId,
LexoRankDaoContext ctx)
Deletes rows for the given fieldId |
LockProcessOutcome<ServiceOutcome<java.lang.Void>> |
deleteByFieldIdAndIssueId(Lock lock,
java.lang.Long fieldId,
java.lang.Long issueId,
LexoRankDaoContext ctx)
Deletes a single rank row for the given fieldId and issueId |
LockProcessOutcome<ServiceOutcome<java.lang.Void>> |
deleteByIssueId(Lock lock,
java.lang.Long issueId,
LexoRankDaoContext ctx)
Deletes rows for the given issueId |
boolean |
existsRankForFieldId(java.lang.Long rankFieldId,
java.lang.String rank,
LexoRankDaoContext ctx)
Checks if the given rank value already exists for the given rank field id. |
com.atlassian.fugue.Option<LexoRankRow> |
findByFieldAndIssueId(long fieldId,
long issueId,
LexoRankDaoContext ctx)
Finds a single rank row for the given fieldId and issueId |
LexoRankRow[] |
findByFieldId(long fieldId,
LexoRankDaoContext ctx)
WARNING: Do not use unless you know what you are doing because it returns all issues (which can be 100k+) Returns all ranking rows by field id |
LexoRankRow[] |
findByIssueId(long issueId,
LexoRankDaoContext ctx)
Returns all rank rows for a given issueId. |
java.util.Collection<java.lang.Long> |
findFieldsNeedingBalancing()
Retrieves a Collection of rank row IDs that require balancing. |
java.util.Set<java.lang.Long> |
findIssueIdsByFieldId(long fieldId)
Retrieves a Set of issueIds of rank rows for the given fieldId |
com.atlassian.fugue.Option<LexoRankRow> |
findMaximumMarkerRow(long fieldId,
LexoRankDaoContext ctx)
Finds the maximum marker row for the given fieldId |
com.atlassian.fugue.Option<LexoRankRow> |
findMinimumMarkerRow(long fieldId,
LexoRankDaoContext ctx)
Finds the minimum marker row for the given fieldId |
LexoRankRow |
findNextOneByRank(long fieldId,
java.lang.String rank,
LexoRankDaoContext ctx)
Find the next rank row (skipping over any duplicates) |
LexoRankRow |
getByFieldAndIssueId(long fieldId,
long issueId,
LexoRankDaoContext ctx)
Gets a single LexoRankRow object with the given fieldId and issueId |
LexoRankDaoContext |
getContext()
Returns a LexoRankDaoContext object that should be passed to any methods on the LexoRankDao that require it. |
LexoRankRow |
getMaximumMarkerRow(long fieldId,
LexoRankDaoContext ctx)
|
LexoRankRow[] |
getMaximumMarkerRowAndPreviousRow(long fieldId,
LexoRankDaoContext ctx)
Returns the maximum rank marker row and the previous row ranked before the maximum marker row for the given fieldId |
LexoRankRow |
getMinimumMarkerRow(long fieldId,
LexoRankDaoContext ctx)
|
LexoRankRow[] |
getMinimumMarkerRowAndNextRow(long fieldId,
LexoRankDaoContext ctx)
Returns the minimum rank marker row and the next row ranked behind the minimum marker row for the given fieldId |
LexoRankRow[] |
getRowByRankAndNextRow(long fieldId,
java.lang.String rank,
LexoRankDaoContext ctx)
Returns the rank row with the given rank and the row ranked after that row. |
LexoRankRow[] |
getRowByRankAndPreviousRow(long fieldId,
java.lang.String rank,
LexoRankDaoContext ctx)
Returns the rank row with the given rank and the row ranked before that row. |
LexoRankRow[] |
getRowsAtBalanceBoundaryForFieldId(java.lang.Long fieldId,
LexoRankBucket bucketBeingMigratedFrom,
LexoRankBucket bucketBeingMigratedTo,
LexoRankDaoContext ctx)
Finds the 2 rows at the balance boundary for the given field id and bucket. |
java.util.List<LexoRankRow> |
listByFieldIdAndRank(java.lang.Long fieldId,
java.lang.String rank,
LexoRankDaoContext ctx)
Lists all the LexoRankRows for the given rank field id that have the given rank. |
java.util.List<java.lang.Long> |
listIssueIdsByFieldIdAndIssueIds(long fieldId,
java.util.List<java.lang.Long> issueIds)
Returns a list of issue IDs for which a LexoRank row with fieldId and one of the given issueIds exists. |
java.util.Map<java.lang.Long,java.lang.Long> |
ranksCountByField()
Gets the number of distinct ranks for a field in the db |
void |
releaseLock(Lock lock,
LexoRankDaoContext ctx)
Releases the lock on all rows locked by the given lock. |
LockProcessOutcome<ServiceOutcome<LexoRankRow>> |
save(Lock lock,
LexoRankRow lexoRankRow,
LexoRankDaoContext lexoRankDaoContext)
Update a LexoRankRow. |
ServiceOutcome<LexoRankRow> |
unlockedSave(LexoRankRow lexoRankRow,
LexoRankDaoContext lexoRankDaoContext)
Update a LexoRankRow, without the need for it to be locked. |
Method Detail |
---|
void createMarkerRowsForRankField(long fieldId)
fieldId
- LexoRankRow create(long fieldId, long issueId, java.lang.String rank)
fieldId
- issueId
- rank
-
int createBulk(long fieldId, java.util.Map<java.lang.Long,java.lang.String> issuesIdToRankMap)
LexoRankRow[] findByFieldId(long fieldId, LexoRankDaoContext ctx)
fieldId
- the field id
LexoRankRow[] findByIssueId(long issueId, LexoRankDaoContext ctx)
issueId
- ctx
-
com.atlassian.fugue.Option<LexoRankRow> findByFieldAndIssueId(long fieldId, long issueId, LexoRankDaoContext ctx)
fieldId
- issueId
- ctx
-
java.util.List<java.lang.Long> listIssueIdsByFieldIdAndIssueIds(long fieldId, java.util.List<java.lang.Long> issueIds)
fieldId
- issueIds
-
LexoRankRow getByFieldAndIssueId(long fieldId, long issueId, LexoRankDaoContext ctx)
fieldId
- issueId
- ctx
-
LexoRankRow[] getMinimumMarkerRowAndNextRow(long fieldId, LexoRankDaoContext ctx)
fieldId
- ctx
-
LexoRankRow[] getMaximumMarkerRowAndPreviousRow(long fieldId, LexoRankDaoContext ctx)
fieldId
- ctx
-
LexoRankRow[] getRowByRankAndNextRow(long fieldId, java.lang.String rank, LexoRankDaoContext ctx)
fieldId
- rank
- ctx
-
LexoRankRow[] getRowByRankAndPreviousRow(long fieldId, java.lang.String rank, LexoRankDaoContext ctx)
fieldId
- rank
- ctx
-
LexoRankRow findNextOneByRank(long fieldId, java.lang.String rank, LexoRankDaoContext ctx)
fieldId
- is the rank fieldrank
- is the rank value
com.atlassian.fugue.Option<LexoRankRow> findMinimumMarkerRow(long fieldId, LexoRankDaoContext ctx)
fieldId
- ctx
-
LexoRankRow getMinimumMarkerRow(long fieldId, LexoRankDaoContext ctx)
com.atlassian.fugue.Option<LexoRankRow> findMaximumMarkerRow(long fieldId, LexoRankDaoContext ctx)
fieldId
- ctx
-
LexoRankRow getMaximumMarkerRow(long fieldId, LexoRankDaoContext ctx)
java.util.Set<java.lang.Long> findIssueIdsByFieldId(long fieldId)
fieldId
-
java.util.Collection<java.lang.Long> findFieldsNeedingBalancing()
java.util.Map<java.lang.Long,java.lang.Long> ranksCountByField()
LexoRankDaoContext getContext()
LockOutcome acquireLock(java.lang.Long rowIdToLock, LexoRankDaoContext ctx)
rowIdToLock
-
LockOutcome acquireLock(LexoRankRow rowToLock, LexoRankDaoContext ctx)
rowToLock
-
LockOutcome acquireLock(java.util.Set<LexoRankRow> rowsToLock, LexoRankDaoContext ctx)
rowsToLock
-
LockOutcome acquireLock(LexoRankRow[] rowsToLock, LexoRankDaoContext ctx)
rowsToLock
-
LockOutcome acquireLockByFieldId(java.lang.Long fieldId, LexoRankDaoContext ctx)
fieldId
-
void releaseLock(Lock lock, LexoRankDaoContext ctx)
lock
- ctx
- LockProcessOutcome<ServiceOutcome<LexoRankRow>> save(Lock lock, LexoRankRow lexoRankRow, LexoRankDaoContext lexoRankDaoContext)
lock
- is the lock objects.lexoRankRow
- the LexoRankRow to persist.
ServiceOutcome<LexoRankRow> unlockedSave(LexoRankRow lexoRankRow, LexoRankDaoContext lexoRankDaoContext)
lexoRankRow
- the LexoRankRow to save
LockProcessOutcome<ServiceOutcome<java.lang.Void>> deleteByIssueId(Lock lock, java.lang.Long issueId, LexoRankDaoContext ctx)
lock
- issueId
- ctx
-
ServiceOutcome<java.lang.Void> deleteAll(LexoRankDaoContext ctx)
ctx
-
LockProcessOutcome<ServiceOutcome<java.lang.Void>> deleteByFieldId(Lock lock, java.lang.Long fieldId, LexoRankDaoContext ctx)
lock
- fieldId
- ctx
-
LockProcessOutcome<ServiceOutcome<java.lang.Void>> deleteByFieldIdAndIssueId(Lock lock, java.lang.Long fieldId, java.lang.Long issueId, LexoRankDaoContext ctx)
lock
- fieldId
- issueId
- ctx
-
LexoRankRow[] getRowsAtBalanceBoundaryForFieldId(java.lang.Long fieldId, LexoRankBucket bucketBeingMigratedFrom, LexoRankBucket bucketBeingMigratedTo, LexoRankDaoContext ctx)
fieldId
- bucketBeingMigratedFrom
- bucketBeingMigratedTo
- ctx
-
boolean existsRankForFieldId(java.lang.Long rankFieldId, java.lang.String rank, LexoRankDaoContext ctx)
rankFieldId
- rank
- ctx
-
java.util.Map<java.lang.String,java.lang.Long> countDuplicateRowsForFieldId(java.lang.Long fieldId, LexoRankDaoContext ctx)
fieldId
- ctx
-
java.util.List<LexoRankRow> listByFieldIdAndRank(java.lang.Long fieldId, java.lang.String rank, LexoRankDaoContext ctx)
fieldId
- rank
- ctx
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |