flow descriptors should be always stored when addFlow is called 02/20702/2
authorMartin Bobak <mbobak@cisco.com>
Tue, 19 May 2015 08:43:04 +0000 (10:43 +0200)
committerMartin Bobak <mbobak@cisco.com>
Tue, 19 May 2015 11:06:36 +0000 (13:06 +0200)
Change-Id: Idef70e2e2f28e231dacbe2ccda8a8a9d484570e1
Signed-off-by: Martin Bobak <mbobak@cisco.com>
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/SalFlowServiceImpl.java

index 9872b2252c1963281337a950ab2b37a470275e23..3912e027980f73e6f9fdedcb1341cb3e7b4cd1dc 100644 (file)
@@ -74,10 +74,12 @@ public class SalFlowServiceImpl extends CommonService implements SalFlowService
             flowId = FlowUtil.createAlienFlowId(input.getTableId());
         }
 
+        final DeviceContext deviceContext = getDeviceContext();
+        final FlowHash flowHash = FlowHashFactory.create(input, deviceContext.getPrimaryConnectionContext().getFeatures().getVersion());
+        final FlowDescriptor flowDescriptor = FlowDescriptorFactory.create(input.getTableId(), flowId);
+        deviceContext.getDeviceFlowRegistry().store(flowHash, flowDescriptor);
         Futures.addCallback(future, new FutureCallback<RpcResult<AddFlowOutput>>() {
 
-            final DeviceContext deviceContext = getDeviceContext();
-            final FlowHash flowHash = FlowHashFactory.create(input, deviceContext.getPrimaryConnectionContext().getFeatures().getVersion());
 
             @Override
             public void onSuccess(final RpcResult<AddFlowOutput> rpcResult) {