Class RestJobServiceImpl
java.lang.Object
com.atlassian.bamboo.plugins.rest.plan.stage.job.RestJobServiceImpl
- All Implemented Interfaces:
RestJobService
Provides job information and operations in restful formats
-
Constructor Summary
ConstructorsConstructorDescriptionRestJobServiceImpl(BuildExecutionManager buildExecutionManager, com.atlassian.sal.api.message.I18nResolver i18nResolver, JobConversionFunction jobConversionFunction, JobService jobService, PlanRestService planRestService, RestArtifactService restArtifactService) -
Method Summary
Modifier and TypeMethodDescription@NotNull RestJobaddJob(@NotNull PlanKey planKey, long stageId, @Nullable RestJob restJob, @NotNull Expansion expansion, @NotNull jakarta.ws.rs.core.UriInfo uriInfo) Create a new jobvoiddeleteJob(@NotNull PlanKey jobKey, @NotNull Optional<ConfirmationToken> confirmationToken, @NotNull jakarta.ws.rs.core.UriInfo uriInfo) Remove a job.@NotNull TokengetDeleteConfirmationToken(@NotNull PlanKey jobKey, @NotNull jakarta.ws.rs.core.UriInfo uriInfo) Generate the delete confirmation token to be used for the given job key.@NotNull RestWarningsgetJobDeletionWarnings(@NotNull PlanKey jobKey, @NotNull Expansion expansion, @NotNull jakarta.ws.rs.core.UriInfo uriInfo) Get warnings related to job deletion.@NotNull RestWarningsgetJobMoveWarnings(@NotNull PlanKey jobKey, long targetStageId, @NotNull Expansion expansion, @NotNull jakarta.ws.rs.core.UriInfo uriInfo) Get warnings related to job move.@NotNull RestJobupdateJob(@NotNull PlanKey jobKey, @Nullable RestJob restJob, @NotNull Optional<ConfirmationToken> confirmationToken, @NotNull Expansion expansion, @NotNull jakarta.ws.rs.core.UriInfo uriInfo) Updates the details of a specific job.
-
Constructor Details
-
RestJobServiceImpl
@Autowired public RestJobServiceImpl(BuildExecutionManager buildExecutionManager, com.atlassian.sal.api.message.I18nResolver i18nResolver, JobConversionFunction jobConversionFunction, JobService jobService, PlanRestService planRestService, RestArtifactService restArtifactService)
-
-
Method Details
-
addJob
@NotNull public @NotNull RestJob addJob(@NotNull @NotNull PlanKey planKey, long stageId, @Nullable @Nullable RestJob restJob, @NotNull @NotNull Expansion expansion, @NotNull @NotNull jakarta.ws.rs.core.UriInfo uriInfo) throws WebValidationException Description copied from interface:RestJobServiceCreate a new job- Specified by:
addJobin interfaceRestJobService- Parameters:
planKey- of plan job is instageId- of stage job is inrestJob- Rest Jobexpansion- the expansion.uriInfo- URI info from the request- Returns:
- Rest Job
- Throws:
WebValidationException
-
updateJob
@NotNull public @NotNull RestJob updateJob(@NotNull @NotNull PlanKey jobKey, @Nullable @Nullable RestJob restJob, @NotNull @NotNull Optional<ConfirmationToken> confirmationToken, @NotNull @NotNull Expansion expansion, @NotNull @NotNull jakarta.ws.rs.core.UriInfo uriInfo) throws WebValidationException Description copied from interface:RestJobServiceUpdates the details of a specific job. Will ignore missing properties.- Specified by:
updateJobin interfaceRestJobService- Parameters:
jobKey- of job.restJob- job details.confirmationToken- The token to match before performing the updateexpansion- the expansion.uriInfo- URI info from the request- Returns:
- updated job object
- Throws:
WebValidationException
-
deleteJob
public void deleteJob(@NotNull @NotNull PlanKey jobKey, @NotNull @NotNull Optional<ConfirmationToken> confirmationToken, @NotNull @NotNull jakarta.ws.rs.core.UriInfo uriInfo) throws WebValidationException Description copied from interface:RestJobServiceRemove a job.- Specified by:
deleteJobin interfaceRestJobService- Parameters:
jobKey- of jobconfirmationToken- The token to match before performing the deleteuriInfo- URI info from the request- Throws:
WebValidationException
-
getJobDeletionWarnings
@NotNull public @NotNull RestWarnings getJobDeletionWarnings(@NotNull @NotNull PlanKey jobKey, @NotNull @NotNull Expansion expansion, @NotNull @NotNull jakarta.ws.rs.core.UriInfo uriInfo) throws WebValidationException Description copied from interface:RestJobServiceGet warnings related to job deletion. This will return a structure with one entry for each artifact subscription. The entry for the artifact subscription will contain a list of all consuming jobs.- Specified by:
getJobDeletionWarningsin interfaceRestJobService- Parameters:
jobKey- of jobexpansion- the expansion.uriInfo- URI info from the request- Returns:
- an object with information needed to display warnings to the user
- Throws:
WebValidationException
-
getDeleteConfirmationToken
@NotNull public @NotNull Token getDeleteConfirmationToken(@NotNull @NotNull PlanKey jobKey, @NotNull @NotNull jakarta.ws.rs.core.UriInfo uriInfo) throws WebValidationException Description copied from interface:RestJobServiceGenerate the delete confirmation token to be used for the given job key.- Specified by:
getDeleteConfirmationTokenin interfaceRestJobService- Parameters:
jobKey- job key to generate the token for.uriInfo- URI info from the request- Returns:
- current confirmation token.
- Throws:
WebValidationException- if the job key is invalid.
-
getJobMoveWarnings
@NotNull public @NotNull RestWarnings getJobMoveWarnings(@NotNull @NotNull PlanKey jobKey, long targetStageId, @NotNull @NotNull Expansion expansion, @NotNull @NotNull jakarta.ws.rs.core.UriInfo uriInfo) throws WebValidationException Description copied from interface:RestJobServiceGet warnings related to job move. This will return a structure with one entry for each artifact subscription. The entry for the artifact subscription will contain a list of all consuming jobs.- Specified by:
getJobMoveWarningsin interfaceRestJobService- Parameters:
jobKey- of job.targetStageId- id of the stage the job is moving to.expansion- the expansion.uriInfo- URI info from the request- Returns:
- an object with information needed to display warnings to the user
- Throws:
WebValidationException
-