Class WaitApprovalBuildPrecondition
- java.lang.Object
-
- jetbrains.buildServer.serverSide.impl.buildDistribution.WaitApprovalBuildPrecondition
-
- All Implemented Interfaces:
StartBuildPrecondition
,ServerExtension
,TeamCityExtension
,PositionAware
,PositionConstraintAware
public class WaitApprovalBuildPrecondition extends Object implements StartBuildPrecondition, PositionAware
-
-
Constructor Summary
Constructors Constructor Description WaitApprovalBuildPrecondition(NotificationProcessor notificationProcessor, EventDispatcher<BuildServerListener> dispatcher, UntrustedBuildsManager untrustedBuildsManager, ApprovableBuildManager approvableBuildManager, ProjectManager projectManager, ExecutorServices executorServices)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description WaitReason
canStart(QueuedBuildInfo queuedBuild, Map<QueuedBuildInfo,BuildAgent> canBeStarted, BuildDistributorInput buildDistributorInput, boolean emulationMode)
Returns WaitReason if build cannot be started or null if TeamCity can start build.PositionConstraint
getConstraint()
Constraint to be respected during objects sorting.String
getOrderId()
Returns object id that can be referenced by {PositionConstraint
}void
setRequiresApprovalAttribute(BuildPromotionEx buildPromotionEx, boolean canceledByTimeout)
In case of approval configuration taken from untrusted settings, we need to explicetly set that build required approval at the moment it was allowed to start(or canceled due to approval settings)
-
-
-
Field Detail
-
ORDER_ID
public static final String ORDER_ID
-
-
Constructor Detail
-
WaitApprovalBuildPrecondition
public WaitApprovalBuildPrecondition(@NotNull NotificationProcessor notificationProcessor, @NotNull EventDispatcher<BuildServerListener> dispatcher, @NotNull UntrustedBuildsManager untrustedBuildsManager, @NotNull ApprovableBuildManager approvableBuildManager, @NotNull ProjectManager projectManager, @NotNull ExecutorServices executorServices)
-
-
Method Detail
-
canStart
@Nullable public WaitReason canStart(@NotNull QueuedBuildInfo queuedBuild, @NotNull Map<QueuedBuildInfo,BuildAgent> canBeStarted, @NotNull BuildDistributorInput buildDistributorInput, boolean emulationMode)
Description copied from interface:StartBuildPrecondition
Returns WaitReason if build cannot be started or null if TeamCity can start build.- Specified by:
canStart
in interfaceStartBuildPrecondition
- Parameters:
queuedBuild
- snapshot of a queued buildcanBeStarted
- contains map of builds already distributed among agents. Values can be null to indicate virtual agents.buildDistributorInput
- input data for the build distributoremulationMode
- true if extension is called from the build estimator- Returns:
- see above
-
setRequiresApprovalAttribute
public void setRequiresApprovalAttribute(@NotNull BuildPromotionEx buildPromotionEx, boolean canceledByTimeout)
In case of approval configuration taken from untrusted settings, we need to explicetly set that build required approval at the moment it was allowed to start(or canceled due to approval settings)
-
getConstraint
@NotNull public PositionConstraint getConstraint()
Description copied from interface:PositionConstraintAware
Constraint to be respected during objects sorting.- Specified by:
getConstraint
in interfacePositionConstraintAware
- Returns:
- position constraint
-
getOrderId
@NotNull public String getOrderId()
Description copied from interface:PositionAware
Returns object id that can be referenced by {PositionConstraint
}- Specified by:
getOrderId
in interfacePositionAware
- Returns:
- object id
-
-