Sonar clean-up: braces for control statements
[netvirt.git] / openstack / net-virt-providers / src / main / java / org / opendaylight / ovsdb / openstack / netvirt / providers / openflow13 / PipelineOrchestratorImpl.java
index 3b342e1dd03d63f0f3228884e9e2b60733886519..b7d48671039b22649d1edc07e95bdae776f08d8c 100644 (file)
@@ -18,7 +18,7 @@ import java.util.concurrent.BlockingQueue;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 import java.util.concurrent.LinkedBlockingQueue;
-import org.opendaylight.ovsdb.openstack.netvirt.MdsalUtils;
+import org.opendaylight.ovsdb.openstack.netvirt.api.Southbound;
 import org.opendaylight.ovsdb.openstack.netvirt.api.Action;
 import org.opendaylight.ovsdb.openstack.netvirt.api.NodeCacheListener;
 import org.opendaylight.ovsdb.openstack.netvirt.api.NodeCacheManager;
@@ -48,6 +48,7 @@ public class PipelineOrchestratorImpl implements ConfigInterface, NodeCacheListe
     Map<Service, AbstractServiceInstance> serviceRegistry = Maps.newConcurrentMap();
     private volatile BlockingQueue<Node> queue;
     private ExecutorService eventHandler;
+    private Southbound southbound;
 
     public PipelineOrchestratorImpl() {
         eventHandler = Executors.newSingleThreadExecutor();
@@ -68,13 +69,17 @@ public class PipelineOrchestratorImpl implements ConfigInterface, NodeCacheListe
     @Override
     public Service getNextServiceInPipeline(Service service) {
         int index = staticPipeline.indexOf(service);
-        if (index >= staticPipeline.size() - 1) return null;
+        if (index >= staticPipeline.size() - 1) {
+            return null;
+        }
         return staticPipeline.get(index + 1);
     }
 
     @Override
     public AbstractServiceInstance getServiceInstance(Service service) {
-        if (service == null) return null;
+        if (service == null) {
+            return null;
+        }
         return serviceRegistry.get(service);
     }
 
@@ -97,7 +102,7 @@ public class PipelineOrchestratorImpl implements ConfigInterface, NodeCacheListe
                             AbstractServiceInstance serviceInstance = getServiceInstance(service);
                             //logger.info("pipeline: {} - {}", service, serviceInstance);
                             if (serviceInstance != null) {
-                                if (MdsalUtils.getBridge(node) != null) {
+                                if (southbound.getBridge(node) != null) {
                                     serviceInstance.programDefaultPipelineRule(node);
                                 }
                             }
@@ -145,10 +150,10 @@ public class PipelineOrchestratorImpl implements ConfigInterface, NodeCacheListe
                 (NodeCacheManager) ServiceHelper.getGlobalInstance(NodeCacheManager.class, this);
         nodeCacheManager.cacheListenerAdded(
                 bundleContext.getServiceReference(PipelineOrchestrator.class.getName()), this);
+        southbound =
+                (Southbound) ServiceHelper.getGlobalInstance(Southbound.class, this);
     }
 
     @Override
-    public void setDependencies(Object impl) {
-
-    }
+    public void setDependencies(Object impl) {}
 }