Package de.dlr.proseo.ordermgr.rest
Klasse ProcessingOrderMgr
java.lang.Object
de.dlr.proseo.ordermgr.rest.ProcessingOrderMgr
Service methods required to create, modify and delete processing order in the prosEO database, and to query the database about
such orders
- Autor:
- Ranjitha Vignesh
-
Feldübersicht
FelderModifizierer und TypFeldBeschreibung(Package privat) org.springframework.boot.web.client.RestTemplateBuilder
REST template builder -
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungcountSelectOrders
(String mission, String identifier, String[] state, String[] requestedProductClasses, String startTimeFrom, String startTimeTo, Long recordFrom, Long recordTo, String[] orderBy) Calculate the amount of orders satisfying the selection parameters.createOrder
(RestOrder order) Create an order from the given Json objectvoid
deleteExpiredOrderById
(Long id, Instant evictionTime) Delete an expired order by ID without cross-mission access checkvoid
deleteOrderById
(Long id) Delete an order by IDvoid
Veraltet.findOrdersWithEvictionTimeLessThan
(Instant evictionTime) Find all orders of state CLOSED and eviction time less than t and return a list of their DB IDsgetAndSelectOrders
(String mission, String identifier, String[] state, String[] requestedProductClasses, String startTimeFrom, String startTimeTo, Long recordFrom, Long recordTo, String[] orderBy) Retrieve a list of orders satisfying the selection parameters.getOrderById
(Long id) Find the oder with the given IDgetOrders
(String mission, String identifier, String[] requestedProductClasses, Date startTimeFrom, Date startTimeTo, Date executionTimeFrom, Date executionTimeTo) List of all orders filtered by mission, identifier, product class, execution time range; selection is restricted to the mission the current user is logged in tomodifyOrder
(Long id, RestOrder order) Update the order with the given ID with the attribute values of the given Json object.
-
Felddetails
-
rtb
@Autowired org.springframework.boot.web.client.RestTemplateBuilder rtbREST template builder
-
-
Konstruktordetails
-
ProcessingOrderMgr
public ProcessingOrderMgr()
-
-
Methodendetails
-
createOrder
@Transactional(isolation=REPEATABLE_READ) public RestOrder createOrder(RestOrder order) throws IllegalArgumentException, SecurityException Create an order from the given Json object- Parameter:
order
- the Json object to create the order from- Gibt zurück:
- a Json object corresponding to the order after persistence (with ID and version for all contained objects)
- Löst aus:
IllegalArgumentException
- if any of the input data was invalidSecurityException
- if a cross-mission data access was attempted
-
deleteOrderById
@Transactional(isolation=REPEATABLE_READ) public void deleteOrderById(Long id) throws javax.persistence.EntityNotFoundException, SecurityException, RuntimeException Delete an order by ID- Parameter:
id
- the ID of the order to delete- Löst aus:
javax.persistence.EntityNotFoundException
- if the order to delete does not exist in the databaseSecurityException
- if a cross-mission data access was attemptedRuntimeException
- if the deletion was not performed as expected
-
deleteExpiredOrderById
@Transactional(isolation=REPEATABLE_READ) public void deleteExpiredOrderById(Long id, Instant evictionTime) throws javax.persistence.EntityNotFoundException, SecurityException, RuntimeException Delete an expired order by ID without cross-mission access check- Parameter:
id
- the ID of the order to deleteevictionTime
- the relevant cutoff time for the eviction of orders- Löst aus:
javax.persistence.EntityNotFoundException
- if the order to delete does not exist in the databaseSecurityException
- if a cross-mission data access was attemptedRuntimeException
- if the deletion was not performed as expected
-
deleteOrdersWithEvictionTimeLessThan
Veraltet.Find all orders of state CLOSED and eviction time less than t and delete them- Parameter:
t
- the time to compare to
-
findOrdersWithEvictionTimeLessThan
@Transactional(isolation=REPEATABLE_READ, readOnly=true) public List<Long> findOrdersWithEvictionTimeLessThan(Instant evictionTime) Find all orders of state CLOSED and eviction time less than t and return a list of their DB IDs- Parameter:
evictionTime
- the time to compare to- Gibt zurück:
- a list of database IDs for evictable orders
-
getOrderById
@Transactional(isolation=REPEATABLE_READ, readOnly=true) public RestOrder getOrderById(Long id) throws IllegalArgumentException, javax.persistence.NoResultException, SecurityException Find the oder with the given ID- Parameter:
id
- the ID to look for- Gibt zurück:
- a Json object corresponding to the order found
- Löst aus:
IllegalArgumentException
- if no order ID was givenjavax.persistence.NoResultException
- if no order with the given ID existsSecurityException
- if a cross-mission data access was attempted
-
modifyOrder
@Transactional(isolation=REPEATABLE_READ) public RestOrder modifyOrder(Long id, RestOrder order) throws javax.persistence.EntityNotFoundException, IllegalArgumentException, SecurityException, ConcurrentModificationException Update the order with the given ID with the attribute values of the given Json object. Orders may only be changed while they are in state "INITIAL". The only state modification allowed here is from INITIAL to APPROVED.- Parameter:
id
- the ID of the product to updateorder
- a Json object containing the modified (and unmodified) attributes- Gibt zurück:
- a Json object corresponding to the product after modification (with ID and version for all contained objects)
- Löst aus:
javax.persistence.EntityNotFoundException
- if no product with the given ID existsIllegalArgumentException
- if any of the input data was invalidSecurityException
- if a cross-mission data access was attemptedConcurrentModificationException
- if the order has been modified since retrieval by the client
-
getOrders
@Transactional(isolation=REPEATABLE_READ, readOnly=true) public List<RestOrder> getOrders(String mission, String identifier, String[] requestedProductClasses, @DateTimeFormat Date startTimeFrom, @DateTimeFormat Date startTimeTo, @DateTimeFormat Date executionTimeFrom, @DateTimeFormat Date executionTimeTo) throws javax.persistence.NoResultException, SecurityException List of all orders filtered by mission, identifier, product class, execution time range; selection is restricted to the mission the current user is logged in to- Parameter:
mission
- the mission codeidentifier
- the order identifierrequestedProductClasses
- an array of product typesstartTimeFrom
- earliest sensing start timestartTimeTo
- latest sensing start timeexecutionTimeFrom
- earliest order execution timeexecutionTimeTo
- latest order execution time- Gibt zurück:
- a list of orders
- Löst aus:
javax.persistence.NoResultException
- if no orders matching the given search criteria could be foundSecurityException
- if a cross-mission data access was attempted
-
getAndSelectOrders
@Transactional(isolation=REPEATABLE_READ, readOnly=true) public List<RestOrder> getAndSelectOrders(String mission, String identifier, String[] state, String[] requestedProductClasses, String startTimeFrom, String startTimeTo, Long recordFrom, Long recordTo, String[] orderBy) Retrieve a list of orders satisfying the selection parameters. Mission code is mandatory.- Parameter:
mission
- the mission codeidentifier
- the order identifier patternstate
- an array of statesrequestedProductClasses
- an array of product typesstartTimeFrom
- earliest sensing start timestartTimeTo
- latest sensing start timerecordFrom
- 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- Gibt zurück:
- The result list
-
countSelectOrders
@Transactional(isolation=REPEATABLE_READ, readOnly=true) public String countSelectOrders(String mission, String identifier, String[] state, String[] requestedProductClasses, String startTimeFrom, String startTimeTo, Long recordFrom, Long recordTo, String[] orderBy) Calculate the amount of orders satisfying the selection parameters. Mission code is mandatory.- Parameter:
mission
- the mission codeidentifier
- the order identifier patternstate
- an array of statesrequestedProductClasses
- an array of product typesstartTimeFrom
- earliest sensing start timestartTimeTo
- latest sensing start timerecordFrom
- 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),- Gibt zurück:
- The order count
-