Package de.dlr.proseo.planner.rest
Class JobControllerImpl
java.lang.Object
de.dlr.proseo.planner.rest.JobControllerImpl
- All Implemented Interfaces:
JobController
Spring MVC controller for the prosEO planner; implements the services required to plan and handle jobs.
This class manages the endpoints for job management, including retrieval, creation, modification, and cancellation of jobs.
- Author:
- Ernst Melchinger
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.ResponseEntity<RestJob> Cancel a job by job idorg.springframework.http.ResponseEntity<String> Retrieves the number of jobs by order ID and state.org.springframework.http.ResponseEntity<RestJob> Get a job by job idgetJobs(String state, Long orderId, Long recordFrom, Long recordTo, Boolean logs, String[] orderBy, org.springframework.http.HttpHeaders httpHeaders) Retrieves a list of jobs based on provided filtering criteria.org.springframework.http.ResponseEntity<RestJobGraph> graphJobSteps(String jobId, org.springframework.http.HttpHeaders httpHeaders) Create a graph of job step dependencies within a joborg.springframework.http.ResponseEntity<RestJob> Resume the job with job idorg.springframework.http.ResponseEntity<RestJob> Retry a job by job idorg.springframework.http.ResponseEntity<RestJob> suspendJob(String jobId, Boolean forceP, org.springframework.http.HttpHeaders httpHeaders) Suspend a job by job id
-
Constructor Details
-
JobControllerImpl
public JobControllerImpl()
-
-
Method Details
-
getJobs
@Transactional(isolation=REPEATABLE_READ, readOnly=true) public org.springframework.http.ResponseEntity<List<RestJob>> getJobs(String state, Long orderId, Long recordFrom, Long recordTo, Boolean logs, String[] orderBy, org.springframework.http.HttpHeaders httpHeaders) Retrieves a list of jobs based on provided filtering criteria.- Specified by:
getJobsin interfaceJobController- Parameters:
state- The job state to filter by (optional).orderId- The order ID to filter by (optional).recordFrom- First record of filtered and ordered result to return (optional; mandatory if "recordTo" is given).recordTo- Last record of filtered and ordered result to return (optional).logs- Indicates whether to include logs in the response.orderBy- An array of strings containing a column name and an optional sort direction (ASC/DESC), separated by white space.httpHeaders- HTTP headers.- Returns:
- A ResponseEntity containing a list of JSON objects describing jobs.
-
countJobs
@Transactional(isolation=REPEATABLE_READ, readOnly=true) public org.springframework.http.ResponseEntity<String> countJobs(String state, Long orderId, org.springframework.http.HttpHeaders httpHeaders) Retrieves the number of jobs by order ID and state.- Specified by:
countJobsin interfaceJobController- Parameters:
state- State of jobs.orderId- Order ID of jobs.httpHeaders- HTTP headers.- Returns:
- The number of jobs as a string.
-
getJob
@Transactional(isolation=REPEATABLE_READ) public org.springframework.http.ResponseEntity<RestJob> getJob(String jobId, org.springframework.http.HttpHeaders httpHeaders) Get a job by job id- Specified by:
getJobin interfaceJobController- Parameters:
jobId-
-
graphJobSteps
@Transactional(isolation=REPEATABLE_READ, readOnly=true) public org.springframework.http.ResponseEntity<RestJobGraph> graphJobSteps(String jobId, org.springframework.http.HttpHeaders httpHeaders) Create a graph of job step dependencies within a job- Specified by:
graphJobStepsin interfaceJobController- Parameters:
jobId-
-
resumeJob
public org.springframework.http.ResponseEntity<RestJob> resumeJob(String jobId, org.springframework.http.HttpHeaders httpHeaders) Resume the job with job id- Specified by:
resumeJobin interfaceJobController- Parameters:
jobId-
-
cancelJob
public org.springframework.http.ResponseEntity<RestJob> cancelJob(String jobId, org.springframework.http.HttpHeaders httpHeaders) Cancel a job by job id- Specified by:
cancelJobin interfaceJobController- Parameters:
jobId-
-
suspendJob
public org.springframework.http.ResponseEntity<RestJob> suspendJob(String jobId, Boolean forceP, org.springframework.http.HttpHeaders httpHeaders) Suspend a job by job id- Specified by:
suspendJobin interfaceJobController- Parameters:
jobId-force- If true, kill job, otherwise wait until end of job
-
retryJob
public org.springframework.http.ResponseEntity<RestJob> retryJob(String id, org.springframework.http.HttpHeaders httpHeaders) Retry a job by job id- Specified by:
retryJobin interfaceJobController- Parameters:
jobId-
-