Package de.dlr.proseo.planner.dispatcher
Klasse OrderDispatcher
java.lang.Object
de.dlr.proseo.planner.dispatcher.OrderDispatcher
Dispatcher to handle processing orders
- Autor:
- Ernst Melchinger
-
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungChecks if the given order is valid, i.e. has a mission and requested product classescreateJobForOrbitOrTime
(ProcessingOrder order, Orbit orbit, Instant startTime, Instant stopTime, ProcessingFacility pf) Create a job for an order based on the provided orbit or start/stop time of a slice.createJobsForDay
(ProcessingOrder order, ProcessingFacility facility, OrderPlanThread thread) Create the necessary jobs for an order of order slicing type type CALENDER_DAY.createJobsForMonth
(ProcessingOrder order, ProcessingFacility facility, OrderPlanThread thread) Create the necessary jobs for an order of order slicing type type CALENDER_MONTH.createJobsForOrbit
(ProcessingOrder order, ProcessingFacility processingFacility, OrderPlanThread thread) Create the necessary jobs for an order of order slicing type ORBIT.createJobsForTimeSlices
(ProcessingOrder order, ProcessingFacility facility, OrderPlanThread thread) Create the necessary jobs for an order of order slicing type type TIME_SLICE.createJobsForYear
(ProcessingOrder order, ProcessingFacility pf, OrderPlanThread thread) Create the necessary jobs for an order of order slicing type type CALENDER_YEAR.createJobSteps
(long orderId, ProcessingFacility facility, ProductionPlanner productionPlanner, OrderPlanThread thread) Create the job steps for each job of the processing order.createProduct
(ProductClass productClass, Product enclosingProduct, ConfiguredProcessor configuredProcessor, Orbit orbit, Job job, JobStep jobStep, String fileClass, Instant startTime, Instant stopTime) Helper function to create a single product.createProducts
(ProductClass productClass, Product enclosingProduct, ConfiguredProcessor configuredProcessor, Orbit orbit, Job job, JobStep jobStep, String fileClass, Instant startTime, Instant stopTime, List<Product> products) Helper function to create the products of a "product tree".createSingleJob
(ProcessingOrder order, ProcessingFacility facility) Create the needed job for an order without slicinggetAllComponentClasses
(ProductClass productClass) Find all descendant product classes of the given product class.getTopProductClassWithPC
(ProductClass productClass) Find the topmost product class.prepareExpectedJobs
(long orderId, ProcessingFacility processingFacility, OrderPlanThread thread) Publish an order, create jobs and job steps needed to create all products
-
Konstruktordetails
-
OrderDispatcher
public OrderDispatcher()
-
-
Methodendetails
-
prepareExpectedJobs
public PlannerResultMessage prepareExpectedJobs(long orderId, ProcessingFacility processingFacility, OrderPlanThread thread) throws InterruptedException Publish an order, create jobs and job steps needed to create all products- Parameter:
orderId
- The processing order idprocessingFacility
- The processing facilitythread
- The OrderPlanThread- Gibt zurück:
- The PlannerResultMessage indicating the result of the operation. False if no order with the given id was found.
- Löst aus:
InterruptedException
- if the execution is interrupted
-
checkForValidOrder
Checks if the given order is valid, i.e. has a mission and requested product classes- Parameter:
order
- The processing order to check.- Gibt zurück:
- A PlannerResultMessage indicating the validity of the order.
-
createJobsForOrbit
public PlannerResultMessage createJobsForOrbit(ProcessingOrder order, ProcessingFacility processingFacility, OrderPlanThread thread) throws InterruptedException Create the necessary jobs for an order of order slicing type ORBIT.- Parameter:
order
- The processing order.processingFacility
- The processing facility.thread
- The order plan thread to handle interrupts.- Gibt zurück:
- The result message detailing if the jobs were created successfully or what type of error occurred.
- Löst aus:
InterruptedException
- if the execution is interrupted.
-
createJobsForDay
public PlannerResultMessage createJobsForDay(ProcessingOrder order, ProcessingFacility facility, OrderPlanThread thread) throws InterruptedException Create the necessary jobs for an order of order slicing type type CALENDER_DAY.- Parameter:
order
- The processing order.facility
- The processing facility.thread
- The order plan thread to handle interrupts.- Gibt zurück:
- The result message detailing if the jobs were created successfully or what type of error occurred.
- Löst aus:
InterruptedException
- if the execution is interrupted.
-
createJobsForMonth
public PlannerResultMessage createJobsForMonth(ProcessingOrder order, ProcessingFacility facility, OrderPlanThread thread) throws InterruptedException Create the necessary jobs for an order of order slicing type type CALENDER_MONTH.- Parameter:
order
- The processing order.facility
- The processing facility.thread
- The order plan thread to handle interrupts.- Gibt zurück:
- The result message detailing if the jobs were created successfully or what type of error occurred.
- Löst aus:
InterruptedException
- if the execution is interrupted.
-
createJobsForYear
public PlannerResultMessage createJobsForYear(ProcessingOrder order, ProcessingFacility pf, OrderPlanThread thread) throws InterruptedException Create the necessary jobs for an order of order slicing type type CALENDER_YEAR.- Parameter:
order
- The processing order.thread
- The order plan thread to handle interrupts.facility
- The processing facility.- Gibt zurück:
- The result message detailing if the jobs were created successfully or what type of error occurred.
- Löst aus:
InterruptedException
- if the execution is interrupted.
-
createJobsForTimeSlices
public PlannerResultMessage createJobsForTimeSlices(ProcessingOrder order, ProcessingFacility facility, OrderPlanThread thread) throws InterruptedException Create the necessary jobs for an order of order slicing type type TIME_SLICE.- Parameter:
order
- The processing order.facility
- The processing facility.thread
- The order plan thread to handle interrupts.- Gibt zurück:
- The result message detailing if the jobs were created successfully or what type of error occurred.
- Löst aus:
InterruptedException
- if the execution is interrupted.
-
createSingleJob
Create the needed job for an order without slicing- Parameter:
order
- The processing order.facility
- The processing facility.- Gibt zurück:
- The result message detailing if the jobs were created successfully or what type of error occurred.
-
createJobForOrbitOrTime
public PlannerResultMessage createJobForOrbitOrTime(ProcessingOrder order, Orbit orbit, Instant startTime, Instant stopTime, ProcessingFacility pf) Create a job for an order based on the provided orbit or start/stop time of a slice.- Parameter:
order
- The processing order.orbit
- The orbit (can be null if start/stop time is provided).startTime
- The start time of the slice (can be null if orbit is provided).stopTime
- The stop time of the slice (can be null if orbit is provided).pf
- The processing facility to run the job.- Gibt zurück:
- The result message indicating the success (or cause for failure) of job creation.
-
createJobSteps
public PlannerResultMessage createJobSteps(long orderId, ProcessingFacility facility, ProductionPlanner productionPlanner, OrderPlanThread thread) throws InterruptedException Create the job steps for each job of the processing order.- Parameter:
orderId
- The ID of the processing order.facility
- The processing facility.productionPlanner
- The production planner instance.thread
- The order plan thread to handle interrupts.- Gibt zurück:
- The result message indicating the success (or the cause of failure) of creating job steps.
- Löst aus:
InterruptedException
- if the execution is interrupted.
-
getTopProductClassWithPC
Find the topmost product class.- Parameter:
productClass
- The current product class.- Gibt zurück:
- The topmost product class.
-
getAllComponentClasses
Find all descendant product classes of the given product class.- Parameter:
productClass
- The current product class.- Gibt zurück:
- The list of descendant product classes of pc.
-
createProducts
public Product createProducts(ProductClass productClass, Product enclosingProduct, ConfiguredProcessor configuredProcessor, Orbit orbit, Job job, JobStep jobStep, String fileClass, Instant startTime, Instant stopTime, List<Product> products) Helper function to create the products of a "product tree".- Parameter:
productClass
- The current product class.enclosingProduct
- The enclosing product.configuredProcessor
- The configured processor.orbit
- The orbit.job
- The job.jobStep
- The job step.fileClass
- The file class as string.startTime
- The start time.stopTime
- The stop time.products
- List to collect all products created.- Gibt zurück:
- The current created product.
-
createProduct
public Product createProduct(ProductClass productClass, Product enclosingProduct, ConfiguredProcessor configuredProcessor, Orbit orbit, Job job, JobStep jobStep, String fileClass, Instant startTime, Instant stopTime) Helper function to create a single product.- Parameter:
productClass
- The current product class.enclosingProduct
- The enclosing product.configuredProcessor
- The configured processor.orbit
- The orbit.job
- The job.jobStep
- The job step.fileClass
- The file class as string.startTime
- The start time.stopTime
- The stop time.- Gibt zurück:
- The current created product.
-