Package de.dlr.proseo.planner.util
Klasse OrderUtil
java.lang.Object
de.dlr.proseo.planner.util.OrderUtil
Handle processing orders
- Autor:
- Ernst Melchinger
-
Feldübersicht
FelderModifizierer und TypFeldBeschreibung(Package privat) ProductionPlannerConfiguration
Planner configuration(Package privat) org.springframework.boot.web.client.RestTemplateBuilder
REST template builder -
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungapprove
(ProcessingOrder order) Approve the processing order and it jobs and job steps.cancel
(ProcessingOrder orderX) Cancel the processing order and it jobs and job steps.checkAutoClose
(ProcessingOrder order) If the order is in systematic processing and the mission has an order retention period, the order is automatically closed after completion and the eviction time is set.checkFinish
(Long orderId) Check whether the processing order and it jobs and job steps are finished.void
Look for next order in state PLANNING, RELEASING and SUSPENDING to restart.Close the processing order and it jobs and job steps.delete
(ProcessingOrder order) Delete the processing order and it jobs and job steps.getProcessingFacilities
(long id) Get the processing facility(-ies) processing the order At the moment there is normally only one facility to do so.void
logOrderState
(ProcessingOrder order) Log the order state (currently a dummy method)Plan the processing order and it jobs and job steps.prepareSuspend
(long id, Boolean force) Prepare the suspend of the processing order.reset
(ProcessingOrder order) Reset the processing order and it jobs and job steps.void
restartReleasingOrder
(long id) Restart the thread corresponding to release the order with the given ID.void
restartSuspendingOrder
(long id) Restart the thread corresponding to suspend the order with the given ID.resume
(ProcessingOrder order, Boolean wait, String user, String pw) Resume the processing order and it jobs and job steps.retry
(ProcessingOrder order) Retry the processing order and it jobs and job steps.sendNotification
(ProcessingOrder order) Sends a notification for the given processing order.void
setHasFailedJobSteps
(ProcessingOrder order, Boolean failed) Set the failed job steps flag in the order on failurevoid
setOrderHistory
(ProcessingOrder order) Set the order state and time of an order history object.void
Set the deletion time of an order history object.void
setStateMessage
(ProcessingOrder order, String stateMessage) Set the state message of the order.void
setTimes
(ProcessingOrder order) Set the actual completion time and the estimated completion time if it is null.startOrder
(ProcessingOrder order) Start the processing order and it jobs and job steps.Suspend the processing order and its jobs and job steps.
-
Felddetails
-
config
Planner configuration -
rtb
@Autowired org.springframework.boot.web.client.RestTemplateBuilder rtbREST template builder
-
-
Konstruktordetails
-
OrderUtil
public OrderUtil()
-
-
Methodendetails
-
cancel
@Transactional(isolation=REPEATABLE_READ) public PlannerResultMessage cancel(ProcessingOrder orderX) Cancel the processing order and it jobs and job steps.- Parameter:
orderX
- The processing order- Gibt zurück:
- Result message
-
reset
Reset the processing order and it jobs and job steps.- Parameter:
order
- The processing order- Gibt zurück:
- Result message
-
delete
Delete the processing order and it jobs and job steps.- Parameter:
order
- The processing order- Gibt zurück:
- Result message
-
approve
@Transactional(isolation=REPEATABLE_READ) public PlannerResultMessage approve(ProcessingOrder order) Approve the processing order and it jobs and job steps.- Parameter:
order
- The processing order- Gibt zurück:
- Result message
-
plan
Plan the processing order and it jobs and job steps.- Parameter:
id
- The processing order IDfacilityId
- The database ID of the processing facility to run the orderwait
- indicates whether to wait for the order planning to complete- Gibt zurück:
- Result message
-
resume
Resume the processing order and it jobs and job steps.- Parameter:
order
- The processing orderwait
- indicates whether to wait for the order releasing to completeuser
- the username for calling other prosEO services (e. g. AIP Client)pw
- the password for calling other prosEO services (e. g. AIP Client)- Gibt zurück:
- Result message
-
startOrder
@Transactional(isolation=REPEATABLE_READ) public PlannerResultMessage startOrder(ProcessingOrder order) Start the processing order and it jobs and job steps.- Parameter:
order
- The processing order- Gibt zurück:
- Result message
-
suspend
Suspend the processing order and its jobs and job steps.- Parameter:
id
- The processing order IDforce
- The flag to force kill of currently running job steps on processing facility- Gibt zurück:
- Result message
-
prepareSuspend
Prepare the suspend of the processing order. All jobs are set to state ON_HOLD first to avoid start of further job steps.- Parameter:
id
- The processing order IDforce
- The flag to force kill of currently running job steps on processing facility- Gibt zurück:
- Result message
-
retry
Retry the processing order and it jobs and job steps.- Parameter:
order
- The processing order- Gibt zurück:
- Result message
-
close
Close the processing order and it jobs and job steps.- Parameter:
orderId
- The processing order ID- Gibt zurück:
- Result message
-
checkFinish
Check whether the processing order and it jobs and job steps are finished.- Parameter:
orderId
- The processing order ID- Gibt zurück:
- true after success
-
checkAutoClose
If the order is in systematic processing and the mission has an order retention period, the order is automatically closed after completion and the eviction time is set.- Parameter:
order
- The processing order- Gibt zurück:
- true if closed
-
setTimes
Set the actual completion time and the estimated completion time if it is null.- Parameter:
order
- The processing order
-
setStateMessage
@Transactional(isolation=REPEATABLE_READ) public void setStateMessage(ProcessingOrder order, String stateMessage) Set the state message of the order.- Parameter:
order
- The processing order
-
setOrderHistory
Set the order state and time of an order history object. The time setting depends on the current order state.- Parameter:
order
- The processing order
-
setOrderHistoryOrderDeleted
@Transactional(isolation=REPEATABLE_READ) public void setOrderHistoryOrderDeleted(ProcessingOrder order) Set the deletion time of an order history object.- Parameter:
order
- The processing order
-
sendNotification
Sends a notification for the given processing order. This method sends a notification to the specified endpoint regarding the processing order. It constructs a message containing relevant information such as product details, order ID, and notification date, and then sends it to the configured notification service endpoint.- Parameter:
order
- The processing order for which the notification is to be sent.- Gibt zurück:
- true if the notification is successfully sent; false otherwise.
-
getProcessingFacilities
@Transactional(isolation=REPEATABLE_READ) public List<ProcessingFacility> getProcessingFacilities(long id) Get the processing facility(-ies) processing the order At the moment there is normally only one facility to do so.- Parameter:
id
- The processing order ID- Gibt zurück:
- List of processinig facilities
-
setHasFailedJobSteps
@Transactional(isolation=REPEATABLE_READ) public void setHasFailedJobSteps(ProcessingOrder order, Boolean failed) Set the failed job steps flag in the order on failure- Parameter:
order
- the order to updatefailed
- indicates whether a job step has failed
-
logOrderState
Log the order state (currently a dummy method)- Parameter:
order
- The order for which to log the state
-
checkNextForRestart
public void checkNextForRestart()Look for next order in state PLANNING, RELEASING and SUSPENDING to restart. -
restartReleasingOrder
public void restartReleasingOrder(long id) Restart the thread corresponding to release the order with the given ID.- Parameter:
id
- The order ID
-
restartSuspendingOrder
public void restartSuspendingOrder(long id) Restart the thread corresponding to suspend the order with the given ID.- Parameter:
id
- The order ID
-