Class JobServiceImpl

    • Constructor Detail

      • JobServiceImpl

        public JobServiceImpl()
    • Method Detail

      • getJobsForStage

        @NotNull
        public @NotNull List<ImmutableJob> getJobsForStage​(@NotNull
                                                           @NotNull PlanKey planKey,
                                                           long stageId)
        Description copied from interface: JobService
        Get all jobs in a particular stage, ordered alphabetically
        Specified by:
        getJobsForStage in interface JobService
        Parameters:
        planKey - of plan
        stageId - id of the stage
        Returns:
        list of immutable jobs
      • getJob

        @NotNull
        public @NotNull ImmutableJob getJob​(@NotNull
                                            @NotNull PlanKey jobKey)
        Description copied from interface: JobService
        Get an individual job. In clustered mode, there is NO consistency guarantee.
        Specified by:
        getJob in interface JobService
        Parameters:
        jobKey - of the job to get
        Returns:
        the job
      • getJobWithConsistencyGuarantee

        @NotNull
        public @NotNull ImmutableJob getJobWithConsistencyGuarantee​(@NotNull
                                                                    @NotNull PlanKey jobKey)
        Description copied from interface: JobService
        Get an individual job. There is a guarantee that the data will be up-to-date.
        Specified by:
        getJobWithConsistencyGuarantee in interface JobService
        Parameters:
        jobKey - of the job to get
        Returns:
        the job
      • validateJobForAdd

        public ErrorCollection validateJobForAdd​(@NotNull
                                                 @NotNull PlanKey planKey,
                                                 long stageId,
                                                 @Nullable
                                                 @Nullable String jobKey,
                                                 @Nullable
                                                 @Nullable String name,
                                                 @Nullable
                                                 @Nullable String description,
                                                 boolean suspended)
                                          throws WebValidationException
        Description copied from interface: JobService
        Validates the parameters for adding a job.
        Specified by:
        validateJobForAdd in interface JobService
        Parameters:
        planKey - of the plan to add job to.
        stageId - of the stage to add the job to.
        jobKey - key of the job to add. May be full or partial job key.
        name - name of the job to add.
        description - description of the job.
        suspended - sets the job's suspended status.
        Returns:
        error collection containing any validation errors that may have occurred against job data.
        Throws:
        WebValidationException
      • addJob

        @NotNull
        public @NotNull ImmutableJob addJob​(@NotNull
                                            @NotNull PlanKey chainKey,
                                            long stageId,
                                            @Nullable
                                            @Nullable String jobKeyString,
                                            @Nullable
                                            @Nullable String name,
                                            @Nullable
                                            @Nullable String description,
                                            boolean suspended)
                                     throws WebValidationException
        Description copied from interface: JobService
        Add a job to an existing stage in the plan
        Specified by:
        addJob in interface JobService
        Parameters:
        chainKey - of the plan to add the job
        stageId - of the stage to add the job
        jobKeyString - of the job to add. May be full or partial job key.
        name - name of the job
        description - description of the job
        suspended - sets the job suspended status
        Returns:
        added job
        Throws:
        WebValidationException
      • validateJobForClone

        public ErrorCollection validateJobForClone​(@Nullable
                                                   @Nullable String sourceJobKeyString,
                                                   @NotNull
                                                   @NotNull PlanKey chainKey,
                                                   long stageId,
                                                   @Nullable
                                                   @Nullable String newJobKey,
                                                   @Nullable
                                                   @Nullable String name,
                                                   @Nullable
                                                   @Nullable String description,
                                                   @Nullable
                                                   @Nullable Boolean suspended)
                                            throws WebValidationException
        Description copied from interface: JobService
        Validates the parameters for cloning a job.
        Specified by:
        validateJobForClone in interface JobService
        Parameters:
        sourceJobKeyString - key of the job to clone. Must be full job key.
        chainKey - key of the plan to add the new job to.
        stageId - id of the stage to add the new job to.
        newJobKey - key of the new job. May be full or partial job key.
        name - name of the new job.
        description - description of the new job.
        suspended - suspended state of the new job.
        Returns:
        error collection containing any validation errors that may have occurred against job data.
        Throws:
        WebValidationException
      • cloneJob

        public ImmutableJob cloneJob​(@NotNull
                                     @NotNull String sourceJobKeyString,
                                     @NotNull
                                     @NotNull PlanKey chainKey,
                                     long stageId,
                                     @NotNull
                                     @NotNull String newJobKeyString,
                                     @NotNull
                                     @NotNull String name,
                                     @Nullable
                                     @Nullable String description,
                                     boolean suspended)
                              throws WebValidationException
        Description copied from interface: JobService
        Copy the given job and give the copy the key, name, description and suspended state provided.
        Specified by:
        cloneJob in interface JobService
        Parameters:
        sourceJobKeyString - key of the source job to copy. Must be full job key.
        chainKey - of the plan to add the new job.
        stageId - of the stage to add the new job.
        newJobKeyString - key to give to the new job. May be full or partial job key.
        name - The name of the cloned job.
        description - The description of the cloned job.
        suspended - The suspended state of the cloned job.
        Returns:
        the result of the copy.
        Throws:
        WebValidationException
      • validateJobForUpdate

        @NotNull
        public @NotNull ErrorCollection validateJobForUpdate​(@NotNull
                                                             @NotNull PlanKey jobKey,
                                                             @NotNull
                                                             @NotNull String name,
                                                             @Nullable
                                                             @Nullable String description,
                                                             boolean suspended,
                                                             long stageId)
        Description copied from interface: JobService
        Validate editing of a job
        Specified by:
        validateJobForUpdate in interface JobService
        Parameters:
        jobKey - of the job to update
        name - new name of the job
        description - new description of the job
        suspended - sets the job suspended status
        Returns:
        error collection containing any validation errors that may have occurred against job data.