Class StageServiceImpl

    • Constructor Detail

      • StageServiceImpl

        public StageServiceImpl()
    • Method Detail

      • getStage

        @NotNull
        public @NotNull ImmutableChainStage getStage​(@NotNull
                                                     @NotNull PlanKey planKey,
                                                     long stageId)
                                              throws WebValidationException
        Description copied from interface: StageService
        Get an individual stage from a plan. In clustered mode, there is NO consistency guarantee.
        Specified by:
        getStage in interface StageService
        Parameters:
        planKey - the plan the stage belongs to
        stageId - the id of the stage
        Returns:
        ImmutableChainStage representing the stage if it exists
        Throws:
        WebValidationException
      • validateStageForAdd

        @NotNull
        public @NotNull ErrorCollection validateStageForAdd​(@NotNull
                                                            @NotNull PlanKey planKey,
                                                            @Nullable
                                                            @Nullable String stageName,
                                                            @Nullable
                                                            @Nullable String stageDescription,
                                                            boolean isManual,
                                                            boolean isFinal)
                                                     throws WebValidationException
        Description copied from interface: StageService
        Validates a new stage for the specified plan.
        Specified by:
        validateStageForAdd in interface StageService
        Parameters:
        planKey - of plan to add stage to
        stageName - of stage
        stageDescription - of stage
        isManual - true if this stage is a manual stage
        Returns:
        error collection containing any validation errors against the stage data.
        Throws:
        WebValidationException - if plan does not exist or it is not of the correct type
      • addStage

        @NotNull
        public @NotNull ImmutableChainStage addStage​(@NotNull
                                                     @NotNull PlanKey planKey,
                                                     @NotNull
                                                     @NotNull String stageName,
                                                     @Nullable
                                                     @Nullable String stageDescription,
                                                     boolean isManual,
                                                     boolean isFinal)
                                              throws WebValidationException
        Description copied from interface: StageService
        Adds a new stage to the specified plan. Currently will be added to the end of the list // todo allow people to add a stage to a specific index?
        Specified by:
        addStage in interface StageService
        Parameters:
        planKey - of plan to add stage to
        stageName - of stage
        stageDescription - of stage
        isManual - true if this stage is a manual stage
        isFinal - true if stage is a final stage
        Returns:
        created chain stage
        Throws:
        WebValidationException - if plan does not exist or it is not of the correct type, or if validation fails
      • validateStageForUpdate

        @NotNull
        public @NotNull ErrorCollection validateStageForUpdate​(@NotNull
                                                               @NotNull PlanKey planKey,
                                                               long stageId,
                                                               @Nullable
                                                               @Nullable String name,
                                                               @Nullable
                                                               @Nullable String description,
                                                               boolean manual,
                                                               boolean isFinal)
                                                        throws WebValidationException
        Description copied from interface: StageService
        Validates editing of a stage.
        Specified by:
        validateStageForUpdate in interface StageService
        Parameters:
        planKey - of plan stage belongs to
        stageId - if of the stage being edited
        name - new name of stage
        description - new description of stage
        manual - new value for id stage is manual or not
        isFinal - if stage is final or not
        Returns:
        error collection containing any validation errors that may have occurred against stage data.
        Throws:
        WebValidationException
      • moveStage

        @NotNull
        public @NotNull ImmutableChainStage moveStage​(@NotNull
                                                      @NotNull PlanKey planKey,
                                                      long stageId,
                                                      int index)
                                               throws WebValidationException
        Description copied from interface: StageService
        Moves stage to a different position in the plan structure. Will remove all broken artifact subscriptions.
        Specified by:
        moveStage in interface StageService
        Parameters:
        planKey - key of the plan the stage belongs to
        stageId - if of the stage being updated
        index - new position of the stage in the plan structure, must be a non-negative value. If the index is too big, the stage will be moved to the end of the list.
        Returns:
        ImmutableChainStage representing the updated stage
        Throws:
        WebValidationException - if any errors occur