Package de.dlr.proseo.planner
Class ProductionPlanner
java.lang.Object
de.dlr.proseo.planner.ProductionPlanner
- All Implemented Interfaces:
org.springframework.boot.CommandLineRunner
@SpringBootApplication
@EnableConfigurationProperties
@ComponentScan(basePackages="de.dlr.proseo")
@EnableJpaRepositories("de.dlr.proseo.model.dao")
public class ProductionPlanner
extends Object
implements org.springframework.boot.CommandLineRunner
prosEO planner application
- Author:
- Ernst Melchinger
-
Field Summary
FieldsModifier and TypeFieldDescriptionThe static production planner configurationstatic Stringstatic Stringstatic final Stringstatic final Stringstatic String(package private) ProductionPlannerConfigurationThe instance production planner configurationstatic Stringstatic ProductionPlannerThe production planner instancestatic String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidChecks for the next order to restart.Gets the authentication details of an order (username and password).jakarta.persistence.EntityManagergetEm()Gets the entity manager.Gets the finishThreads map.getKubeConfig(String name) Gets the KubeConfig instance by name.Gets all connected KubeConfig instances.Gets the planningOrders list.Gets the planThreads map.Gets the releaseThreads map.Gets the releasingOrders list.Gets the suspendingOrders list.org.springframework.transaction.PlatformTransactionManagerGets the transaction manger.static voidMain method to start the application.voidRuns the application, initializing necessary configurations and components.voidStarts the Kubernetes dispatcher thread.voidStops the Kubernetes dispatcher thread.voidupdateAuth(Long orderId, String user, String pw) Updates authentication details for an order).updateKubeConfig(String facilityName) Attempts to connect to a processing facility.voidWalk through ProcessingFacility list of DB and try to connect each.
-
Field Details
-
jobNamePrefix
- See Also:
-
jobContainerPrefix
- See Also:
-
hostName
-
hostIP
-
port
-
PLAN_THREAD_PREFIX
-
RELEASE_THREAD_PREFIX
-
config
The static production planner configuration -
productionPlanner
The production planner instance -
plannerConfig
The instance production planner configuration
-
-
Constructor Details
-
ProductionPlanner
public ProductionPlanner()
-
-
Method Details
-
getFinishThreads
Gets the finishThreads map.- Returns:
- The map of finishing threads.
-
getSuspendingOrders
Gets the suspendingOrders list.- Returns:
- The list of suspending orders.
-
getReleasingOrders
Gets the releasingOrders list.- Returns:
- The list of releasing orders.
-
getPlanningOrders
Gets the planningOrders list.- Returns:
- The list of planning orders.
-
getPlanThreads
Gets the planThreads map.- Returns:
- The map of planning threads.
-
getReleaseThreads
Gets the releaseThreads map.- Returns:
- The map of release threads.
-
getTxManager
public org.springframework.transaction.PlatformTransactionManager getTxManager()Gets the transaction manger.- Returns:
- The PlatformTransactionManager instance.
-
getEm
public jakarta.persistence.EntityManager getEm()Gets the entity manager.- Returns:
- The EntityManager instance.
-
getAuth
Gets the authentication details of an order (username and password).- Parameters:
orderId- The ID of the order.- Returns:
- The authentication details.
-
updateAuth
Updates authentication details for an order).- Parameters:
orderId- The ID of the order.user- The username.pw- The password.
-
getKubeConfig
Gets the KubeConfig instance by name.- Parameters:
name- The name of the KubeConfig instance (may be null).- Returns:
- The KubeConfig instance.
-
getKubeConfigs
Gets all connected KubeConfig instances.- Returns:
- Collection of KubeConfig instances.
-
main
Main method to start the application.- Parameters:
args- Command line arguments.- Throws:
Exception- Exception if an error occurs.
-
updateKubeConfigs
@Transactional(isolation=REPEATABLE_READ, readOnly=true) public void updateKubeConfigs()Walk through ProcessingFacility list of DB and try to connect each. Disconnect and remove KubeConfigs not defined in this list. -
updateKubeConfig
@Transactional(isolation=REPEATABLE_READ, readOnly=true) public KubeConfig updateKubeConfig(String facilityName) Attempts to connect to a processing facility. Adds a new Kubernetes configuration for the previously not connected facility, removes Kubernetes configuration for a facility to which a connection is not possible.- Parameters:
facilityName- the name of the processing facility to connect- Returns:
- the KubeConfig object for this processing facility, or null, if the facility is not connected
-
checkNextForRestart
public void checkNextForRestart()Checks for the next order to restart. -
run
Runs the application, initializing necessary configurations and components.- Specified by:
runin interfaceorg.springframework.boot.CommandLineRunner- Parameters:
arg0- Command line arguments.- Throws:
Exception- If an error occurs during execution.- See Also:
-
startDispatcher
public void startDispatcher()Starts the Kubernetes dispatcher thread. -
stopDispatcher
public void stopDispatcher()Stops the Kubernetes dispatcher thread.
-