9:54, EEST
Moderators
February 11, 2020
Hello,
At the moment, the Prosys OPC UA SDK for Java doesn’t provide built-in support for persisting the AddressSpace. If you wish to add Nodes to a Server during runtime and have them stored to memory so that they can be loaded to the AddressSpace when you restart the Server, you will need to implement your own NodeManager that handles storing them to disk. You can use NodeManagerUaNode as a starting point and override methods related to adding Nodes with versions that store the added Node to disk. You can handle loading Nodes from disk in the constructor of your NodeManager.
However, saving Nodes to disk won’t be easy as you would have to solve how to serialize UaNode interface in a way that preserves all the information contained by it and interfaces that extend it. You could use NodeSet2 XML files at OPC Foundation github (https://github.com/OPCFoundation/UA-Nodeset/tree/v1.04) as an example. They are used to model OPC UA information models in XML form and the Prosys OPC UA SDK for Java can use them to generate AddressSpaces when a Server is started. If you serialized your Nodes in a similar form, you should be able to load your stored Nodes when the Server is restarted.
BR,
Matti
13:03, EEST
February 4, 2021
14:25, EEST
Moderators
February 11, 2020
Hello,
The functionality for adding Nodes permanently to the AddressSpace by persisting the AddressSpace to disk in NodeSet2 XML format has not been added to the Prosys OPC UA SDK for Java.
But as a clarification, is the use of information models required? If the full capabilities of OPC UA information modelling are not required, then sufficient information on the Nodes could probably be persisted by using some custom XML or JSON format used by the Server application. Though, such format is not provided by the SDK either and would need to be designed by the developer of the Server application.
Do you have a specific use case where persisting Nodes would be required?
14:49, EEST
February 4, 2021
Hello,
Thank you. Yes, in our specific case, OPC-UA client create object dynamically in a folder (add node to the address space of OPC-UA server).
In case of a crash or a shutdown of the OPC-UA server, we need to load theses objects at startup time.
Thank you,
PS: I’m agree with your proposal but I hope such a functionnality “sufficient information on the Nodes could probably be persisted by using some custom XML or JSON format used by the Server application” will exist in the sdk.
15:33, EEST
Moderators
February 11, 2020
Hello,
The definition of “sufficient information” depends on your application, which makes defining that outside the scope of the SDK. At SDK level, it would only make sense to persist all information, but at the moment such feature is not planned. Therefore, you will need to define what information you need to persist and how to persist it by yourself.
Can you be on more specific on what types of Nodes Clients are adding and what those Nodes are used for by the Server and possibly other Client applications?
15:38, EEST
April 3, 2012
Hi,
I’ll note this, it might not be enough, but might be of help. IF you subtype NodeManagerUaNode and have that as the manager of the namespace, you can override
By default that delegates to the NodeBuilder of the manager. This implementation should be kept (i.e. delegate to super; as the current AddNodes defines full instances shall be created by the server), but you can use the override to record that the node was added, then upon a restart you could re-create it.
16:59, EEST
February 4, 2021
@Bjarne Boström : Tanks for the help.
@Matti Siponen : it is a specific object type to register functional properties (hasProperty/Variable/PropertyType with “simple” scalar data type) and one hasComponent relation on “simple” custom Object DataType. This object represents an operation with a simple lifecycle (the lifecycle is not managed by the OPC-UA server).
The created object is updated by other OPC-UA client (change “simple” properties).
As you said, I need to contact my client to understand what is important to restore in case of reboot.
Thank you
Most Users Ever Online: 1919
Currently Online:
12 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Heikki Tahvanainen: 402
hbrackel: 144
rocket science: 88
pramanj: 86
Francesco Zambon: 83
Ibrahim: 78
Sabari: 62
kapsl: 57
gjevremovic: 49
Xavier: 43
Member Stats:
Guest Posters: 0
Members: 735
Moderators: 7
Admins: 1
Forum Stats:
Groups: 3
Forums: 15
Topics: 1523
Posts: 6449
Newest Members:
rust, christamcdowall, redaahern07571, nigelbdhmp, travistimmons, AnnelCib, dalenegettinger, howardkennerley, Thomassnism, biancacraft16Moderators: Jouni Aro: 1026, Pyry: 1, Petri: 0, Bjarne Boström: 1026, Jimmy Ni: 26, Matti Siponen: 346, Lusetti: 0
Administrators: admin: 1