BUG-2633 - Added Operation Service Factory Filtering for Netconf.
[controller.git] / opendaylight / netconf / netconf-monitoring / src / main / java / org / opendaylight / controller / netconf / monitoring / osgi / NetconfMonitoringServiceTracker.java
index 0b4d1c2688d64307b51815b0d3b441f0ff9722ec..9e7c105aa4e0cf53f95ebeb290b181866e54cc8a 100644 (file)
@@ -8,8 +8,10 @@
 package org.opendaylight.controller.netconf.monitoring.osgi;
 
 import com.google.common.base.Preconditions;
+import java.util.Dictionary;
 import java.util.Hashtable;
 import org.opendaylight.controller.netconf.api.monitoring.NetconfMonitoringService;
+import org.opendaylight.controller.netconf.api.util.NetconfConstants;
 import org.opendaylight.controller.netconf.mapping.api.NetconfOperationServiceFactory;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.ServiceReference;
@@ -39,7 +41,9 @@ public class NetconfMonitoringServiceTracker extends ServiceTracker<NetconfMonit
         final NetconfOperationServiceFactory factory = new NetconfMonitoringActivator.NetconfMonitoringOperationServiceFactory(
                 operationService);
 
-        reg = context.registerService(NetconfOperationServiceFactory.class, factory, new Hashtable<String, Object>());
+        Dictionary<String, String> properties = new Hashtable<>();
+        properties.put(NetconfConstants.SERVICE_NAME, NetconfConstants.NETCONF_MONITORING);
+        reg = context.registerService(NetconfOperationServiceFactory.class, factory, properties);
 
         return netconfMonitoringService;
     }