Interface LexoRankManager

All Known Implementing Classes:
LexoRankManagerImpl

public interface LexoRankManager
Manager for performing rank operations.
  • Method Details

    • initField

      ServiceResult initField(long fieldId)
      Initializes given field for lexo rank.
      Parameters:
      fieldId - of the lexo rank custom field.
      Returns:
      void.
    • dropField

      ServiceOutcome<Set<Long>> dropField(long fieldId)
      Drops given field within certain timeout.
      Parameters:
      fieldId - of the lexo rank custom field
      Returns:
      empty ServiceOutcome if no errors occurred and operation finished within timeout.
    • dropAllObsoleteFields

      ServiceOutcome<Set<Long>> dropAllObsoleteFields()
      Drops all fields that no longer have corresponding custom fields.
      Returns:
      A set of fieldIds whose entries were removed if successful.
    • getRankOrRankInitially

      LexoRankOperationOutcome<LexoRankChange> getRankOrRankInitially(long fieldId, long issueId)
      Returns the rank of an issue for a custom field. If no rank currently exists for the issue, an initial rank value will be assigned to the issue. This operation will reIndex the issue and its sub-tasks.
      Parameters:
      fieldId - of the lexo rank custom field
      issueId - of the issue
      Returns:
      result representing rank change
    • getRankOrRankInitially

      LexoRankOperationOutcome<LexoRankChange> getRankOrRankInitially(long fieldId, long issueId, boolean reIndex)
      Returns the rank of an issue for a custom field. If no rank currently exists for the issue, an initial rank value will be assigned to the issue.
      Parameters:
      fieldId - of the lexo rank custom field
      issueId - of the issue
      reIndex - whether to reIndex issue after operation
      Returns:
      result representing rank change
    • deleteRanksForDeletedIssue

      ServiceResult deleteRanksForDeletedIssue(long issueId)
      Deltes all ranks for given issue.
      Parameters:
      issueId - of the issue.
      Returns:
      empty ServiceOutcome if no errors occurred.
    • deleteRanksForIssues

      ServiceResult deleteRanksForIssues(Iterable<Long> issueIds)
      Deletes all ranks for the given issues
      Parameters:
      issueIds - of the issues
      Returns:
      empty ServiceOutcome if no errors occurred.
    • deleteRanksForIssueIdsBetween

      ServiceResult deleteRanksForIssueIdsBetween(long startIdInclusive, long endIdInclusive)
      Deletes all ranks for the issues between startIdInclusive and endIdInclusive. startIdInclusive must be less than or equal to endIdInclusive
      Parameters:
      startIdInclusive - of the rank to delete from
      endIdInclusive - of the rank to delete to
      Returns:
      empty ServiceOutcome if no errors occurred.
    • rankBefore

      LexoRankOperationOutcome<LexoRankChange> rankBefore(long fieldId, long issueId, long otherIssueId)
      Ranks given issue before other given issue. This method won't trigger any reindex operations.
      Parameters:
      fieldId - of the lexo rank custom field.
      issueId - of the issue to be ranked.
      otherIssueId - before which the issue will be ranked.
      Returns:
      result representing rank change
    • rankBefore

      LexoRankOperationOutcome<LexoRankChange> rankBefore(long fieldId, long issueId, long otherIssueId, int remainingRankOperations)
      Ranks given issue before other given issue with indication how many rank operations will follow. The subsequent rank operations should be rankAfter(long, long, long, int). This method won't trigger any reindex operations.
      Parameters:
      fieldId - of the lexo rank custom field
      issueId - of the issue to be ranked
      otherIssueId - before which the issue will be ranked
      remainingRankOperations - to follow
      Returns:
      result representing rank change
    • rankAfter

      LexoRankOperationOutcome<LexoRankChange> rankAfter(long fieldId, long issueId, long otherIssueId)
      Ranks given issue after other given issue. This method won't trigger any reindex operations.
      Parameters:
      fieldId - of the lexo rank custom field
      issueId - of the issue to be ranked.
      otherIssueId - after which issue will be ranked.
      Returns:
      result representing rank change
    • rankAfter

      LexoRankOperationOutcome<LexoRankChange> rankAfter(long fieldId, long issueId, long otherIssueId, int remainingRankOperations)
      Ranks given issue after other given issue with indication how many rank operations will follow. This method won't trigger any reindex operations.
      Parameters:
      fieldId - of the lexo rank custom field
      issueId - of the issue to be ranked
      otherIssueId - after which issue will be ranked
      remainingRankOperations - to follow
      Returns:
      result representing rank change
    • rankFirst

      LexoRankOperationOutcome<LexoRankChange> rankFirst(long fieldId, long issueId)
      Ranks given issue as first. This method won't trigger any reindex operations.
      Parameters:
      fieldId - of the lexo rank custom field
      issueId - of the issue to be ranked.
      Returns:
      result representing rank change
    • rankLast

      LexoRankOperationOutcome<LexoRankChange> rankLast(long fieldId, long issueId)
      Ranks given issue as last. This method won't trigger any reindex operations.
      Parameters:
      fieldId - of the lexo rank custom field
      issueId - of the issue to be ranked.
      Returns:
      result representing rank change
    • healDuplicates

      ServiceResult healDuplicates(long fieldId)
      Performs healing operation for given field. @see LexoRankHealOperation
      Parameters:
      fieldId - for which heal operation will be performed.
      Returns:
      empty ServiceOutcome if no errors occurred.
    • getRank

      io.atlassian.fugue.Option<LexoRank> getRank(long fieldId, long issueId)
      Looks up the rank for given issue.
      Parameters:
      fieldId - of the lexo rank custom field
      issueId - of the issue to be looked up.
      Returns:
      Lexo rank for given issue and field.
    • getRankValues

      Map<Long,LexoRank> getRankValues(long fieldId, Collection<Long> issueIds)
      Looks up the ranks for given issues.
      Parameters:
      fieldId - of the lexo rank custom field
      issueIds - of the issues to be looked up.
      Returns:
      Lexo ranks for given issues in the field.