- if (rpcResult.isSuccessful()) {
- final FlowDescriptor flowDescriptor;
- final FlowId flowId = input.getFlowRef().getValue().firstKeyOf(Flow.class).getId();
- FlowGroupCache cache = new FlowGroupCache(flowId.getValue(), input.getTableId().toString(),
- FlowGroupStatus.ADDED, LocalDateTime.now());
- if (provider.getAllNodesFlowGroupCache().containsKey(nodeId.getValue())) {
- provider.getAllNodesFlowGroupCache().get(nodeId.getValue()).add(cache);
- } else {
- Queue<FlowGroupCache> flowGroupCacheList =
- Queues.synchronizedQueue(EvictingQueue.create(FLOWGROUP_CACHE_SIZE));
- flowGroupCacheList.add(cache);
- provider.getAllNodesFlowGroupCache().put(nodeId.getValue(), flowGroupCacheList);
- }
- if (input.getFlowRef() != null) {
- flowDescriptor = FlowDescriptorFactory.create(input.getTableId(), flowId);
- deviceContext.getDeviceFlowRegistry().storeDescriptor(flowRegistryKey, flowDescriptor);
- } else {
- deviceContext.getDeviceFlowRegistry().store(flowRegistryKey);
- flowDescriptor = deviceContext.getDeviceFlowRegistry().retrieveDescriptor(flowRegistryKey);
- }
-
- if (LOG.isDebugEnabled()) {
- LOG.debug("Flow add with id={} finished without error", flowDescriptor.getFlowId().getValue());
- }
- } else {