Currently, the pipeline statusses are mostly managed inside the LdioInput components, which is not a good practice for several reasons.
Responsibilities are now mixed: the input component has now not only deal with their main purpose, which is handling the input, but also with dealing with the whole pipeline status
The invocation of the start method is not consistent, in some of the sub classes, this happens inside the constructor and in other sub classes, this happens inside the autoconfigurator
Bullet point 2 also introduces a minor (logging) bug. The pipeline status management tools are not completely caught up with the initalization of the pipeline and they already have to deal with pipeline status changes, which results in false error loggig:
2024-04-30T08:45:16.185+02:00 WARN 36368 --- [nio-8888-exec-1] b.v.i.l.l.s.PipelineStatusService : Non initialized pipeline received status update: my-new-status-pipeline
Proposed solution
Implementation of the status design pattern:
Create a class that keeps a reference to all the ldio components, or maybe only the status components
This class also keeps track of the current PipelineStatus
The PipelineStatus is not an Enum anymore, but an interface with several implemenations (RunningStatus/HaltedStatus/StoppedStatus/...), each of the implementations has its own logic what to do with the ldio (status) components (e.g. call pause(), start(), resume())
The first mentioned class should be created in the PipelineCreatorService, and the status of the pipeline should here already be updated or set to "start", which should resolve the mentioned minor bug
Other ideas are certainly welcome and maybe extra disscussion with the devs is required
The issue
Currently, the pipeline statusses are mostly managed inside the LdioInput components, which is not a good practice for several reasons.
start
method is not consistent, in some of the sub classes, this happens inside the constructor and in other sub classes, this happens inside the autoconfiguratorProposed solution
Implementation of the status design pattern:
pause()
,start()
,resume()
)Other ideas are certainly welcome and maybe extra disscussion with the devs is required