com.atlassian.greenhopper.service.rank
Interface RankIndexService

All Known Implementing Classes:
RankIndexServiceImpl

public interface RankIndexService

Allows ranking issues relative to each other. Note: If you are interested in rank operations, you probably want to use RankService instead.

Author:
ahennecke, miruflin

Method Summary
 int compare(long customFieldId, long firstId, long secondId)
          Compares two issues according to their rank.
 long getIssuePosition(long customFieldId, long issueId)
          Get the position for the given issueId.
 RankChange rankAfter(long customFieldId, long issueId, long rankAfterId)
          Rank an issue after another one.
 RankChange rankBefore(long customFieldId, long issueId, long rankBeforeId)
          Rank an issue before another one.
 RankChange rankFirst(long customFieldId, long issueId)
          Rank an issue first, thus add it as first global issue.
 RankChange rankLast(long customFieldId, long issueId)
          Rank an issue last, thus add it as last global issue
 java.util.List<RankChange> rankLastForAllFields(long issueId)
           
 RankChange removeIssue(long customFieldId, long issueId)
          Remove the issue with the given ID from the rank index.
 java.util.List<RankChange> removeIssueForAllFields(long issueId)
           
 

Method Detail

compare

int compare(long customFieldId,
            long firstId,
            long secondId)
Compares two issues according to their rank.


rankBefore

RankChange rankBefore(long customFieldId,
                      long issueId,
                      long rankBeforeId)
Rank an issue before another one.

Parameters:
issueId - : The ID of the issue to be ranked
rankBeforeId - : The ID of the issue to be ranked before. If this doesn't exist in the index, it will be added at the last position.
Returns:
the old index of the ranked issue. null if the issue was inserted as part of the rank operation

rankAfter

RankChange rankAfter(long customFieldId,
                     long issueId,
                     long rankAfterId)
Rank an issue after another one.

Parameters:
issueId - : The ID of the issue to be ranked
rankAfterId - : The ID of the issue to be ranked after. If this doesn't exist in the index, it will be added at the last position.
Returns:
the old index of the ranked issue. null if the issue was inserted as part of the rank operation

rankFirst

RankChange rankFirst(long customFieldId,
                     long issueId)
Rank an issue first, thus add it as first global issue.

Returns:
the old index of the ranked issue. null if the issue was inserted as part of the rank operation

rankLast

RankChange rankLast(long customFieldId,
                    long issueId)
Rank an issue last, thus add it as last global issue

Returns:
the old index of the ranked issue. null if the issue was inserted as part of the rank operation

rankLastForAllFields

java.util.List<RankChange> rankLastForAllFields(long issueId)

removeIssue

RankChange removeIssue(long customFieldId,
                       long issueId)
Remove the issue with the given ID from the rank index.


removeIssueForAllFields

java.util.List<RankChange> removeIssueForAllFields(long issueId)

getIssuePosition

long getIssuePosition(long customFieldId,
                      long issueId)
Get the position for the given issueId. This is the absolute position in the global index, so it does not have any significance for a particular RapidView except from one showing all issues in all projects. All that is guaranteed is that rank(a) < rank(b)



Copyright © 2007-2012 Atlassian. All Rights Reserved.