Bug-1421 - MD-SAL app cannot create a flow entry which adds a VLAN tag with the speci...
[openflowplugin.git] / openflowplugin / src / main / java / org / opendaylight / openflowplugin / openflow / md / core / ConnectionConductorFactory.java
index dde9d2322341b5c2398a665f3f2fa55bd4b30726..2bd97db38e6060c7caa6ab691b4a940fea56903c 100644 (file)
@@ -8,24 +8,35 @@
 
 package org.opendaylight.openflowplugin.openflow.md.core;
 
+import java.util.concurrent.atomic.AtomicInteger;
+
 import org.opendaylight.openflowjava.protocol.api.connection.ConnectionAdapter;
-import org.opendaylight.openflowplugin.openflow.md.queue.QueueKeeper;
+import org.opendaylight.openflowplugin.openflow.md.queue.QueueProcessor;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.OfHeader;
+import org.opendaylight.yangtools.yang.binding.DataObject;
 
 /**
  * @author mirehak
  *
  */
-public abstract class ConnectionConductorFactory {
+public final class ConnectionConductorFactory {
+
+    private static AtomicInteger conductorId = new AtomicInteger();
+    
+    private ConnectionConductorFactory() {
+        throw new UnsupportedOperationException();
+    }
 
     /**
      * @param connectionAdapter
-     * @param queueKeepe
+     * @param queueProcesso
      * @return conductor for given connection
      */
     public static ConnectionConductor createConductor(ConnectionAdapter connectionAdapter, 
-            QueueKeeper<Object> queueKeeper) {
+            QueueProcessor<OfHeader, DataObject> queueProcessor) {
         ConnectionConductor connectionConductor = new ConnectionConductorImpl(connectionAdapter);
-        connectionConductor.setQueueKeeper(queueKeeper);
+        connectionConductor.setQueueProcessor(queueProcessor);
+        connectionConductor.setId(conductorId.getAndIncrement());
         connectionConductor.init();
         return connectionConductor;
     }