milo icon indicating copy to clipboard operation
milo copied to clipboard

How can I get the NodeManger from the OpcUaServer

Open 0DennisLee0 opened this issue 6 years ago • 3 comments

I am trying to add the namespace to the server, and I found these codes in the https://github.com/kevinherron/pi-server

server.getNamespaceManager().registerAndAdd( PiNamespace.NAMESPACE_URI, (namespaceIndex) -> new PiNamespace(this, namespaceIndex)); And I found a way to get the new namespace. There is a function in the PiNamespace in https://github.com/kevinherron/pi-server

public UaNodeManager getNodeManager() { return server.getServer().getNodeManager(); } and it shows that the server should have the function getNodeManager(). The server node is the instance of OpcUaServer, but I am sorrow to find there is no getNodeManager() function.

How can I do to add a self-defined namespace to the server?

Many Thanks!

0DennisLee0 avatar Feb 19 '20 14:02 0DennisLee0

I found the new way to set up the Server's Namespace ExampleNamespace exampleNamespace = new ExampleNamespace(server); exampleNamespace.startup(); is that mean, if I have another namespace to register. I need to de ExampleNamespace exampleNamespace = new ExampleNamespace(server); exampleNamespace.startup(); AnotherNamespace anoterNamespace = new AnotherNamespace(server); anoterNamespace.startup(); Can I use this way to start a new namespace?

0DennisLee0 avatar Feb 19 '20 15:02 0DennisLee0

Yes, that's fine for registering and starting a new Namespace instance.

I'm not sure the code in the pi-server project is written against a recent version of Milo, so best to stick to the ExampleServer and ExampleNamespace classes as a reference.

kevinherron avatar Feb 19 '20 15:02 kevinherron

Yes, that's fine for registering and starting a new Namespace instance.

I'm not sure the code in the pi-server project is written against a recent version of Milo, so best to stick to the ExampleServer and ExampleNamespace classes as a reference.

Thank you very much! It's so kind of you!

0DennisLee0 avatar Feb 19 '20 16:02 0DennisLee0