@Validated
public interface AgentJobService
| Modifier and Type | Method and Description |
|---|---|
void |
changeJobArchiveStatus(@NotBlank java.lang.String jobId,
ArchiveStatus archiveStatus)
Notify the server of a change of job files archive status.
|
void |
changeJobStatus(@NotBlank java.lang.String jobId,
JobStatus currentJobStatus,
JobStatus newJobStatus,
java.lang.String message)
Notify the server of a change of job status.
|
void |
claimJob(@NotBlank java.lang.String jobId,
@Valid AgentClientMetadata agentClientMetadata)
Claim a given job, telling the server that this agent is about to begin execution.
|
java.util.Map<java.lang.String,java.lang.String> |
configure(@Valid AgentClientMetadata agentClientMetadata)
Obtain server-provided configuration properties.
|
JobSpecification |
getJobSpecification(@NotBlank java.lang.String id)
Given a job id retrieve the job specification from the server.
|
JobStatus |
getJobStatus(@NotBlank java.lang.String jobId)
Retrieve the current job status for the given job id.
|
void |
handshake(@Valid AgentClientMetadata agentClientMetadata)
Perform server handshake.
|
java.lang.String |
reserveJobId(@Valid AgentJobRequest jobRequest,
@Valid AgentClientMetadata agentClientMetadata)
Request a given job id to be reserved for this job, send along the job details, to be persisted by the server.
|
JobSpecification |
resolveJobSpecification(@NotBlank java.lang.String id)
Given the parameters supplied by the job request attempt to resolve a job specification on the server.
|
JobSpecification |
resolveJobSpecificationDryRun(@Valid AgentJobRequest jobRequest)
Invoke the job specification resolution logic without persisting anything on the server.
|
void handshake(@Valid
@Valid AgentClientMetadata agentClientMetadata)
throws HandshakeException
agentClientMetadata - metadata about the client making this requestHandshakeException - if the server rejects this clientjava.util.Map<java.lang.String,java.lang.String> configure(@Valid
@Valid AgentClientMetadata agentClientMetadata)
throws ConfigureException
agentClientMetadata - metadata about the client making this requestConfigureException - if the server properties cannot be obtainedjava.lang.String reserveJobId(@Valid
@Valid AgentJobRequest jobRequest,
@Valid
@Valid AgentClientMetadata agentClientMetadata)
throws JobReservationException,
JobIdUnavailableException
jobRequest - the job parameters and agent metadataagentClientMetadata - metadata about the client making this requestJobReservationException - if the server failed to fulfill this requestJobIdUnavailableException - if the id requested has already been usedJobSpecification resolveJobSpecification(@NotBlank @NotBlank java.lang.String id) throws JobSpecificationResolutionException
id - The id of the job to resolve a job specification forJobSpecificationResolutionException - if the specification cannot be resolvedJobSpecification getJobSpecification(@NotBlank @NotBlank java.lang.String id) throws JobSpecificationResolutionException
id - The id of the job to get the specification forJobSpecificationResolutionException - if the specification cannot be retrievedJobSpecification resolveJobSpecificationDryRun(@Valid @Valid AgentJobRequest jobRequest) throws JobSpecificationResolutionException
jobRequest - The various parameters required to perform the dry run should be contained in this requestJobSpecificationResolutionException - When an error occurred during attempted resolutionvoid claimJob(@NotBlank
@NotBlank java.lang.String jobId,
@Valid
@Valid AgentClientMetadata agentClientMetadata)
throws JobReservationException
jobId - the id of the jobagentClientMetadata - metadata for the agent claiming this jobJobReservationException - When the the claim request fails is invalid (reasons include: job already
claimed, invalid job ID, failure to reach the servervoid changeJobStatus(@NotBlank
@NotBlank java.lang.String jobId,
JobStatus currentJobStatus,
JobStatus newJobStatus,
java.lang.String message)
throws ChangeJobStatusException
jobId - the id of the jobcurrentJobStatus - the expected current status of the jobnewJobStatus - the new status of the jobmessage - an optional message tha accompanies this change of statusChangeJobStatusException - when the agent fails to update the job statusJobStatus getJobStatus(@NotBlank @NotBlank java.lang.String jobId) throws GetJobStatusException
jobId - the id of the jobGetJobStatusException - when the agent fails to retrieve the job statusvoid changeJobArchiveStatus(@NotBlank
@NotBlank java.lang.String jobId,
ArchiveStatus archiveStatus)
throws ChangeJobArchiveStatusException
jobId - the id of the jobarchiveStatus - the new archive status of the jobChangeJobArchiveStatusException - when the agent fails to update the job archive status