Klasse OrderUtil

java.lang.Object
de.dlr.proseo.planner.util.OrderUtil

@Component public class OrderUtil extends Object
Handle processing orders
Autor:
Ernst Melchinger
  • Felddetails

    • config

      Planner configuration
    • rtb

      @Autowired org.springframework.boot.web.client.RestTemplateBuilder rtb
      REST 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

      public PlannerResultMessage reset(ProcessingOrder order)
      Reset the processing order and it jobs and job steps.
      Parameter:
      order - The processing order
      Gibt zurück:
      Result message
    • delete

      @Transactional(isolation=REPEATABLE_READ) public PlannerResultMessage delete(ProcessingOrder order)
      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

      public PlannerResultMessage plan(long id, Long facilityId, Boolean wait)
      Plan the processing order and it jobs and job steps.
      Parameter:
      id - The processing order ID
      facilityId - The database ID of the processing facility to run the order
      wait - indicates whether to wait for the order planning to complete
      Gibt zurück:
      Result message
    • resume

      public PlannerResultMessage resume(ProcessingOrder order, Boolean wait, String user, String pw)
      Resume the processing order and it jobs and job steps.
      Parameter:
      order - The processing order
      wait - indicates whether to wait for the order releasing to complete
      user - 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

      public PlannerResultMessage suspend(long id, Boolean force)
      Suspend the processing order and its jobs and job steps.
      Parameter:
      id - The processing order ID
      force - The flag to force kill of currently running job steps on processing facility
      Gibt zurück:
      Result message
    • prepareSuspend

      public PlannerResultMessage prepareSuspend(long id, Boolean force)
      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 ID
      force - The flag to force kill of currently running job steps on processing facility
      Gibt zurück:
      Result message
    • retry

      @Transactional(isolation=REPEATABLE_READ) public PlannerResultMessage retry(ProcessingOrder order)
      Retry the processing order and it jobs and job steps.
      Parameter:
      order - The processing order
      Gibt zurück:
      Result message
    • close

      public PlannerResultMessage close(Long orderId)
      Close the processing order and it jobs and job steps.
      Parameter:
      orderId - The processing order ID
      Gibt zurück:
      Result message
    • checkFinish

      public Boolean checkFinish(Long orderId)
      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

      @Transactional(isolation=REPEATABLE_READ) public Boolean 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.
      Parameter:
      order - The processing order
      Gibt zurück:
      true if closed
    • setTimes

      @Transactional(isolation=REPEATABLE_READ) public void setTimes(ProcessingOrder order)
      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

      public void setOrderHistory(ProcessingOrder order)
      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

      @Transactional(isolation=REPEATABLE_READ) public Boolean sendNotification(ProcessingOrder order)
      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 update
      failed - indicates whether a job step has failed
    • logOrderState

      public void logOrderState(ProcessingOrder order)
      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