Stubpce Update
[transportpce.git] / tests / stubpce / src / main / java / org / opendaylight / transportpce / stubpce / impl / StubpceProvider.java
index 0b1fe228e37c8800f4b92382d6016ae44dfb9911..9ef48f373e07f5a400802d18da6f7c30d6729242 100644 (file)
@@ -9,12 +9,13 @@
 
 package org.opendaylight.transportpce.stubpce.impl;
 
+import org.opendaylight.controller.md.sal.binding.api.DataBroker;
 import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService;
 import org.opendaylight.controller.md.sal.binding.api.NotificationService;
 import org.opendaylight.controller.sal.binding.api.BindingAwareBroker;
 import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.stubpce.rev170426.StubpceListener;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.stubpce.rev170426.StubpceService;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.TransportpceServicepathListener;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.TransportpceServicepathService;
 import org.opendaylight.yangtools.concepts.ListenerRegistration;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -22,23 +23,24 @@ import org.slf4j.LoggerFactory;
 /**
  * Class to register
  * Stubpce Service and Notification.
- * @author Martial Coulibaly ( martial.coulibaly@gfi.com ) on behalf of Orange
+ * @author <a href="mailto:martial.coulibaly@gfi.com">Martial Coulibaly</a> on behalf of Orange
  *
  */
 public class StubpceProvider {
     private static final Logger LOG = LoggerFactory.getLogger(StubpceProvider.class);
     private final RpcProviderRegistry rpcRegistry;
     private final NotificationPublishService notificationPublishService;
+    private final DataBroker dataBroker;
 
 
-    private BindingAwareBroker.RpcRegistration<StubpceService> rpcRegistration;
-    private ListenerRegistration<StubpceListener> stubPcelistenerRegistration;
+    private BindingAwareBroker.RpcRegistration<TransportpceServicepathService> rpcRegistration;
+    private ListenerRegistration<TransportpceServicepathListener> stubPcelistenerRegistration;
 
-    public StubpceProvider(RpcProviderRegistry rpcProviderRegistry,
-        NotificationService notificationService,
-        NotificationPublishService notificationPublishService) {
+    public StubpceProvider(RpcProviderRegistry rpcProviderRegistry,final DataBroker dataBroker,
+            NotificationService notificationService, NotificationPublishService notificationPublishService) {
         this.rpcRegistry = rpcProviderRegistry;
         this.notificationPublishService = notificationPublishService;
+        this.dataBroker = dataBroker;
     }
 
     /**
@@ -46,8 +48,8 @@ public class StubpceProvider {
      */
     public void init() {
         LOG.info("StubpceProvider Session Initiated");
-        final StubpceImpl consumer = new StubpceImpl(notificationPublishService);
-        rpcRegistration = rpcRegistry.addRpcImplementation(StubpceService.class, consumer);
+        final StubpceImpl consumer = new StubpceImpl(notificationPublishService,dataBroker);
+        rpcRegistration = rpcRegistry.addRpcImplementation(TransportpceServicepathService.class, consumer);
     }
 
     /**