How To Insert Data In MD-SAL Data Store – Helium Version

Previously I wrote how to insert data in MD-SAL data store but that holds good only for OpenDaylight’s Hydrogen release. In OpenDaylight’s Helium release, data broker API’s have been changed. Here is how you can insert data in MD-SAL data store if you are using OpenDaylight’s Helium version. Note that you also have to switch your OSGI bundle to be config subsytem aware before you can start using new DataBroker service.

Import following packages:

Get reference to DataBroker as below:

Create an instance of the data you are trying to store:

  • dataRef is an instance of top-level container ‘Data’ defined in YANG.
  • DataBuilder is the corresponding builder class.

and invoke:

 

Comments

  1. Ravi says

    Hi

    Could you please provide me any running source code as zip file for “How To Insert Data In MD-SAL Data Store – Helium Version”. Currently based on the article we are not able to understand.

    Regards,
    Ravi

Trackbacks

Leave a Reply

Your email address will not be published. Required fields are marked *