

14:44, EET

February 4, 2015

I am working on an aggregating server, where I have multiple nodemanagers (NodeManagerUaNode) on the same server, each handling its own namespace. I have a situation where at certain times I need to delete all nodes with a certain namespaceindex from the server (i.e all nodes handled by a certain nodemanager). What would be the most direct way to do this?
I tried clearing the NodeMap for the specified nodemanager by calling this.getNodes().clear() (I admit I do not know the actual function of this map). This seemed to delete all the nodes I wanted to delete, or at least they disappeared from UaExpert. But after I have called this, I cannot seem use the nodemanager to add nodes anymore. I get no errors when adding nodes with the same manager, but none of them show up on any client.
15:44, EET

December 21, 2011

8:33, EET

February 4, 2015

Can you clarify your question a bit? What do you mean by “the root of my nodes”? The nodes I wish to delete can be found at separate places in the address space, and as far as I know, I haven’t done anything with NodeManagerRoot (the initial address space is created automatically since I’m using the SampleConsoleServer from the SDK as a basis for my server). Do you mean that there is some reference between NodeManagerRoot and each created NodeManagerUaNode that gets deleted when I call getNodes().clear()? If so, how can I reinstate it?
14:34, EET

December 21, 2011

I mean in general: if you remove nodes from the address space, I suppose, you are also removing all references to them. And also if you add references, you will then add new references, so that you can access them.
If you just clear the NodeMap, you will get rid of the node objects, but the references will stay – so when you add new nodes, the references will not change to point to the new nodes and you cannot then find them by browsing.
I must admit that I do not know for certain what happens if you do like you have done.
11:43, EET

February 4, 2015

Ok, that makes sense, thank you for you reply. So I guess there is no easy way to delete nodes by a certain namespaceindex and then be able to add them again? I ended up just straightforwardly browsing through the address space while checking the namespaceindex of every node and deleting the correct ones including their references. Seems to be fast enough, since this operation doesn’t need to be run that often.
Most Users Ever Online: 1919
Currently Online:
22 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Heikki Tahvanainen: 402
hbrackel: 144
rocket science: 90
pramanj: 86
Francesco Zambon: 83
Ibrahim: 78
Sabari: 62
kapsl: 57
gjevremovic: 49
Xavier: 43
Member Stats:
Guest Posters: 0
Members: 811
Moderators: 7
Admins: 1
Forum Stats:
Groups: 3
Forums: 15
Topics: 1541
Posts: 6504
Newest Members:
Curtisidiob, Henrybal, vincent.lin1970@gmail.com, JamesLiabe, DanielMaype, RobertPrire, VirCibre, semunah, StevenMot, elinorbalke7872Moderators: Jouni Aro: 1029, Pyry: 1, Petri: 0, Bjarne Boström: 1040, Jimmy Ni: 26, Matti Siponen: 353, Lusetti: 0
Administrators: admin: 1