Class RankServiceImpl

java.lang.Object
com.atlassian.greenhopper.api.rank.RankServiceImpl
All Implemented Interfaces:
RankService

@ParametersAreNonnullByDefault public class RankServiceImpl extends Object implements RankService
Implementation of RankService. Essentially a wrapper for the internal RankService which returns results of the expected type for the API.
Since:
v5.8.1
Author:
mtokar
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    compareIssuePosition(long customFieldId, com.atlassian.jira.issue.Issue first, com.atlassian.jira.issue.Issue second)
    Compares two issues against each other.
    com.atlassian.jira.bc.ServiceOutcome<com.atlassian.jira.issue.fields.CustomField>
    Get the default rank field used by JIRA Agile.
    Collection<com.atlassian.jira.issue.fields.CustomField>
    All rank fields which are properly-configured Global Rank custom fields.
    boolean
    isRankField(long customFieldId)
    Is the passed custom field ID the ID of a properly-configured Global Rank custom field?
    com.atlassian.jira.bc.ServiceOutcome<RankChange>
    rankAfter(com.atlassian.crowd.embedded.api.User user, long customFieldId, com.atlassian.jira.issue.Issue issue, com.atlassian.jira.issue.Issue rankAfterIssue)
    Deprecated.
    since v7.0.
    com.atlassian.jira.bc.ServiceOutcome<RankChange>
    rankAfter(com.atlassian.jira.user.ApplicationUser user, long customFieldId, com.atlassian.jira.issue.Issue issue, com.atlassian.jira.issue.Issue rankAfterIssue)
    Rank an issue after another one.
    com.atlassian.jira.bc.ServiceOutcome<RankChangesOutcome>
    rankAfter(com.atlassian.jira.user.ApplicationUser user, long customFieldId, List<com.atlassian.jira.issue.Issue> issues, com.atlassian.jira.issue.Issue rankAfterIssue)
    Rank several issues before another one.
    com.atlassian.jira.bc.ServiceOutcome<RankChange>
    rankBefore(com.atlassian.crowd.embedded.api.User user, long customFieldId, com.atlassian.jira.issue.Issue issue, com.atlassian.jira.issue.Issue rankBeforeIssue)
    Deprecated.
    since v7.0.
    com.atlassian.jira.bc.ServiceOutcome<RankChange>
    rankBefore(com.atlassian.jira.user.ApplicationUser user, long customFieldId, com.atlassian.jira.issue.Issue issue, com.atlassian.jira.issue.Issue rankBeforeIssue)
    Rank an issue before another one.
    com.atlassian.jira.bc.ServiceOutcome<RankChangesOutcome>
    rankBefore(com.atlassian.jira.user.ApplicationUser user, long customFieldId, List<com.atlassian.jira.issue.Issue> issues, com.atlassian.jira.issue.Issue rankBeforeIssue)
    Rank several issues before another one.
    com.atlassian.jira.bc.ServiceOutcome<RankChange>
    rankFirst(com.atlassian.crowd.embedded.api.User user, long customFieldId, com.atlassian.jira.issue.Issue issue)
    Deprecated.
    since v7.0.
    com.atlassian.jira.bc.ServiceOutcome<RankChange>
    rankFirst(com.atlassian.jira.user.ApplicationUser user, long customFieldId, com.atlassian.jira.issue.Issue issue)
    Rank an issue first, thus add it as first global issue.
    com.atlassian.jira.bc.ServiceOutcome<RankChange>
    rankLast(com.atlassian.crowd.embedded.api.User user, long customFieldId, com.atlassian.jira.issue.Issue issue)
    Deprecated.
    since v7.0.
    com.atlassian.jira.bc.ServiceOutcome<RankChange>
    rankLast(com.atlassian.jira.user.ApplicationUser user, long customFieldId, com.atlassian.jira.issue.Issue issue)
    Rank an issue last, thus add it as last global issue.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • RankServiceImpl

      public RankServiceImpl()
  • Method Details

    • rankBefore

      @Nonnull @Deprecated public com.atlassian.jira.bc.ServiceOutcome<RankChange> rankBefore(@Nullable com.atlassian.crowd.embedded.api.User user, long customFieldId, com.atlassian.jira.issue.Issue issue, com.atlassian.jira.issue.Issue rankBeforeIssue)
      Deprecated.
      since v7.0.
      Description copied from interface: RankService
      Rank an issue before another one.
      Specified by:
      rankBefore in interface RankService
      Parameters:
      user - the user who is performing operation and whose permissions are checked. Null means anonymous access.
      customFieldId - the ID of the global rank custom field.
      issue - The issue to rank.
      rankBeforeIssue - The issue to be ranked before.
      Returns:
      the result of the operation.
    • rankAfter

      @Nonnull @Deprecated public com.atlassian.jira.bc.ServiceOutcome<RankChange> rankAfter(@Nullable com.atlassian.crowd.embedded.api.User user, long customFieldId, com.atlassian.jira.issue.Issue issue, com.atlassian.jira.issue.Issue rankAfterIssue)
      Deprecated.
      since v7.0.
      Description copied from interface: RankService
      Rank an issue after another one.
      Specified by:
      rankAfter in interface RankService
      Parameters:
      user - the user who is performing operation and whose permissions are checked. Null means anonymous access.
      customFieldId - the ID of the global rank custom field.
      issue - The issue to rank.
      rankAfterIssue - The issue to be ranked after.
      Returns:
      the result of the operation.
    • rankFirst

      @Nonnull @Deprecated public com.atlassian.jira.bc.ServiceOutcome<RankChange> rankFirst(@Nullable com.atlassian.crowd.embedded.api.User user, long customFieldId, com.atlassian.jira.issue.Issue issue)
      Deprecated.
      since v7.0.
      Description copied from interface: RankService
      Rank an issue first, thus add it as first global issue.
      Specified by:
      rankFirst in interface RankService
      Parameters:
      user - the user who is performing operation and whose permissions are checked. Null means anonymous access.
      customFieldId - the ID of the global rank custom field.
      issue - The issue to rank.
      Returns:
      the result of the operation.
    • rankLast

      @Nonnull @Deprecated public com.atlassian.jira.bc.ServiceOutcome<RankChange> rankLast(@Nullable com.atlassian.crowd.embedded.api.User user, long customFieldId, com.atlassian.jira.issue.Issue issue)
      Deprecated.
      since v7.0.
      Description copied from interface: RankService
      Rank an issue last, thus add it as last global issue.
      Specified by:
      rankLast in interface RankService
      Parameters:
      user - the user who is performing operation and whose permissions are checked. Null means anonymous access.
      customFieldId - the ID of the global rank custom field.
      issue - The issue to rank.
      Returns:
      the result of the operation.
    • rankBefore

      @Nonnull public com.atlassian.jira.bc.ServiceOutcome<RankChange> rankBefore(@Nullable com.atlassian.jira.user.ApplicationUser user, long customFieldId, com.atlassian.jira.issue.Issue issue, com.atlassian.jira.issue.Issue rankBeforeIssue)
      Description copied from interface: RankService
      Rank an issue before another one.
      Specified by:
      rankBefore in interface RankService
      Parameters:
      user - the user who is performing operation and whose permissions are checked. Null means anonymous access.
      customFieldId - the ID of the global rank custom field.
      issue - The issue to rank.
      rankBeforeIssue - The issue to be ranked before.
      Returns:
      the result of the operation.
    • rankBefore

      @Nonnull public com.atlassian.jira.bc.ServiceOutcome<RankChangesOutcome> rankBefore(@Nullable com.atlassian.jira.user.ApplicationUser user, long customFieldId, @Nonnull List<com.atlassian.jira.issue.Issue> issues, @Nonnull com.atlassian.jira.issue.Issue rankBeforeIssue)
      Description copied from interface: RankService
      Rank several issues before another one.
      Specified by:
      rankBefore in interface RankService
      Parameters:
      user - the user who is performing operation and whose permissions are checked. Null means anonymous access.
      customFieldId - the ID of the global rank custom field.
      issues - the issues to rank (in order).
      rankBeforeIssue - the issue to be ranked before. If this doesn't exist in the index, it will be added at the last position.
      Returns:
      the result of the operation.
    • rankAfter

      @Nonnull public com.atlassian.jira.bc.ServiceOutcome<RankChange> rankAfter(@Nullable com.atlassian.jira.user.ApplicationUser user, long customFieldId, com.atlassian.jira.issue.Issue issue, com.atlassian.jira.issue.Issue rankAfterIssue)
      Description copied from interface: RankService
      Rank an issue after another one.
      Specified by:
      rankAfter in interface RankService
      Parameters:
      user - the user who is performing operation and whose permissions are checked. Null means anonymous access.
      customFieldId - the ID of the global rank custom field.
      issue - the issue to rank.
      rankAfterIssue - the issue to be ranked after.
      Returns:
      the result of the operation.
    • rankAfter

      @Nonnull public com.atlassian.jira.bc.ServiceOutcome<RankChangesOutcome> rankAfter(@Nullable com.atlassian.jira.user.ApplicationUser user, long customFieldId, @Nonnull List<com.atlassian.jira.issue.Issue> issues, @Nonnull com.atlassian.jira.issue.Issue rankAfterIssue)
      Description copied from interface: RankService
      Rank several issues before another one.
      Specified by:
      rankAfter in interface RankService
      Parameters:
      user - the user performing the rank operation.
      customFieldId - the ID of the global rank custom field.
      issues - the issues to rank (in order).
      rankAfterIssue - the issue to be ranked before. If this doesn't exist in the index, it will be added at the last position.
      Returns:
      the result of the operation.
    • rankFirst

      @Nonnull public com.atlassian.jira.bc.ServiceOutcome<RankChange> rankFirst(@Nullable com.atlassian.jira.user.ApplicationUser user, long customFieldId, com.atlassian.jira.issue.Issue issue)
      Description copied from interface: RankService
      Rank an issue first, thus add it as first global issue.
      Specified by:
      rankFirst in interface RankService
      Parameters:
      user - the user who is performing operation and whose permissions are checked. Null means anonymous access.
      customFieldId - the ID of the custom field.
      issue - The issue to rank.
      Returns:
      the result of the operation.
    • rankLast

      @Nonnull public com.atlassian.jira.bc.ServiceOutcome<RankChange> rankLast(@Nullable com.atlassian.jira.user.ApplicationUser user, long customFieldId, com.atlassian.jira.issue.Issue issue)
      Description copied from interface: RankService
      Rank an issue last, thus add it as last global issue.
      Specified by:
      rankLast in interface RankService
      Parameters:
      user - the user who is performing operation and whose permissions are checked. Null means anonymous access.
      customFieldId - the ID of the custom field.
      issue - The issue to rank.
      Returns:
      the result of the operation.
    • compareIssuePosition

      @Nonnull public int compareIssuePosition(long customFieldId, com.atlassian.jira.issue.Issue first, com.atlassian.jira.issue.Issue second)
      Description copied from interface: RankService
      Compares two issues against each other. Sub-tasks are ranked/compared according to their parent.

      Note: if a custom field ID is specified which is not valid for ranking, 0 is returned.

      Specified by:
      compareIssuePosition in interface RankService
      Parameters:
      customFieldId - the ID of the rank custom field.
      first - the first issue.
      second - the second issue.
      Returns:
      the comparison result - -1, 0 or 1.
      See Also:
    • isRankField

      public boolean isRankField(long customFieldId)
      Description copied from interface: RankService
      Is the passed custom field ID the ID of a properly-configured Global Rank custom field?
      Specified by:
      isRankField in interface RankService
      Parameters:
      customFieldId - the ID of the custom field.
      Returns:
      the result.
    • getRankFields

      @Nonnull public Collection<com.atlassian.jira.issue.fields.CustomField> getRankFields()
      Description copied from interface: RankService
      All rank fields which are properly-configured Global Rank custom fields.
      Specified by:
      getRankFields in interface RankService
      Returns:
      the result.
    • getDefaultRankField

      @Nonnull public com.atlassian.jira.bc.ServiceOutcome<com.atlassian.jira.issue.fields.CustomField> getDefaultRankField()
      Description copied from interface: RankService
      Get the default rank field used by JIRA Agile.

      Note that in most cases JIRA Agile uses the Rank field defined in the ORDER BY clause of the board base query.

      Specified by:
      getDefaultRankField in interface RankService