Interface BuildPromotionManager

    • Method Detail

      • findPromotionById

        @Nullable
        BuildPromotion findPromotionById​(long promotionId)
        Searches for a promotion with specified id. Similar to getPromotionById(long) but does not throw exception if promotion with specified id does not exist.
        Parameters:
        promotionId - id of the promotion
        Returns:
        see above
      • findPromotionsByIds

        @NotNull
        Collection<BuildPromotion> findPromotionsByIds​(@NotNull
                                                       Collection<Long> promoIds,
                                                       BuildPromotionManager.BuildPromotionInitFromDbHint... initFromDbHints)
        Accepts collection of promotion ids and returns corresponding objects. Order of returned objects may not be the same as order of ids passed as argument.
        Parameters:
        promoIds - ids of promotions
        initFromDbHints - if promotion is not in cache and is loaded from the database, these hints specify what information should be prefetched from the DB
        Returns:
        found build promotions
        Since:
        2018.1
      • findPromotionOrReplacement

        @Nullable
        BuildPromotion findPromotionOrReplacement​(long origPromotionId)
        The method will return the original build promotion if it was not deleted by the queue optimization process. If this is the case, then the method will try to locate a replacement and return the replacement instead.
        Parameters:
        origPromotionId - id of original promotion
        Returns:
        replacement promotion if original promotion was replaced and marked as deleted, or original promotion if it exists.
      • getLastBorrowedModificationId

        @Nullable
        Long getLastBorrowedModificationId​(@NotNull
                                           SBuildType buildType,
                                           boolean ignoreCanceledAndNotStarted)
        Returns max modification id associated with last created promotion in the specified build configuration.
        Parameters:
        buildType - build configuration (personal build configurations are accepted too)
        ignoreCanceledAndNotStarted - if true then cancelled and not yet started promotions are excluded
        Returns:
        see above
      • getMaxUsedModificationId

        @Nullable
        Long getMaxUsedModificationId​(@NotNull
                                      SBuildType buildType,
                                      @NotNull
                                      String branch)
        Returns max modification id associated with last created promotion in the specified build configuration in the given branch.
        Parameters:
        buildType - build type of interest (personal build configurations are accepted too)
        branch - branch of interest, empty branch means default
        Returns:
        see above