Package jetbrains.buildServer.serverSide
Interface BuildPromotionManager
-
- All Superinterfaces:
BuildPromotionFactory
- All Known Subinterfaces:
BuildPromotionManagerEx
- All Known Implementing Classes:
BuildPromotionManagerImpl
public interface BuildPromotionManager extends BuildPromotionFactory
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
BuildPromotionManager.BuildPromotionInitFromDbHint
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description BuildPromotion
findPromotionById(long promotionId)
Searches for a promotion with specified id.BuildPromotion
findPromotionOrReplacement(long origPromotionId)
The method will return the original build promotion if it was not deleted by the queue optimization process.Collection<BuildPromotion>
findPromotionsByIds(Collection<Long> promoIds, BuildPromotionManager.BuildPromotionInitFromDbHint... initFromDbHints)
Accepts collection of promotion ids and returns corresponding objects.EventDispatcher<BuildPromotionListener>
getDispatcher()
Long
getLastBorrowedModificationId(SBuildType buildType, boolean ignoreCanceledAndNotStarted)
Returns max modification id associated with last created promotion in the specified build configuration.Long
getMaxUsedModificationId(SBuildType buildType, String branch)
Returns max modification id associated with last created promotion in the specified build configuration in the given branch.BuildPromotion
getPromotionById(long promotionId)
Searches for a promotion with specified id.-
Methods inherited from interface jetbrains.buildServer.serverSide.BuildPromotionFactory
createDummyPromotion, createDummyPromotion, createNewPromotion
-
-
-
-
Method Detail
-
getPromotionById
@NotNull BuildPromotion getPromotionById(long promotionId) throws InvalidBuildPromotionException
Searches for a promotion with specified id.- Parameters:
promotionId
- id of promotion- Returns:
- loaded promotion
- Throws:
InvalidBuildPromotionException
- if promotion with specified id does not exist or is invalid
-
findPromotionById
@Nullable BuildPromotion findPromotionById(long promotionId)
Searches for a promotion with specified id. Similar togetPromotionById(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 promotionsinitFromDbHints
- 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
-
getDispatcher
@NotNull EventDispatcher<BuildPromotionListener> getDispatcher()
-
-