Creating InstanceIdentifier For Binding Aware & Binding Independent Components

Instance Identifier for Binding Aware Component Carefully note the import at line 1 – here we are using yang.binding package.

 Instance Identifier for Binding Independent Component Carefully note the import at line 1 – here we are using yang.data.api package.

 

How To Publish Link To MD-SAL

Helium Version Everything remains same except the way of accessing notification provider service at line 12.

How To Publish NodeConnector To MD-SAL

Helium Version Everything remains same except the way of accessing notification provider service at line 12.

How To Publish Node To MD-SAL

Helium Version Everything remains same except the way of accessing notification provider service at line 13.

How To Look Up Data In MD-SAL

In previous post, we learned how to access data in MD-SAL using Mount Point. In this post, we will see how to look up data from MD-SAL using DataProviderService.

Above code snippet is for binding aware components.

How To Access Data In MD-SAL From MountPoint

MD-SAL provides three different APIs to access data in the common data store: Java generated DTOs – Binding Aware DOM APIs – Binding Independent HTTP Restconf APIs In this post we will see how to access data in MD-SAL using each of this method. For first two, we need to get MountService from Provider context  […]

How To Handle Notifications Published To MD-SAL

MD-SAL has handlers written for MD-SAL notification types. One such example is NodeChangeCommiter which handles the notifications published on NodeUpdated notification type – refer here. Let’s say we have defined a new YANG model and have created a new notification type shapeDone as follows:

On converting this YANG file to Java, following files will […]

How To Publish Notifications To MD-SAL

Below method is to publish notifications from Binding Aware Components. Get reference to NotificationProviderService service provided by MD-SAL: Hydrogen Version

session is an object of type ProviderContext getSALService returns a session specific instance (implementation) of requested binding-aware infrastructural service. Usually reference to notification provider service is obtained in Bundle-Activator. Helium Version

Note:- Rest […]

How To Register A Service To MD-SAL

Define RPC in YANG file:

On generating Java source code through Maven, ShapeService interface will get created as follows:

Implement ShapeService interface as follows:

In pom.xml, define Bundle Activator as below:

ShapeProvider should extend AbstractBindingAwareProvider as below:

At line 21, we initialized an instance of ShapeImpl object At line 29, […]

How To Insert Data In MD-SAL Data Store

Note: Below code snippet is in line with Hydrogen release. For Helium version, check this link. Get reference to OpenDaylight’s DataProviderService as below:

session is an object of type ProviderContext/ConsumerContext. getSALService returns a session specific instance (implementation) of requested binding-aware infrastructural service. Usually reference to data provider service is obtained in Bundle-Activator. Begin transaction: […]