Package de.dlr.proseo.procmgr.rest
Class WorkflowControllerImpl
java.lang.Object
de.dlr.proseo.procmgr.rest.WorkflowControllerImpl
- All Implemented Interfaces:
WorkflowController
Spring MVC controller for the prosEO Workflow Manager; implements the services required to manage workflows.
- Author:
- Katharina Bassler
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.ResponseEntity<String> countWorkflows(String missionCode, String workflowName, String workflowVersion, String inputProductClass, String configuredProcessor, Boolean enabled) Count the workflows matching the specified name, workflow version, input product class, or configured processor.org.springframework.http.ResponseEntity<RestWorkflow> createWorkflow(@Valid RestWorkflow workflow) Create a workflow from the given Json objectorg.springframework.http.ResponseEntity<?> Delete a workflow by IDorg.springframework.http.ResponseEntity<RestWorkflow> getWorkflowById(Long id) Find the workflow with the given IDorg.springframework.http.ResponseEntity<List<RestWorkflow>> getWorkflows(String missionCode, String workflowName, String workflowVersion, String inputProductClass, String configuredProcessor, Boolean enabled, Integer recordFrom, Integer recordTo, String[] orderBy) Get a list of all workflows with the specified mission, workflow name, workflow version, input product class and configured processororg.springframework.http.ResponseEntity<RestWorkflow> modifyWorkflow(Long id, RestWorkflow workflow) Update the workflow with the given ID with the attribute values of the given Json object.
-
Constructor Details
-
WorkflowControllerImpl
public WorkflowControllerImpl()
-
-
Method Details
-
countWorkflows
public org.springframework.http.ResponseEntity<String> countWorkflows(String missionCode, String workflowName, String workflowVersion, String inputProductClass, String configuredProcessor, Boolean enabled) Count the workflows matching the specified name, workflow version, input product class, or configured processor.- Specified by:
countWorkflowsin interfaceWorkflowController- Parameters:
missionCode- the mission codeworkflowName- the workflow nameworkflowVersion- the workflow versioninputProductClass- the input product classconfiguredProcessor- the configured processorenabled- whether the workflow is enabled- Returns:
- the number of matching workflows as a String (may be zero) or HTTP status "FORBIDDEN" and an error message, if a cross-mission data access was attempted
-
getWorkflows
public org.springframework.http.ResponseEntity<List<RestWorkflow>> getWorkflows(String missionCode, String workflowName, String workflowVersion, String inputProductClass, String configuredProcessor, Boolean enabled, Integer recordFrom, Integer recordTo, String[] orderBy) Get a list of all workflows with the specified mission, workflow name, workflow version, input product class and configured processor- Specified by:
getWorkflowsin interfaceWorkflowController- Parameters:
missionCode- the mission codeworkflowName- the workflow nameworkflowVersion- the workflow versioninputProductClass- the input product classconfiguredProcessor- the configured processorenabled- whether the workflow is enabledrecordFrom- first record of filtered and ordered result to returnrecordTo- last record of filtered and ordered result to returnorderBy- an array of strings containing a column name and an optional sort direction (ASC/DESC), separated by white space- Returns:
- HTTP status "OK" and a list of workflows or HTTP status "NOT_FOUND" and an error message, if no workflows match the search criteria, or HTTP status "FORBIDDEN" and an error message, if a cross-mission data access was attempted, or HTTP status "TOO MANY REQUESTS" if the result list exceeds a configured maximum
-
createWorkflow
public org.springframework.http.ResponseEntity<RestWorkflow> createWorkflow(@Valid @Valid RestWorkflow workflow) Create a workflow from the given Json object- Specified by:
createWorkflowin interfaceWorkflowController- Parameters:
workflow- the Json object from which to create the workflow- Returns:
- HTTP status "CREATED" and a response containing a Json object corresponding to the workflow after persistence (with ID and version for all contained objects) or HTTP status "FORBIDDEN" and an error message, if a cross-mission data access was attempted, or HTTP status "BAD_REQUEST", if any of the input data was invalid
-
getWorkflowById
Find the workflow with the given ID- Specified by:
getWorkflowByIdin interfaceWorkflowController- Parameters:
id- the ID to look for- Returns:
- HTTP status "OK" and a Json object corresponding to the found order or HTTP status "FORBIDDEN" and an error message, if a cross-mission data access was attempted, or HTTP status "NOT_FOUND", if no workflow with the given ID exists
-
deleteWorkflowById
Delete a workflow by ID- Specified by:
deleteWorkflowByIdin interfaceWorkflowController- Parameters:
id- the ID of the workflow to delete- Returns:
- a response entity with HTTP status "NO_CONTENT", if the deletion was successful, or HTTP status "NOT_FOUND" and an error message, if the workflow did not exist, or HTTP status "FORBIDDEN" and an error message, if a cross-mission data access was attempted, or HTTP status "NOT_MODIFIED" and an error message, if the deletion was unsuccessful
-
modifyWorkflow
public org.springframework.http.ResponseEntity<RestWorkflow> modifyWorkflow(Long id, RestWorkflow workflow) Update the workflow with the given ID with the attribute values of the given Json object.- Specified by:
modifyWorkflowin interfaceWorkflowController- Parameters:
id- the ID of the workflow to updateworkflow- a Json object containing the modified (and unmodified) attributes- Returns:
- a response containing HTTP status "OK" and a Json object corresponding to the workflow after modification (with ID and version for all contained objects) or HTTP status "NOT_MODIFIED" and the unchanged workflow, if no attributes were actually changed, or HTTP status "NOT_FOUND" and an error message, if no workflow with the given ID exists, or HTTP status "FORBIDDEN" and an error message, if a cross-mission data access was attempted
-