create account

Adding description for datasource state [develop Scada-LTS] by grzesiekb

View this thread on: hive.blogpeakd.comecency.com
· @grzesiekb · (edited)
$1.51
Adding description for datasource state [develop Scada-LTS]
#### 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](https://github.com/SCADA-LTS/Scada-LTS/issues/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:

1. MigrationOrErrorSerializeChangeEnableState
(In the new version of program, the datasource definition has been changed, resulting in on/off change of the datasource).
2. ScryptChangeEnableStateDs
(that datasource is turned off/on from script)
3. StopChangeEnableStateDs
(that datasource is stopped or it will be sleeping in future when the remote server is not available)
4. UserChangeEnableStateDs
(that datasource is changed by the user)
5. UserCpChangeEnableStateDs
(that datasource is changed by the user when a datasosurce copy has been made)
6. 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.

![1-test.png](https://ipfs.busy.org/ipfs/QmazEMdwLPhyzdQRMdezT5qwsXXbAezcXTjKenWRbqfuKm)
![2-test_start.png](https://ipfs.busy.org/ipfs/QmPiEJV8awKdQrL8i6ajnNF27jr8FVvLLjv79m3KAccVY1)

As seen,  the user has changed the on/off status of datasource

##### I imported datasource

![3.png](https://ipfs.busy.org/ipfs/QmZjzpsmYqrmCu5t9K8rRBsN87XaPFteoRQoQjWzc9gpdR)

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

#### Pull request:
https://github.com/SCADA-LTS/Scada-LTS/pull/722
👍  , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , and 44 others
properties (23)
authorgrzesiekb
permlinkadding-description-for-datasource-state-develop-scada-lts-1540663771590
categoryutopian-io
json_metadata{"app":"steemit/0.1","format":"markdown","image":["https://ipfs.busy.org/ipfs/QmazEMdwLPhyzdQRMdezT5qwsXXbAezcXTjKenWRbqfuKm","https://ipfs.busy.org/ipfs/QmPiEJV8awKdQrL8i6ajnNF27jr8FVvLLjv79m3KAccVY1","https://ipfs.busy.org/ipfs/QmZjzpsmYqrmCu5t9K8rRBsN87XaPFteoRQoQjWzc9gpdR"],"tags":["utopian-io","development","scada-lts","java"],"links":["https://github.com/SCADA-LTS/Scada-LTS","https://github.com/SCADA-LTS/Scada-LTS/issues/718","https://github.com/grzesiekb","https://github.com/SCADA-LTS/Scada-LTS/releases","https://github.com/SCADA-LTS/Scada-LTS/pull/722"],"community":"scadalts"}
created2018-10-27 18:09:33
last_update2018-10-28 04:30:45
depth0
children11
last_payout2018-11-03 18:09:33
cashout_time1969-12-31 23:59:59
total_payout_value1.183 HBD
curator_payout_value0.326 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length2,381
author_reputation2,800,305,353,550
root_title"Adding description for datasource state [develop Scada-LTS]"
beneficiaries
0.
accountutopian.pay
weight500
max_accepted_payout100,000.000 HBD
percent_hbd10,000
post_id74,168,392
net_rshares1,396,544,581,910
author_curate_reward""
vote details (108)
@codingdefined ·
$10.09
Thank you for your contribution. A nice update to the project. Is there a possibility of optimizing the code from [line](https://github.com/SCADA-LTS/Scada-LTS/pull/722/files#diff-7557fd02b17608cb75279feb36031378R552), like most of the lines for, ver == 1 and ver == 2 are same so if you can create a function having common lines and call for both if and else if?

----

Your contribution has been evaluated according to [Utopian policies and guidelines](https://join.utopian.io/guidelines), as well as a predefined set of questions pertaining to the category.

To view those questions and the relevant answers related to your post, [click here](https://review.utopian.io/result/3/2331222).

---- 
Need help? Write a ticket on https://support.utopian.io/. 
Chat with us on [Discord](https://discord.gg/uTyJkNm). 
[[utopian-moderator]](https://join.utopian.io/)
👍  , , , , , , , , , , , ,
properties (23)
authorcodingdefined
permlinkre-grzesiekb-adding-description-for-datasource-state-develop-scada-lts-1540663771590-20181029t102557431z
categoryutopian-io
json_metadata{"tags":["utopian-io"],"links":["https://github.com/SCADA-LTS/Scada-LTS/pull/722/files#diff-7557fd02b17608cb75279feb36031378R552","https://join.utopian.io/guidelines","https://review.utopian.io/result/3/2331222","https://support.utopian.io/","https://discord.gg/uTyJkNm","https://join.utopian.io/"],"app":"steemit/0.1"}
created2018-10-29 10:25:57
last_update2018-10-29 10:25:57
depth1
children2
last_payout2018-11-05 10:25:57
cashout_time1969-12-31 23:59:59
total_payout_value7.644 HBD
curator_payout_value2.447 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length860
author_reputation533,274,036,397,313
root_title"Adding description for datasource state [develop Scada-LTS]"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id74,266,526
net_rshares8,656,841,893,443
author_curate_reward""
vote details (13)
@grzesiekb · (edited)
This is not my code "ver == 1" and "ver == 2". I do not use magic numbers in the code.
In my opinion instead of optimizing, this should be rewritten because such versioning of serialized objects doesn't make sense.
properties (22)
authorgrzesiekb
permlinkre-codingdefined-re-grzesiekb-adding-description-for-datasource-state-develop-scada-lts-1540663771590-20181029t115445380z
categoryutopian-io
json_metadata{"tags":["utopian-io"],"app":"steemit/0.1"}
created2018-10-29 11:54:45
last_update2018-10-29 19:20:45
depth2
children0
last_payout2018-11-05 11:54:45
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length214
author_reputation2,800,305,353,550
root_title"Adding description for datasource state [develop Scada-LTS]"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id74,271,068
net_rshares0
@utopian-io ·
Thank you for your review, @codingdefined! Keep up the good work!
properties (22)
authorutopian-io
permlinkre-re-grzesiekb-adding-description-for-datasource-state-develop-scada-lts-1540663771590-20181029t102557431z-20181102t032022z
categoryutopian-io
json_metadata"{"app": "beem/0.20.9"}"
created2018-11-02 03:20:24
last_update2018-11-02 03:20:24
depth2
children0
last_payout2018-11-09 03:20:24
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length65
author_reputation152,955,367,999,756
root_title"Adding description for datasource state [develop Scada-LTS]"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id74,516,677
net_rshares0
@crypto.piotr ·
hi @grzesiekb

just bumped into your profile. did you abandon Steemit already? 

yours
Piotr
properties (22)
authorcrypto.piotr
permlinkre-grzesiekb-adding-description-for-datasource-state-develop-scada-lts-1540663771590-20181203t080949799z
categoryutopian-io
json_metadata{"tags":["utopian-io"],"users":["grzesiekb"],"app":"steemit/0.1"}
created2018-12-03 08:10:30
last_update2018-12-03 08:10:30
depth1
children2
last_payout2018-12-10 08:10:30
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length92
author_reputation27,396,789,428,606
root_title"Adding description for datasource state [develop Scada-LTS]"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id76,281,866
net_rshares0
@grzesiekb ·
Recently, I have a lot of work :)
👍  
properties (23)
authorgrzesiekb
permlinkre-cryptopiotr-re-grzesiekb-adding-description-for-datasource-state-develop-scada-lts-1540663771590-20181207t162840105z
categoryutopian-io
json_metadata{"tags":["utopian-io"],"app":"steemit/0.1"}
created2018-12-07 16:28:39
last_update2018-12-07 16:28:39
depth2
children1
last_payout2018-12-14 16:28:39
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length33
author_reputation2,800,305,353,550
root_title"Adding description for datasource state [develop Scada-LTS]"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id76,505,382
net_rshares12,557,088,099
author_curate_reward""
vote details (1)
@crypto.piotr ·
Rozumiem @grzesiekb
properties (22)
authorcrypto.piotr
permlinkre-grzesiekb-re-cryptopiotr-re-grzesiekb-adding-description-for-datasource-state-develop-scada-lts-1540663771590-20181209t144608989z
categoryutopian-io
json_metadata{"tags":["utopian-io"],"users":["grzesiekb"],"app":"steemit/0.1"}
created2018-12-09 14:46:12
last_update2018-12-09 14:46:12
depth3
children0
last_payout2018-12-16 14:46:12
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length19
author_reputation27,396,789,428,606
root_title"Adding description for datasource state [develop Scada-LTS]"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id76,590,950
net_rshares0
@partiko ·
Hello @grzesiekb! This is a friendly reminder that a Partiko user has just followed you! Congratulations!

To get realtime push notification on your phone about new followers in the future, download and login Partiko using the link below. You will also get 3000 Partiko Points for free, and Partiko Points can be converted into Steem token!

https://partiko.app/referral/partiko
👎  
properties (23)
authorpartiko
permlinkpartiko-re-grzesiekb-adding-description-for-datasource-state-develop-scada-lts-1540663771590-20190226t212048826z
categoryutopian-io
json_metadata{"app":"partiko"}
created2019-02-26 21:20:48
last_update2019-02-26 21:20:48
depth1
children0
last_payout2019-03-05 21:20:48
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length378
author_reputation39,207,160,334,751
root_title"Adding description for datasource state [develop Scada-LTS]"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id80,459,534
net_rshares-2,565,994,123
author_curate_reward""
vote details (1)
@partiko ·
Hello @grzesiekb! This is a friendly reminder that a Partiko user has just followed you! Congratulations!

To get realtime push notification on your phone about new followers in the future, download and login Partiko using the link below. You will also get 3000 Partiko Points for free, and Partiko Points can be converted into Steem token!

https://partiko.app/referral/partiko
properties (22)
authorpartiko
permlinkpartiko-re-grzesiekb-adding-description-for-datasource-state-develop-scada-lts-1540663771590-20190227t021024623z
categoryutopian-io
json_metadata{"app":"partiko"}
created2019-02-27 02:10:24
last_update2019-02-27 02:10:24
depth1
children0
last_payout2019-03-06 02:10:24
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length378
author_reputation39,207,160,334,751
root_title"Adding description for datasource state [develop Scada-LTS]"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id80,468,588
net_rshares0
@steem-ua ·
#### Hi @grzesiekb!

Your post was upvoted by @steem-ua, new Steem dApp, using UserAuthority for algorithmic post curation!
Your post is eligible for our upvote, thanks to our collaboration with @utopian-io!
**Feel free to join our [@steem-ua Discord server](https://discord.gg/KpBNYGz)**
properties (22)
authorsteem-ua
permlinkre-adding-description-for-datasource-state-develop-scada-lts-1540663771590-20181029t110023z
categoryutopian-io
json_metadata"{"app": "beem/0.20.7"}"
created2018-10-29 11:00:24
last_update2018-10-29 11:00:24
depth1
children0
last_payout2018-11-05 11:00:24
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length288
author_reputation23,214,230,978,060
root_title"Adding description for datasource state [develop Scada-LTS]"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id74,268,235
net_rshares0
@steemitboard ·
Congratulations @grzesiekb! You have completed the following achievement on the Steem blockchain and have been rewarded with new badge(s) :

<table><tr><td>https://steemitimages.com/60x70/http://steemitboard.com/@grzesiekb/voted.png?201810272309</td><td>You received more than 500 upvotes. Your next target is to reach 1000 upvotes.</td></tr>
</table>

<sub>_[Click here to view your Board of Honor](https://steemitboard.com/@grzesiekb)_</sub>
<sub>_If you no longer want to receive notifications, reply to this comment with the word_ `STOP`</sub>



**Do not miss the last post from @steemitboard:**
<table><tr><td><a href="https://steemit.com/halloween/@steemitboard/trick-or-treat-publish-your-scariest-halloweeen-story-and-win-a-new-badge"><img src="https://steemitimages.com/64x128/http://i.cubeupload.com/RUyB3u.png"></a></td><td><a href="https://steemit.com/halloween/@steemitboard/trick-or-treat-publish-your-scariest-halloweeen-story-and-win-a-new-badge">Trick or Treat - Publish your scariest halloween story and win a new badge</a></td></tr><tr><td><a href="https://steemit.com/steemitboard/@steemitboard/steemitboard-notifications-improved"><img src="https://steemitimages.com/64x128/http://i.cubeupload.com/NgygYH.png"></a></td><td><a href="https://steemit.com/steemitboard/@steemitboard/steemitboard-notifications-improved">SteemitBoard notifications improved</a></td></tr></table>

> Support [SteemitBoard's project](https://steemit.com/@steemitboard)! **[Vote for its witness](https://v2.steemconnect.com/sign/account-witness-vote?witness=steemitboard&approve=1)** and **get one more award**!
properties (22)
authorsteemitboard
permlinksteemitboard-notify-grzesiekb-20181028t014732000z
categoryutopian-io
json_metadata{"image":["https://steemitboard.com/img/notify.png"]}
created2018-10-28 01:47:30
last_update2018-10-28 01:47:30
depth1
children0
last_payout2018-11-04 01:47:30
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length1,608
author_reputation38,975,615,169,260
root_title"Adding description for datasource state [develop Scada-LTS]"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id74,184,693
net_rshares0
@steemitboard ·
Congratulations @grzesiekb! You received a personal award!

<table><tr><td>https://steemitimages.com/70x70/http://steemitboard.com/@grzesiekb/birthday1.png</td><td>1 Year on Steemit</td></tr></table>

<sub>_[Click here to view your Board of Honor](https://steemitboard.com/@grzesiekb)_</sub>


> Support [SteemitBoard's project](https://steemit.com/@steemitboard)! **[Vote for its witness](https://v2.steemconnect.com/sign/account-witness-vote?witness=steemitboard&approve=1)** and **get one more award**!
properties (22)
authorsteemitboard
permlinksteemitboard-notify-grzesiekb-20181212t191606000z
categoryutopian-io
json_metadata{"image":["https://steemitboard.com/img/notify.png"]}
created2018-12-12 19:16:06
last_update2018-12-12 19:16:06
depth1
children0
last_payout2018-12-19 19:16:06
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length505
author_reputation38,975,615,169,260
root_title"Adding description for datasource state [develop Scada-LTS]"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id76,750,608
net_rshares0