Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [milo-dev] Node Management Services


The easiest way is by adding a namespace like the example server/namespace shows. 

From there you can get trickier by subdividing the namespace into address space fragments if needed, but that’s the place to start. 

On Nov 25, 2024, at 22:16, Erik Voges <erik@xxxxxxxxx> wrote:


Thank you very much for clarifying Kevin!

Just one more question - once I have MyCustomAddressSpace implementation, how do I "attach" it or register it with the server?

I am astounded at how ChatGPT hallucinates when answering question about your library. I have hardly been able to get a straight answer out of it...

Sincerely
Erik


From: Kevin Herron <kevinherron@xxxxxxxxx>
Sent: Monday, 25 November 2024 16:46
To: milo developer discussions <milo-dev@xxxxxxxxxxx>
Cc: Erik Voges <erik@xxxxxxxxx>
Subject: Re: [milo-dev] Node Management Services
 
The Session already instantiates a DefaultNodeManagementServiceSet and uses it to handle incoming node management requests.

All you need to do is in your AddressSpace implementation (which in turn implements the NodeManagementServices interface) implement the required methods:

  • NodeManagementServices::addNodes
  • NodeManagementServices::deleteNodes
  • NodeManagementServices::addReferences
  • NodeManagementServices::deleteReferences

i.e. everything is already hooked up, you just need to actually implement these methods in your AddressSpace.

On Nov 25, 2024, at 00:01, Erik Voges via milo-dev <milo-dev@xxxxxxxxxxx> wrote:

Dear Community

I am confused with adding node management services, in particular, how the NodeManagementServices gets called (I can't find any reference to it in the code).

What I have done so far was to register the AbstractNodeManager and also the DefaultNodeManagementServiceSet as follows:

                server = new OpcUaServer(serverConfig);

                AddressSpaceManager addressSpaceManager = server.getAddressSpaceManager();
                AbstractNodeManager<UaNode> nodeManager = new AbstractNodeManager<UaNode>();

                addressSpaceManager.register(nodeManager);
                System.out.println("registered NodeManager ...");

                server.getStackServer().addServiceSet("urn:energyutilities:opcua:server",
                                new DefaultNodeManagementServiceSet());
                System.out.println("added DefaultNodeManagementServiceSet ...");

.. But whenever I try to add a node to my server  from an outside script, it calls this line in DefaultNodeManagementServiceSet.addNodes():

      ...
           server.getAddressSpaceManager().addNodes(context, nodesToAdd);
      ...

... which ends up calling the default NodeManagementServices.addNodes() which returns "BadNotSupported".

So my question is really: If I create a custom subclass of NodeManagementServices, where do I register it so that it will get called instead of the original interface?

I thought that  " addressSpaceManager.register(nodeManager); " would have taken care of it ... what am I missing?

Or was I supposed to change the DefaultNodeManagementServiceSet.addNodes() so that it does something different?

I'm sorry if is is a real dumb question....

Best regards
Erik

_______________________________________________
milo-dev mailing list
milo-dev@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/milo-dev


Back to the top