https://github.com/SCADA-LTS/Scada-LTS
[New Features] Adding description for datasource state
- Adding new datasource state and describing why it is disabled or enabled.
Issue: 718
We need this functionality because the datasource can be disabled not only by the user but also by other situations in the application:
- Disable or enable datasource.
- Import datasource.
- In script run functions: “enableDataSource(xid_ds)” “disableDataSource(xid_ds)”.
- Copy datasource.
- From API (wsdl not tested).
- When the datasource migrates.
Describe code:
Now, state pattern describe only a state of datasources but in future it will be used for other things. for eg. when HttpRetriver is disable (with stop option), the program will create a scheduler which tries to enable HttpRetriver.
We have six classes which set the status:
- MigrationOrErrorSerializeChangeEnableState
(In the new version of program, the datasource definition has been changed, resulting in on/off change of the datasource). - ScryptChangeEnableStateDs
(that datasource is turned off/on from script) - StopChangeEnableStateDs
(that datasource is stopped or it will be sleeping in future when the remote server is not available) - UserChangeEnableStateDs
(that datasource is changed by the user) - UserCpChangeEnableStateDs
(that datasource is changed by the user when a datasosurce copy has been made) - ApiChangeEnableStateDs
(that datasource is changed from API WDSL)
In order to skip using “SeroUtils.jar” library for newly created code, I created class ConfigLocalization.java.
It works as follow:
The description below will also demonstrate (test) if the task works as intended.
I created and enabled new datasource.
As seen, the user has changed the on/off status of datasource
I imported datasource
my github acount: https://github.com/grzesiekb
Changes will been introduced to the released version 0.0.9.8
https://github.com/SCADA-LTS/Scada-LTS/releases