Package de.dlr.proseo.ordermgr.rest
Class OrderTemplateControllerImpl
java.lang.Object
de.dlr.proseo.ordermgr.rest.OrderTemplateControllerImpl
- All Implemented Interfaces:
OrdertemplateController
@Component
public class OrderTemplateControllerImpl
extends Object
implements OrdertemplateController
Spring MVC controller for the prosEO OrderTemplate Manager; implements the services required to manage processing orders
- Author:
- Ranjitha Vignesh
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.ResponseEntity<String> countOrderTemplates(String mission, String identifier) Count orders filtered by mission, identifier and id not equal nid.org.springframework.http.ResponseEntity<String> countSelectOrderTemplates(String mission, String identifier, String[] productClass, Long recordFrom, Long recordTo, String[] orderBy) Calculate the amount of orders satisfying the selection parameters.org.springframework.http.ResponseEntity<RestOrderTemplate> createOrderTemplate(RestOrderTemplate restOrderTemplate) Create an order from the given JSON objectorg.springframework.http.ResponseEntity<?> Delete an order by IDorg.springframework.http.ResponseEntity<List<RestOrderTemplate>> getAndSelectOrderTemplates(String mission, String identifier, String[] productClass, Long recordFrom, Long recordTo, String[] orderBy) Retrieve a list of orders satisfying the selection parametersorg.springframework.http.ResponseEntity<RestOrderTemplate> Find the order with the given IDorg.springframework.http.ResponseEntity<List<RestOrderTemplate>> getOrderTemplates(String mission, String identifier, String[] productClasses) List of all orders filtered by mission, identifier, productClasses, starttime rangeorg.springframework.http.ResponseEntity<RestOrderTemplate> modifyOrderTemplate(Long id, @Valid RestOrderTemplate restOrderTemplate) Update the order with the given ID with the attribute values of the given JSON object.
-
Constructor Details
-
OrderTemplateControllerImpl
public OrderTemplateControllerImpl()
-
-
Method Details
-
createOrderTemplate
public org.springframework.http.ResponseEntity<RestOrderTemplate> createOrderTemplate(RestOrderTemplate restOrderTemplate) Create an order from the given JSON object- Specified by:
createOrderTemplatein interfaceOrdertemplateController- Parameters:
restOrderTemplate- the JSON object to create the order from- Returns:
- HTTP status "CREATED" and a response containing a JSON object corresponding to the order 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
-
getOrderTemplates
public org.springframework.http.ResponseEntity<List<RestOrderTemplate>> getOrderTemplates(String mission, String identifier, String[] productClasses) List of all orders filtered by mission, identifier, productClasses, starttime range- Specified by:
getOrderTemplatesin interfaceOrdertemplateController- Parameters:
mission- the mission codeidentifier- the unique order identifier stringproductClasses- an array of product typesstartTimeFrom- earliest sensing start timestartTimeTo- latest sensing start timeexecutionTimeFrom- earliest order execution timeexecutionTimeTo- latest order execution time- Returns:
- HTTP status "OK" and a list of products or HTTP status "NOT_FOUND" and an error message, if no products matching the search criteria were found, or HTTP status "FORBIDDEN" and an error message, if a cross-mission data access was attempted
-
getAndSelectOrderTemplates
public org.springframework.http.ResponseEntity<List<RestOrderTemplate>> getAndSelectOrderTemplates(String mission, String identifier, String[] productClass, Long recordFrom, Long recordTo, String[] orderBy) Retrieve a list of orders satisfying the selection parameters- Specified by:
getAndSelectOrderTemplatesin interfaceOrdertemplateController- Parameters:
mission- the mission codeidentifier- the unique order identifier stringproductClass- an array of product typesrecordFrom- 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 spacestate- an array of order statesstartTimeFrom- earliest sensing start timestartTimeTo- latest sensing start time- Returns:
- the result list
-
countSelectOrderTemplates
public org.springframework.http.ResponseEntity<String> countSelectOrderTemplates(String mission, String identifier, String[] productClass, Long recordFrom, Long recordTo, String[] orderBy) Calculate the amount of orders satisfying the selection parameters. Mission code is mandatory.- Specified by:
countSelectOrderTemplatesin interfaceOrdertemplateController- Parameters:
mission- the mission codeidentifier- the unique order identifier stringproductClass- an array of product typesrecordFrom- 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 spacestate- an array of order statesstartTimeFrom- earliest sensing start timestartTimeTo- latest sensing start time- Returns:
- The order count
-
getOrderTemplateById
Find the order with the given ID- Specified by:
getOrderTemplateByIdin interfaceOrdertemplateController- 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 orbit with the given ID exists
-
deleteOrderTemplateById
Delete an order by ID- Specified by:
deleteOrderTemplateByIdin interfaceOrdertemplateController- Parameters:
id- the ID of the order 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 orbit 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
-
modifyOrderTemplate
public org.springframework.http.ResponseEntity<RestOrderTemplate> modifyOrderTemplate(Long id, @Valid @Valid RestOrderTemplate restOrderTemplate) Update the order with the given ID with the attribute values of the given JSON object.- Specified by:
modifyOrderTemplatein interfaceOrdertemplateController- Parameters:
id- the ID of the order to updaterestOrderTemplate- a JSON object containing the modified (and unmodified) attributes- Returns:
- a response containing HTTP status "OK" and a JSON object corresponding to the order after modification (with ID and version for all contained objects) or HTTP status "NOT_MODIFIED" and the unchanged order, if no attributes were actually changed, or HTTP status "NOT_FOUND" and an error message, if no order with the given ID exists, or HTTP status "FORBIDDEN" and an error message, if a cross-mission data access was attempted
-
countOrderTemplates
@Transactional(isolation=REPEATABLE_READ, readOnly=true) public org.springframework.http.ResponseEntity<String> countOrderTemplates(String mission, String identifier) Count orders filtered by mission, identifier and id not equal nid.- Specified by:
countOrderTemplatesin interfaceOrdertemplateController- Parameters:
mission- The mission codeidentifier- The unique order identifier stringnid- The ids of orbit(s) found has to be unequal to nid- Returns:
- The number of orders found
-