final ItemLifecycleListener itemLifecycleListener = flowLifeCycleKeeper.getItemLifecycleListener();
if (itemLifecycleListener != null) {
//2. create registry key
- final FlowRegistryKey flowRegKey = FlowRegistryKeyFactory.create(flowRemovedNotification);
+ final FlowRegistryKey flowRegKey = FlowRegistryKeyFactory.create(getDeviceInfo().getVersion(), flowRemovedNotification);
//3. lookup flowId
final FlowDescriptor flowDescriptor = deviceFlowRegistry.retrieveIdForFlow(flowRegKey);
//4. if flowId present:
LOG.debug("Transaction chain manager for node {} created", deviceInfo.getLOGValue());
}
this.transactionChainManager = new TransactionChainManager(dataBroker, deviceInfo);
- this.deviceFlowRegistry = new DeviceFlowRegistryImpl(dataBroker, deviceInfo.getNodeInstanceIdentifier());
+ this.deviceFlowRegistry = new DeviceFlowRegistryImpl(deviceInfo.getVersion(), dataBroker, deviceInfo.getNodeInstanceIdentifier());
this.deviceGroupRegistry = new DeviceGroupRegistryImpl();
this.deviceMeterRegistry = new DeviceMeterRegistryImpl();
this.initialized = true;
private final DataBroker dataBroker;
private final KeyedInstanceIdentifier<Node, NodeKey> instanceIdentifier;
private final List<ListenableFuture<List<Optional<FlowCapableNode>>>> lastFillFutures = new ArrayList<>();
+ private final Consumer<Flow> flowConsumer;
- // Specifies what to do with flow read from datastore
- private final Consumer<Flow> flowConsumer = flow -> {
- // Create flow registry key from flow
- final FlowRegistryKey key = FlowRegistryKeyFactory.create(flow);
-
- // Now, we will update the registry, but we will also try to prevent duplicate entries
- if (!flowRegistry.containsKey(key)) {
- LOG.trace("Found flow with table ID : {} and flow ID : {}", flow.getTableId(), flow.getId().getValue());
- final FlowDescriptor descriptor = FlowDescriptorFactory.create(flow.getTableId(), flow.getId());
- store(key, descriptor);
- }
- };
-
- public DeviceFlowRegistryImpl(final DataBroker dataBroker, final KeyedInstanceIdentifier<Node, NodeKey> instanceIdentifier) {
+ public DeviceFlowRegistryImpl(final short version, final DataBroker dataBroker, final KeyedInstanceIdentifier<Node, NodeKey> instanceIdentifier) {
this.dataBroker = dataBroker;
this.instanceIdentifier = instanceIdentifier;
+
+ // Specifies what to do with flow read from datastore
+ flowConsumer = flow -> {
+ // Create flow registry key from flow
+ final FlowRegistryKey key = FlowRegistryKeyFactory.create(version, flow);
+
+ // Now, we will update the registry, but we will also try to prevent duplicate entries
+ if (!flowRegistry.containsKey(key)) {
+ LOG.trace("Found flow with table ID : {} and flow ID : {}", flow.getTableId(), flow.getId().getValue());
+ final FlowDescriptor descriptor = FlowDescriptorFactory.create(flow.getTableId(), flow.getId());
+ store(key, descriptor);
+ }
+ };
}
@Override
final String alienId = ALIEN_SYSTEM_FLOW_ID + tableId + '-' + UNACCOUNTED_FLOWS_COUNTER.incrementAndGet();
return new FlowId(alienId);
}
-}
\ No newline at end of file
+}
// Hide implicit constructor
}
- public static FlowRegistryKey create(final Flow flow) {
- return new FlowRegistryKeyDto(flow);
+ public static FlowRegistryKey create(final short version, final Flow flow) {
+ return new FlowRegistryKeyDto(version, flow);
}
private static final class FlowRegistryKeyDto implements FlowRegistryKey {
private final int priority;
private final BigInteger cookie;
private final Match match;
+ private final short version;
- private FlowRegistryKeyDto(final Flow flow) {
+ private FlowRegistryKeyDto(final short version, final Flow flow) {
//TODO: mandatory flow input values (or default values) should be specified via yang model
tableId = Preconditions.checkNotNull(flow.getTableId(), "flow tableId must not be null");
priority = MoreObjects.firstNonNull(flow.getPriority(), OFConstants.DEFAULT_FLOW_PRIORITY);
match = MoreObjects.firstNonNull(flow.getMatch(), OFConstants.EMPTY_MATCH);
cookie = MoreObjects.firstNonNull(flow.getCookie(), OFConstants.DEFAULT_FLOW_COOKIE).getValue();
+ this.version = version;
}
@Override
return getPriority() == that.getPriority() &&
getTableId() == that.getTableId() &&
getCookie().equals(that.getCookie()) &&
- MatchComparatorFactory.createMatch().areObjectsEqual(getMatch(), that.getMatch());
+ MatchComparatorFactory.createMatch().areObjectsEqual(version, getMatch(), that.getMatch());
}
@Override
@Override
public Future<RpcResult<AddFlowOutput>> addFlow(final AddFlowInput input) {
- final FlowRegistryKey flowRegistryKey = FlowRegistryKeyFactory.create(input);
+ final FlowRegistryKey flowRegistryKey = FlowRegistryKeyFactory.create(deviceContext.getDeviceInfo().getVersion(), input);
final ListenableFuture<RpcResult<AddFlowOutput>> future =
flowAdd.processFlowModInputBuilders(flowAdd.toFlowModInputs(input));
Futures.addCallback(future, new AddFlowCallback(input, flowRegistryKey));
if (LOG.isDebugEnabled()) {
LOG.debug("Flow remove finished without error for flow={}", input);
}
- FlowRegistryKey flowRegistryKey = FlowRegistryKeyFactory.create(input);
+ FlowRegistryKey flowRegistryKey = FlowRegistryKeyFactory.create(deviceContext.getDeviceInfo().getVersion(), input);
deviceContext.getDeviceFlowRegistry().removeDescriptor(flowRegistryKey);
if (itemLifecycleListener != null) {
final UpdatedFlow updated = input.getUpdatedFlow();
final OriginalFlow original = input.getOriginalFlow();
- final FlowRegistryKey origFlowRegistryKey = FlowRegistryKeyFactory.create(original);
- final FlowRegistryKey updatedFlowRegistryKey = FlowRegistryKeyFactory.create(updated);
+ final FlowRegistryKey origFlowRegistryKey = FlowRegistryKeyFactory.create(deviceContext.getDeviceInfo().getVersion(), original);
+ final FlowRegistryKey updatedFlowRegistryKey = FlowRegistryKeyFactory.create(deviceContext.getDeviceInfo().getVersion(), updated);
final FlowDescriptor origFlowDescriptor = deviceFlowRegistry.retrieveIdForFlow(origFlowRegistryKey);
final boolean isUpdate = Objects.nonNull(origFlowDescriptor);
LOG.warn("Service call for updating flow={} failed, reason: {}", input, throwable);
}
}
-}
\ No newline at end of file
+}
flowBuilder.addAugmentation(FlowStatisticsData.class, refineFlowStatisticsAugmentation(flowStat).build());
final short tableId = flowStat.getTableId();
- final FlowRegistryKey flowRegistryKey = FlowRegistryKeyFactory.create(flowBuilder.build());
+ final FlowRegistryKey flowRegistryKey = FlowRegistryKeyFactory.create(deviceInfo.getVersion(), flowBuilder.build());
final FlowId flowId = registry.storeIfNecessary(flowRegistryKey);
final FlowKey flowKey = new FlowKey(flowId);
final FlowBuilder flowBuilder = new FlowBuilder(flowStatistics)
.addAugmentation(FlowStatisticsData.class, flowStatisticsDataBld.build());
- final FlowRegistryKey flowRegistryKey = FlowRegistryKeyFactory.create(flowBuilder.build());
+ final FlowRegistryKey flowRegistryKey = FlowRegistryKeyFactory.create(getVersion(), flowBuilder.build());
return getDeviceRegistry().getDeviceFlowRegistry().storeIfNecessary(flowRegistryKey);
}
}
package org.opendaylight.openflowplugin.impl.util;
+import org.opendaylight.openflowplugin.api.openflow.md.util.OpenflowVersion;
+import org.opendaylight.openflowplugin.openflow.md.util.InventoryDataServiceUtil;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.Match;
-
+import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId;
import java.util.ArrayList;
import java.util.Collection;
* Comparation by whole object
*/
@Override
- public boolean areObjectsEqual(Match statsMatch, Match storedMatch) {
+ public boolean areObjectsEqual(short version, Match statsMatch, Match storedMatch) {
return (statsMatch == null) == (storedMatch == null);
}
};
* Comparation by VLAN
*/
@Override
- public boolean areObjectsEqual(Match statsMatch, Match storedMatch) {
+ public boolean areObjectsEqual(short version, Match statsMatch, Match storedMatch) {
if (storedMatch == null) {
return false;
}
* Comparation by tunnel
*/
@Override
- public boolean areObjectsEqual(Match statsMatch, Match storedMatch) {
+ public boolean areObjectsEqual(short version, Match statsMatch, Match storedMatch) {
if (storedMatch == null) {
return false;
}
* Comparation by protocol fields
*/
@Override
- public boolean areObjectsEqual(Match statsMatch, Match storedMatch) {
+ public boolean areObjectsEqual(short version, Match statsMatch, Match storedMatch) {
if (storedMatch == null) {
return false;
}
* Comparation by metadata
*/
@Override
- public boolean areObjectsEqual(Match statsMatch, Match storedMatch) {
+ public boolean areObjectsEqual(short version, Match statsMatch, Match storedMatch) {
if (storedMatch == null) {
return false;
}
* Comparation by layer4
*/
@Override
- public boolean areObjectsEqual(Match statsMatch, Match storedMatch) {
+ public boolean areObjectsEqual(short version, Match statsMatch, Match storedMatch) {
if (storedMatch == null) {
return false;
}
* Comparation by layer3
*/
@Override
- public boolean areObjectsEqual(Match statsMatch, Match storedMatch) {
+ public boolean areObjectsEqual(short version, Match statsMatch, Match storedMatch) {
if (storedMatch == null) {
return false;
}
* Comparation by Ip
*/
@Override
- public boolean areObjectsEqual(Match statsMatch, Match storedMatch) {
+ public boolean areObjectsEqual(short version, Match statsMatch, Match storedMatch) {
if (storedMatch == null) {
return false;
}
};
}
+
+ /**
+ * Converts both ports in node connector id format to number format and compare them
+ *
+ * @param version openflow version
+ * @param left first object to compare
+ * @param right second object to compare
+ * @return true if equal
+ */
+ private static boolean arePortNumbersEqual(short version, NodeConnectorId left, NodeConnectorId right) {
+ final OpenflowVersion ofVersion = OpenflowVersion.get(version);
+
+ final Long leftPort = InventoryDataServiceUtil.portNumberfromNodeConnectorId(ofVersion, left);
+ final Long rightPort = InventoryDataServiceUtil.portNumberfromNodeConnectorId(ofVersion, right);
+
+ if (leftPort == null) {
+ if (rightPort != null) {
+ return false;
+ }
+ } else if (!leftPort.equals(rightPort)) {
+ return false;
+ }
+
+ return true;
+ }
+
public static SimpleComparator<Match> createInPort() {
return new SimpleComparator<Match>() {
/**
* Comparation by InPort
*/
@Override
- public boolean areObjectsEqual(Match statsMatch, Match storedMatch) {
+ public boolean areObjectsEqual(short version, Match statsMatch, Match storedMatch) {
if (storedMatch == null) {
return false;
}
if (statsMatch.getInPort() != null) {
return false;
}
- } else if (!storedMatch.getInPort().equals(statsMatch.getInPort())) {
+ } else if (!arePortNumbersEqual(version, storedMatch.getInPort(), statsMatch.getInPort())) {
return false;
}
return true;
* Comparation by InPhyPort
*/
@Override
- public boolean areObjectsEqual(Match statsMatch, Match storedMatch) {
+ public boolean areObjectsEqual(short version, Match statsMatch, Match storedMatch) {
if (storedMatch == null) {
return false;
}
if (statsMatch.getInPhyPort() != null) {
return false;
}
- } else if (!storedMatch.getInPhyPort().equals(statsMatch.getInPhyPort())) {
+ } else if (!arePortNumbersEqual(version, storedMatch.getInPhyPort(), statsMatch.getInPhyPort())) {
return false;
}
return true;
* Comparation by Ethernet
*/
@Override
- public boolean areObjectsEqual(Match statsMatch, Match storedMatch) {
+ public boolean areObjectsEqual(short version, Match statsMatch, Match storedMatch) {
if (storedMatch == null) {
return false;
}
* Comparation by Icmpv4
*/
@Override
- public boolean areObjectsEqual(Match statsMatch, Match storedMatch) {
+ public boolean areObjectsEqual(short version, Match statsMatch, Match storedMatch) {
if (storedMatch == null) {
return false;
}
* Compares flows by whole match
*/
@Override
- public boolean areObjectsEqual(final Match statsFlow, final Match storedFlow) {
+ public boolean areObjectsEqual(short version, final Match statsFlow, final Match storedFlow) {
if (statsFlow == null) {
if (storedFlow != null) {
return false;
}
- } else if (!compareMatches(statsFlow, storedFlow)) {
+ } else if (!compareMatches(version, statsFlow, storedFlow)) {
return false;
}
return true;
* @param storedMatch
* @return
*/
- private static boolean compareMatches(final Match statsMatch, final Match storedMatch) {
+ private static boolean compareMatches(final short version, final Match statsMatch, final Match storedMatch) {
if (statsMatch == storedMatch) {
return true;
}
for (SimpleComparator<Match> matchComp : MATCH_COMPARATORS) {
- if (!matchComp.areObjectsEqual(statsMatch, storedMatch)) {
+ if (!matchComp.areObjectsEqual(version, statsMatch, storedMatch)) {
return false;
}
}
public interface SimpleComparator<T> {
- boolean areObjectsEqual(T obj1, T obj2);
+ boolean areObjectsEqual(short version, T obj1, T obj2);
-}
\ No newline at end of file
+}
.thenReturn(flowRemovedMdsalBld.build());
// insert flow+flowId into local registry
- final FlowRegistryKey flowRegKey = FlowRegistryKeyFactory.create(flowRemovedMdsalBld.build());
+ final FlowRegistryKey flowRegKey = FlowRegistryKeyFactory.create(deviceInfo.getVersion(), flowRemovedMdsalBld.build());
final FlowDescriptor flowDescriptor = FlowDescriptorFactory.create((short) 0, new FlowId("ut-ofp:f456"));
deviceContext.getDeviceFlowRegistry().store(flowRegKey, flowDescriptor);
import org.opendaylight.controller.md.sal.binding.api.DataBroker;
import org.opendaylight.controller.md.sal.binding.api.ReadOnlyTransaction;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
+import org.opendaylight.openflowplugin.api.OFConstants;
import org.opendaylight.openflowplugin.api.openflow.registry.flow.FlowDescriptor;
import org.opendaylight.openflowplugin.api.openflow.registry.flow.FlowRegistryKey;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode;
public void setUp() throws Exception {
nodeInstanceIdentifier = InstanceIdentifier.create(Nodes.class).child(Node.class, new NodeKey(new NodeId(NODE_ID)));
when(dataBroker.newReadOnlyTransaction()).thenReturn(readOnlyTransaction);
- deviceFlowRegistry = new DeviceFlowRegistryImpl(dataBroker, nodeInstanceIdentifier);
+ deviceFlowRegistry = new DeviceFlowRegistryImpl(OFConstants.OFP_VERSION_1_3, dataBroker, nodeInstanceIdentifier);
final FlowAndStatisticsMapList flowStats = TestFlowHelper.createFlowAndStatisticsMapListBuilder(1).build();
- key = FlowRegistryKeyFactory.create(flowStats);
+ key = FlowRegistryKeyFactory.create(OFConstants.OFP_VERSION_1_3, flowStats);
descriptor = FlowDescriptorFactory.create(key.getTableId(), new FlowId("ut:1"));
Assert.assertEquals(0, deviceFlowRegistry.getAllFlowDescriptors().size());
.build();
final Map<FlowRegistryKey, FlowDescriptor> allFlowDescriptors = testFill(path, flowCapableNode);
- final FlowRegistryKey key = FlowRegistryKeyFactory.create(flow);
+ final FlowRegistryKey key = FlowRegistryKeyFactory.create(OFConstants.OFP_VERSION_1_3, flow);
InOrder order = inOrder(dataBroker, readOnlyTransaction);
order.verify(dataBroker).newReadOnlyTransaction();
// store new key with old value
final FlowAndStatisticsMapList flowStats = TestFlowHelper.createFlowAndStatisticsMapListBuilder(2).build();
- final FlowRegistryKey key2 = FlowRegistryKeyFactory.create(flowStats);
+ final FlowRegistryKey key2 = FlowRegistryKeyFactory.create(OFConstants.OFP_VERSION_1_3, flowStats);
deviceFlowRegistry.store(key2, descriptor);
Assert.assertEquals(2, deviceFlowRegistry.getAllFlowDescriptors().size());
Assert.assertEquals("ut:1", deviceFlowRegistry.retrieveIdForFlow(key2).getFlowId().getValue());
//store new key
final String alienPrefix = "#UF$TABLE*2-";
- final FlowRegistryKey key2 = FlowRegistryKeyFactory.create(TestFlowHelper.createFlowAndStatisticsMapListBuilder(2).build());
+ final FlowRegistryKey key2 = FlowRegistryKeyFactory.create(OFConstants.OFP_VERSION_1_3, TestFlowHelper.createFlowAndStatisticsMapListBuilder(2).build());
newFlowId = deviceFlowRegistry.storeIfNecessary(key2);
Assert.assertTrue(newFlowId.getValue().startsWith(alienPrefix));
return null;
}
-}
\ No newline at end of file
+}
HashSet<FlowRegistryKey> flowRegistryKeys = new HashSet<>();
for (FlowAndStatisticsMapList item : flowStats.getFlowAndStatisticsMapList()) {
- final FlowRegistryKey key1 = FlowRegistryKeyFactory.create(item);
- final FlowRegistryKey key2 = FlowRegistryKeyFactory.create(item);
+ final FlowRegistryKey key1 = FlowRegistryKeyFactory.create(deviceInfo.getVersion(), item);
+ final FlowRegistryKey key2 = FlowRegistryKeyFactory.create(deviceInfo.getVersion(), item);
flowRegistryKeys.add(key1);
flowRegistryKeys.add(key1);
flowRegistryKeys.add(key2);
@Test
public void testEqualsNegative() throws Exception {
final FlowAndStatisticsMapList flowStatisticsMapList1 = TestFlowHelper.createFlowAndStatisticsMapListBuilder(1).build();
- final FlowRegistryKey key1 = FlowRegistryKeyFactory.create(flowStatisticsMapList1);
+ final FlowRegistryKey key1 = FlowRegistryKeyFactory.create(deviceInfo.getVersion(), flowStatisticsMapList1);
FlowRegistryKey key2;
FlowAndStatisticsMapListBuilder flowStatisticsMapListBld2;
// different priority
flowStatisticsMapListBld2 = new FlowAndStatisticsMapListBuilder(flowStatisticsMapList1);
flowStatisticsMapListBld2.setPriority(flowStatisticsMapListBld2.getPriority() + 1);
- key2 = FlowRegistryKeyFactory.create(flowStatisticsMapListBld2.build());
+ key2 = FlowRegistryKeyFactory.create(deviceInfo.getVersion(), flowStatisticsMapListBld2.build());
Assert.assertFalse(key1.equals(key2));
// different match
flowStatisticsMapListBld2 = new FlowAndStatisticsMapListBuilder(flowStatisticsMapList1);
flowStatisticsMapListBld2.setMatch(new MatchBuilder().build());
- key2 = FlowRegistryKeyFactory.create(flowStatisticsMapListBld2.build());
+ key2 = FlowRegistryKeyFactory.create(deviceInfo.getVersion(), flowStatisticsMapListBld2.build());
Assert.assertFalse(key1.equals(key2));
// different tableId
flowStatisticsMapListBld2 = new FlowAndStatisticsMapListBuilder(flowStatisticsMapList1);
flowStatisticsMapListBld2.setTableId((short) (flowStatisticsMapListBld2.getTableId() + 1));
- key2 = FlowRegistryKeyFactory.create(flowStatisticsMapListBld2.build());
+ key2 = FlowRegistryKeyFactory.create(deviceInfo.getVersion(), flowStatisticsMapListBld2.build());
Assert.assertFalse(key1.equals(key2));
Assert.assertFalse(key1.equals(null));
.setPriority(2)
.setTableId((short) 0);
- FlowRegistryKey flow1Hash = FlowRegistryKeyFactory.create(flow1Builder.build());
+ FlowRegistryKey flow1Hash = FlowRegistryKeyFactory.create(deviceInfo.getVersion(), flow1Builder.build());
LOG.info("flowHash1: {}", flow1Hash.hashCode());
.setCookie(new FlowCookie(BigInteger.valueOf(148)))
.setMatch(match2Builder.build());
- FlowRegistryKey flow2Hash = FlowRegistryKeyFactory.create(flow2Builder.build());
+ FlowRegistryKey flow2Hash = FlowRegistryKeyFactory.create(deviceInfo.getVersion(), flow2Builder.build());
LOG.info("flowHash2: {}", flow2Hash.hashCode());
Assert.assertNotSame(flow1Hash, flow2Hash);
FlowBuilder fb1 = new FlowBuilder(flow1Builder.build());
fb1.setTableId(null);
try {
- FlowRegistryKeyFactory.create(fb1.build());
+ FlowRegistryKeyFactory.create(deviceInfo.getVersion(), fb1.build());
Assert.fail("hash creation should have failed because of NPE");
} catch (Exception e) {
// expected
FlowBuilder fb2 = new FlowBuilder(flow1Builder.build());
fb2.setPriority(null);
try {
- FlowRegistryKeyFactory.create(fb2.build());
+ FlowRegistryKeyFactory.create(deviceInfo.getVersion(), fb2.build());
} catch (Exception e) {
// not expected
Assert.fail("no exception was expected while hash was creating.");
FlowBuilder fb3 = new FlowBuilder(flow1Builder.build());
fb3.setCookie(null);
- FlowRegistryKey flowRegistryKey = FlowRegistryKeyFactory.create(fb3.build());
+ FlowRegistryKey flowRegistryKey = FlowRegistryKeyFactory.create(deviceInfo.getVersion(), fb3.build());
Assert.assertNotNull(flowRegistryKey.getCookie());
Assert.assertEquals(OFConstants.DEFAULT_COOKIE, flowRegistryKey.getCookie());
}
FlowsStatisticsUpdate flowStats = FLOWS_STATISTICS_UPDATE_BUILDER.build();
for (FlowAndStatisticsMapList item : flowStats.getFlowAndStatisticsMapList()) {
- FlowRegistryKey flowRegistryKey = FlowRegistryKeyFactory.create(item);
+ FlowRegistryKey flowRegistryKey = FlowRegistryKeyFactory.create(deviceInfo.getVersion(), item);
FlowRegistryKey lastHash = null;
if (null != lastHash) {
assertNotEquals(lastHash, flowRegistryKey);
when(mockedDeviceContext.getPrimaryConnectionContext()).thenReturn(mockedPrimConnectionContext);
when(mockedDeviceContext.getMessageSpy()).thenReturn(mockedMessagSpy);
- when(mockedDeviceContext.getDeviceFlowRegistry()).thenReturn(new DeviceFlowRegistryImpl(dataBroker, NODE_II));
+ when(mockedDeviceContext.getDeviceFlowRegistry()).thenReturn(new DeviceFlowRegistryImpl(DUMMY_VERSION, dataBroker, NODE_II));
when(mockedDeviceContext.getDeviceState()).thenReturn(mockedDeviceState);
when(mockedDeviceContext.getDeviceInfo()).thenReturn(mockedDeviceInfo);
when(mockedDeviceContext.getMultiMsgCollector(Matchers.any())).thenReturn(multiMessageCollector);
import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry;
import org.opendaylight.openflowjava.protocol.api.connection.ConnectionAdapter;
import org.opendaylight.openflowjava.protocol.api.connection.OutboundQueue;
+import org.opendaylight.openflowplugin.api.OFConstants;
import org.opendaylight.openflowplugin.api.openflow.connection.ConnectionContext;
import org.opendaylight.openflowplugin.api.openflow.device.DeviceContext;
import org.opendaylight.openflowplugin.api.openflow.device.DeviceInfo;
when(mockedDeviceContext.getDeviceInfo()).thenReturn(mockedDeviceInfo);
when(mockedDeviceContext.getPrimaryConnectionContext()).thenReturn(mockedPrimConnectionContext);
when(mockedDeviceContext.getMessageSpy()).thenReturn(mockedMessagSpy);
- when(mockedDeviceContext.getDeviceFlowRegistry()).thenReturn(new DeviceFlowRegistryImpl(dataBroker, nodePath));
+ when(mockedDeviceContext.getDeviceFlowRegistry()).thenReturn(new DeviceFlowRegistryImpl(OFConstants.OFP_VERSION_1_3, dataBroker, nodePath));
when(mockedDeviceContext.getDeviceState()).thenReturn(mockedDeviceState);
when(mockedDeviceContext.getMultiMsgCollector(
Matchers.<RequestContext<List<MultipartReply>>>any())).thenAnswer(