Class RankServiceImpl
java.lang.Object
com.atlassian.greenhopper.service.rank.RankServiceImpl
- All Implemented Interfaces:
RankService
@Service("greenhopper-rank-service-internal")
public class RankServiceImpl
extends Object
implements RankService
RankService implementation.
-
Field Summary
FieldsFields inherited from interface com.atlassian.greenhopper.service.rank.RankService
CAN_RANK_PERMISSION, CUSTOM_FIELD_ID_ERROR_CONTEXT
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns true if the user has the ability to perform a rank operation for a given issuecreateFlatComparator
(com.atlassian.jira.user.ApplicationUser user, long customFieldId) Create a 'flat' comparator for Rankables.getRankablePosition
(long customFieldId, Rankable rankable) Get the position for the given rankable.rankAfter
(com.atlassian.jira.user.ApplicationUser user, long customFieldId, Rankable rankable, Rankable rankAfter) Rank an rankable after another one.rankAfter
(com.atlassian.jira.user.ApplicationUser user, long customFieldId, List<Rankable> rankables, Rankable rankAfter) Rank several rankables after another one.rankBefore
(com.atlassian.jira.user.ApplicationUser user, long customFieldId, Rankable rankable, Rankable rankBefore) Rank a rankable object before another one.rankBefore
(com.atlassian.jira.user.ApplicationUser user, long customFieldId, List<Rankable> rankables, Rankable rankBefore) Rank several rankables before another one.Rank a rankable first, thus add it as first global rankable.rankFirst
(com.atlassian.jira.user.ApplicationUser user, long customFieldId, List<Rankable> rankables) Rank a rankable first, thus add it as first global rankable.Rank a rankable last, thus add it as last global rankablerankLast
(com.atlassian.jira.user.ApplicationUser user, long customFieldId, List<Rankable> rankables) Rank a rankable last, thus add it as last global rankable
-
Field Details
-
log
-
-
Constructor Details
-
RankServiceImpl
public RankServiceImpl()
-
-
Method Details
-
rankBefore
@Nonnull public ServiceOutcome<RankChange> rankBefore(com.atlassian.jira.user.ApplicationUser user, long customFieldId, Rankable rankable, Rankable rankBefore) Description copied from interface:RankService
Rank a rankable object before another one.- Specified by:
rankBefore
in interfaceRankService
- Parameters:
user
- : The user performing the rank operationrankable
- : The rankable to rankrankBefore
- : The rankable to be ranked before. If this doesn't exist in the index, it will be added at the last position.
-
rankBefore
@Nonnull public ServiceOutcome<RankChangesOutcome> rankBefore(com.atlassian.jira.user.ApplicationUser user, long customFieldId, List<Rankable> rankables, Rankable rankBefore) Description copied from interface:RankService
Rank several rankables before another one.- Specified by:
rankBefore
in interfaceRankService
- Parameters:
user
- : The user performing the rank operationrankables
- : The rankables to rank (in order)rankBefore
- : The rankable to be ranked before. If this doesn't exist in the index, it will be added at the last position.
-
rankAfter
@Nonnull public ServiceOutcome<RankChange> rankAfter(com.atlassian.jira.user.ApplicationUser user, long customFieldId, Rankable rankable, Rankable rankAfter) Description copied from interface:RankService
Rank an rankable after another one.- Specified by:
rankAfter
in interfaceRankService
- Parameters:
user
- : The user performing the rank operationrankable
- : The rankable to rankrankAfter
- : The rankable to be ranked after. If this doesn't exist in the index, it will be added at the last position.
-
rankAfter
@Nonnull public ServiceOutcome<RankChangesOutcome> rankAfter(com.atlassian.jira.user.ApplicationUser user, long customFieldId, List<Rankable> rankables, Rankable rankAfter) Description copied from interface:RankService
Rank several rankables after another one.- Specified by:
rankAfter
in interfaceRankService
- Parameters:
user
- : The user performing the rank operationrankables
- : The rankables to rank (in order)rankAfter
- : The rankable to be ranked after. If this doesn't exist in the index, it will be added at the last position.
-
rankFirst
@Nonnull public ServiceOutcome<RankChange> rankFirst(com.atlassian.jira.user.ApplicationUser user, long customFieldId, Rankable rankable) Description copied from interface:RankService
Rank a rankable first, thus add it as first global rankable.- Specified by:
rankFirst
in interfaceRankService
- Parameters:
user
- : The user performing the rank operationrankable
- : The rankable to rank
-
rankFirst
public ServiceOutcome<RankChangesOutcome> rankFirst(com.atlassian.jira.user.ApplicationUser user, long customFieldId, List<Rankable> rankables) Description copied from interface:RankService
Rank a rankable first, thus add it as first global rankable.- Specified by:
rankFirst
in interfaceRankService
- Parameters:
user
- : The user performing the rank operationrankables
- : The rankable to rank
-
rankLast
@Nonnull public ServiceOutcome<RankChange> rankLast(com.atlassian.jira.user.ApplicationUser user, long customFieldId, Rankable rankable) Description copied from interface:RankService
Rank a rankable last, thus add it as last global rankable- Specified by:
rankLast
in interfaceRankService
- Parameters:
user
- : The user performing the rank operationrankable
- : The rankable to rank
-
rankLast
public ServiceOutcome<RankChangesOutcome> rankLast(com.atlassian.jira.user.ApplicationUser user, long customFieldId, List<Rankable> rankables) Description copied from interface:RankService
Rank a rankable last, thus add it as last global rankable- Specified by:
rankLast
in interfaceRankService
- Parameters:
user
- : The user performing the rank operationrankables
- : The rankable to rank
-
getRankablePosition
Description copied from interface:RankService
Get the position for the given rankable. 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 rankables in all projects. All that is guaranteed is that rank(a) < rank(b)- Specified by:
getRankablePosition
in interfaceRankService
- Parameters:
rankable
- : The rankable to rank
-
createFlatComparator
public ServiceOutcome<Comparator<Rankable>> createFlatComparator(com.atlassian.jira.user.ApplicationUser user, long customFieldId) Description copied from interface:RankService
Create a 'flat' comparator for Rankables. In a flat comparator, subtasks are ranked according to their absolute rank, not to the rank relative to their parent's rank.- Specified by:
createFlatComparator
in interfaceRankService
-
canRank
Description copied from interface:RankService
Returns true if the user has the ability to perform a rank operation for a given issue- Specified by:
canRank
in interfaceRankService
- Parameters:
user
- : the user in playrankable
- : the rankable in play- Returns:
- true if the user can rank this rankable
-