/**
* Translates from input to output
* @param input
- * @param deviceContext
+ * @param deviceState
* @param connectionDistinguisher
* @return message of output type
*/
- O translate(I input, DeviceContext deviceContext, Object connectionDistinguisher);
+ O translate(I input, DeviceState deviceState, Object connectionDistinguisher);
}
if (itemLifecycleListener != null) {
//1. translate to general flow (table, priority, match, cookie)
final org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.FlowRemoved flowRemovedNotification =
- flowRemovedTranslator.translate(flowRemoved, this, null);
+ flowRemovedTranslator.translate(flowRemoved, this.getDeviceState(), null);
//2. create registry key
final FlowRegistryKey flowRegKey = FlowRegistryKeyFactory.create(flowRemovedNotification);
//3. lookup flowId
@Override
public void processPortStatusMessage(final PortStatusMessage portStatus) {
messageSpy.spyMessage(portStatus.getImplementedInterface(), MessageSpy.STATISTIC_GROUP.FROM_SWITCH_PUBLISHED_SUCCESS);
- final FlowCapableNodeConnector flowCapableNodeConnector = portStatusTranslator.translate(portStatus, this, null);
+ final FlowCapableNodeConnector flowCapableNodeConnector = portStatusTranslator.translate(portStatus, this.getDeviceState(), null);
final KeyedInstanceIdentifier<NodeConnector, NodeConnectorKey> iiToNodeConnector = provideIIToNodeConnector(portStatus.getPortNo(), portStatus.getVersion());
try {
public void processPacketInMessage(final PacketInMessage packetInMessage) {
messageSpy.spyMessage(packetInMessage.getImplementedInterface(), MessageSpy.STATISTIC_GROUP.FROM_SWITCH);
final ConnectionAdapter connectionAdapter = getPrimaryConnectionContext().getConnectionAdapter();
- final PacketReceived packetReceived = packetInTranslator.translate(packetInMessage, this, null);
+ final PacketReceived packetReceived = packetInTranslator.translate(packetInMessage, this.getDeviceState(), null);
if (packetReceived == null) {
LOG.debug("Received a null packet from switch {}", connectionAdapter.getRemoteAddress());
public final class AggregateFlowsInTableService extends AbstractCompatibleStatService<GetAggregateFlowStatisticsFromFlowTableForAllFlowsInput,
GetAggregateFlowStatisticsFromFlowTableForAllFlowsOutput, AggregateFlowStatisticsUpdate> {
- public AggregateFlowsInTableService(final RequestContextStack requestContextStack, final DeviceContext deviceContext, AtomicLong compatibilityXidSeed) {
+ final TranslatorLibrary translatorLibrary;
+
+ public static AggregateFlowsInTableService createWithOook(final RequestContextStack requestContextStack,
+ final DeviceContext deviceContext,
+ AtomicLong compatibilityXidSeed) {
+ return new AggregateFlowsInTableService(requestContextStack, deviceContext, compatibilityXidSeed, deviceContext.oook());
+ }
+
+ public AggregateFlowsInTableService(final RequestContextStack requestContextStack, final DeviceContext deviceContext,
+ AtomicLong compatibilityXidSeed, TranslatorLibrary translatorLibrary) {
super(requestContextStack, deviceContext, compatibilityXidSeed);
+
+ this.translatorLibrary = translatorLibrary;
}
@Override
final int mpSize = result.size();
Preconditions.checkArgument(mpSize == 1, "unexpected (!=1) mp-reply size received: {}", mpSize);
- TranslatorLibrary translatorLibrary = getDeviceContext().oook();
MultipartReply mpReply = result.get(0);
final TranslatorKey translatorKey = new TranslatorKey(mpReply.getVersion(), MultipartReplyAggregateCase.class.getName());
final MessageTranslator<MultipartReply, AggregatedFlowStatistics> messageTranslator = translatorLibrary.lookupTranslator(translatorKey);
- final AggregatedFlowStatistics flowStatistics = messageTranslator.translate(mpReply, getDeviceContext(), null);
+ final AggregatedFlowStatistics flowStatistics = messageTranslator.translate(mpReply, getDeviceContext().getDeviceState(), null);
final AggregateFlowStatisticsUpdateBuilder notification = new AggregateFlowStatisticsUpdateBuilder(flowStatistics)
.setId(getDeviceContext().getDeviceState().getNodeId())
.setMoreReplies(Boolean.FALSE)
@Override
public RpcResult<GetAggregateFlowStatisticsFromFlowTableForGivenMatchOutput> apply(final RpcResult<List<MultipartReply>> input) {
final DeviceContext deviceContext = matchingFlowsInTable.getDeviceContext();
- TranslatorLibrary translatorLibrary = deviceContext.oook();
final RpcResult<GetAggregateFlowStatisticsFromFlowTableForGivenMatchOutput> rpcResult;
if (input.isSuccessful()) {
MultipartReply reply = input.getResult().get(0);
List<AggregatedFlowStatistics> aggregStats = new ArrayList<AggregatedFlowStatistics>();
for (MultipartReply multipartReply : input.getResult()) {
- aggregStats.add(messageTranslator.translate(multipartReply, deviceContext, null));
+ aggregStats.add(messageTranslator.translate(multipartReply, deviceContext.getDeviceState(), null));
}
GetAggregateFlowStatisticsFromFlowTableForGivenMatchOutputBuilder getAggregateFlowStatisticsFromFlowTableForGivenMatchOutputBuilder =
};
private final MatchingFlowsInTableService matchingFlowsInTable;
+ private final TranslatorLibrary translatorLibrary;
private OpendaylightFlowStatisticsService delegate;
- public OpendaylightFlowStatisticsServiceImpl(final RequestContextStack requestContextStack, final DeviceContext deviceContext) {
+ public static OpendaylightFlowStatisticsServiceImpl createWithOook(final RequestContextStack requestContextStack,
+ final DeviceContext deviceContext) {
+ return new OpendaylightFlowStatisticsServiceImpl(requestContextStack, deviceContext, deviceContext.oook());
+ }
+
+ public OpendaylightFlowStatisticsServiceImpl(final RequestContextStack requestContextStack, final DeviceContext deviceContext,
+ final TranslatorLibrary translatorLibrary) {
matchingFlowsInTable = new MatchingFlowsInTableService(requestContextStack, deviceContext);
+ this.translatorLibrary = translatorLibrary;
}
@Override
final NotificationPublishService notificationService,
final AtomicLong compatibilityXidSeed) {
this.notificationService = notificationService;
- aggregateFlowsInTable = new AggregateFlowsInTableService(requestContextStack, deviceContext, compatibilityXidSeed);
+ aggregateFlowsInTable = AggregateFlowsInTableService.createWithOook(requestContextStack, deviceContext, compatibilityXidSeed);
allFlowsInAllTables = new AllFlowsInAllTablesService(requestContextStack, deviceContext, compatibilityXidSeed);
allFlowsInTable = new AllFlowsInTableService(requestContextStack, deviceContext, compatibilityXidSeed);
flowsInTable = new FlowsInTableService(requestContextStack, deviceContext, compatibilityXidSeed);
package org.opendaylight.openflowplugin.impl.translator;
import org.opendaylight.openflowplugin.api.openflow.device.DeviceContext;
+import org.opendaylight.openflowplugin.api.openflow.device.DeviceState;
import org.opendaylight.openflowplugin.api.openflow.device.MessageTranslator;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev100924.Counter32;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev100924.Counter64;
*/
public class AggregatedFlowStatisticsTranslator implements MessageTranslator<MultipartReply, AggregatedFlowStatistics> {
@Override
- public AggregatedFlowStatistics translate(final MultipartReply input, final DeviceContext deviceContext, final Object connectionDistinguisher) {
+ public AggregatedFlowStatistics translate(final MultipartReply input, final DeviceState deviceState, final Object connectionDistinguisher) {
AggregatedFlowStatisticsBuilder aggregatedFlowStatisticsBuilder = new AggregatedFlowStatisticsBuilder();
MultipartReplyAggregateCase caseBody = (MultipartReplyAggregateCase)input.getMultipartReplyBody();
package org.opendaylight.openflowplugin.impl.translator;
import org.opendaylight.openflowplugin.api.openflow.device.DeviceContext;
+import org.opendaylight.openflowplugin.api.openflow.device.DeviceState;
import org.opendaylight.openflowplugin.api.openflow.device.MessageTranslator;
import org.opendaylight.openflowplugin.api.openflow.md.util.OpenflowVersion;
import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.match.MatchConvertorImpl;
public class FlowRemovedTranslator implements MessageTranslator<FlowRemoved, org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.FlowRemoved> {
@Override
- public org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.FlowRemoved translate(FlowRemoved input, DeviceContext deviceContext, Object connectionDistinguisher) {
+ public org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.FlowRemoved translate(FlowRemoved input, DeviceState deviceState, Object connectionDistinguisher) {
FlowRemovedBuilder flowRemovedBld = new FlowRemovedBuilder()
- .setMatch(translateMatch(input, deviceContext).build())
+ .setMatch(translateMatch(input, deviceState).build())
.setCookie(new FlowCookie(input.getCookie()))
- .setNode(new NodeRef(deviceContext.getDeviceState().getNodeInstanceIdentifier()))
+ .setNode(new NodeRef(deviceState.getNodeInstanceIdentifier()))
.setPriority(input.getPriority())
.setTableId(input.getTableId().getValue().shortValue());
return flowRemovedBld.build();
}
- protected MatchBuilder translateMatch(FlowRemoved flowRemoved, DeviceContext deviceContext) {
+ protected MatchBuilder translateMatch(FlowRemoved flowRemoved, DeviceState deviceState) {
return MatchConvertorImpl.fromOFMatchToSALMatch(flowRemoved.getMatch(),
- deviceContext.getDeviceState().getFeatures().getDatapathId(), OpenflowVersion.OF13);
+ deviceState.getFeatures().getDatapathId(), OpenflowVersion.OF13);
}
}
package org.opendaylight.openflowplugin.impl.translator;
import org.opendaylight.openflowplugin.api.openflow.device.DeviceContext;
+import org.opendaylight.openflowplugin.api.openflow.device.DeviceState;
import org.opendaylight.openflowplugin.api.openflow.md.util.OpenflowVersion;
import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.match.MatchConvertorImpl;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
*/
public class FlowRemovedV10Translator extends FlowRemovedTranslator {
- protected MatchBuilder translateMatch(FlowRemoved flowRemoved, DeviceContext deviceContext) {
+ @Override
+ protected MatchBuilder translateMatch(FlowRemoved flowRemoved, DeviceState deviceState) {
return MatchConvertorImpl.fromOFMatchV10ToSALMatch(flowRemoved.getMatchV10(),
- deviceContext.getDeviceState().getFeatures().getDatapathId(), OpenflowVersion.OF10);
+ deviceState.getFeatures().getDatapathId(), OpenflowVersion.OF10);
}
}
import java.math.BigInteger;
import java.util.List;
import org.opendaylight.openflowplugin.api.openflow.device.DeviceContext;
+import org.opendaylight.openflowplugin.api.openflow.device.DeviceState;
import org.opendaylight.openflowplugin.api.openflow.device.MessageTranslator;
import org.opendaylight.openflowplugin.api.openflow.md.util.OpenflowVersion;
import org.opendaylight.openflowplugin.extension.api.AugmentTuple;
*/
public class PacketReceivedTranslator implements MessageTranslator<PacketInMessage, PacketReceived> {
@Override
- public PacketReceived translate(final PacketInMessage input, final DeviceContext deviceContext, final Object connectionDistinguisher) {
+ public PacketReceived translate(final PacketInMessage input, final DeviceState deviceState, final Object connectionDistinguisher) {
PacketReceivedBuilder packetReceivedBuilder = new PacketReceivedBuilder();
- BigInteger datapathId = deviceContext.getPrimaryConnectionContext().getFeatures().getDatapathId();
+ BigInteger datapathId = deviceState.getFeatures().getDatapathId();
// TODO: connection cookie from connection distinguisher
// packetReceivedBuilder.setConnectionCookie(new ConnectionCookie(input.getCookie().longValue()));
}
// Try to create the NodeConnectorRef
- BigInteger dataPathId = deviceContext.getDeviceState().getFeatures().getDatapathId();
+ BigInteger dataPathId = deviceState.getFeatures().getDatapathId();
NodeConnectorRef nodeConnectorRef = NodeConnectorRefToPortTranslator.toNodeConnectorRef(input, dataPathId);
// If we was able to create NodeConnectorRef, use it
import java.util.Collections;
import org.opendaylight.openflowplugin.api.OFConstants;
import org.opendaylight.openflowplugin.api.openflow.device.DeviceContext;
+import org.opendaylight.openflowplugin.api.openflow.device.DeviceState;
import org.opendaylight.openflowplugin.api.openflow.device.MessageTranslator;
import org.opendaylight.openflowplugin.openflow.md.util.PortTranslatorUtil;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNodeConnector;
@Override
public FlowCapableNodeConnector translate(final PortGrouping input,
- final DeviceContext deviceContext, final Object connectionDistinguisher) {
+ final DeviceState deviceState, final Object connectionDistinguisher) {
final FlowCapableNodeConnectorBuilder builder = new FlowCapableNodeConnectorBuilder();
//OF1.0
- if (deviceContext.getDeviceState().getVersion() == OFConstants.OFP_VERSION_1_0) {
+ if (deviceState.getVersion() == OFConstants.OFP_VERSION_1_0) {
builder.setAdvertisedFeatures(PortTranslatorUtil.translatePortFeatures(input.getAdvertisedFeaturesV10()));
builder.setConfiguration(PortTranslatorUtil.translatePortConfig(input.getConfigV10()));
builder.setCurrentFeature(PortTranslatorUtil.translatePortFeatures(input.getCurrentFeaturesV10()));
builder.setPeerFeatures(PortTranslatorUtil.translatePortFeatures(input.getPeerFeaturesV10()));
builder.setState(PortTranslatorUtil.translatePortState(input.getStateV10()));
builder.setSupported(PortTranslatorUtil.translatePortFeatures(input.getSupportedFeaturesV10()));
- } else if (deviceContext.getDeviceState().getVersion() == OFConstants.OFP_VERSION_1_3) {
+ } else if (deviceState.getVersion() == OFConstants.OFP_VERSION_1_3) {
builder.setAdvertisedFeatures(PortTranslatorUtil.translatePortFeatures(input.getAdvertisedFeatures()));
builder.setConfiguration(PortTranslatorUtil.translatePortConfig(input.getConfig()));
builder.setCurrentFeature(PortTranslatorUtil.translatePortFeatures(input.getCurrentFeatures()));
final BigInteger dataPathId = deviceContext.getPrimaryConnectionContext().getFeatures().getDatapathId();
for (final PortGrouping port : connectionContext.getFeatures().getPhyPort()) {
- final FlowCapableNodeConnector fcNodeConnector = translator.translate(port, deviceContext, null);
+ final FlowCapableNodeConnector fcNodeConnector = translator.translate(port, deviceContext.getDeviceState(), null);
final NodeConnectorId nodeConnectorId = NodeStaticReplyTranslatorUtil.nodeConnectorId(
dataPathId.toString(), port.getPortNo(), ofVersion);
final TranslatorKey translatorKey = new TranslatorKey(ofVersion, PortGrouping.class.getName());
final MessageTranslator<PortGrouping, FlowCapableNodeConnector> translator = dContext.oook()
.lookupTranslator(translatorKey);
- final FlowCapableNodeConnector fcNodeConnector = translator.translate(port, dContext, null);
+ final FlowCapableNodeConnector fcNodeConnector = translator.translate(port, dContext.getDeviceState(), null);
final BigInteger dataPathId = dContext.getPrimaryConnectionContext().getFeatures()
.getDatapathId();
rpcContext.registerRpcServiceImplementation(SalPortService.class, new SalPortServiceImpl(rpcContext, deviceContext));
rpcContext.registerRpcServiceImplementation(PacketProcessingService.class, new PacketProcessingServiceImpl(rpcContext, deviceContext));
rpcContext.registerRpcServiceImplementation(NodeConfigService.class, new NodeConfigServiceImpl(rpcContext, deviceContext));
- rpcContext.registerRpcServiceImplementation(OpendaylightFlowStatisticsService.class, new OpendaylightFlowStatisticsServiceImpl(rpcContext, deviceContext));
+ rpcContext.registerRpcServiceImplementation(OpendaylightFlowStatisticsService.class, OpendaylightFlowStatisticsServiceImpl.createWithOook(rpcContext, deviceContext));
final SalFlatBatchServiceImpl salFlatBatchService = new SalFlatBatchServiceImpl(
new SalFlowsBatchServiceImpl(salFlowService, flowCapableTransactionService),
Mockito.when(featuresOutput.getDatapathId()).thenReturn(DUMMY_DATAPATH_ID);
Mockito.when(featuresOutput.getVersion()).thenReturn(OFConstants.OFP_VERSION_1_3);
Mockito.when(deviceState.getFeatures()).thenReturn(featuresOutput);
- Mockito.when(messageTranslatorPacketReceived.translate(any(Object.class), any(DeviceContext.class), any(Object.class))).thenReturn(mock(PacketReceived.class));
- Mockito.when(messageTranslatorFlowCapableNodeConnector.translate(any(Object.class), any(DeviceContext.class), any(Object.class))).thenReturn(mock(FlowCapableNodeConnector.class));
+ Mockito.when(messageTranslatorPacketReceived.translate(any(Object.class), any(DeviceState.class), any(Object.class))).thenReturn(mock(PacketReceived.class));
+ Mockito.when(messageTranslatorFlowCapableNodeConnector.translate(any(Object.class), any(DeviceState.class), any(Object.class))).thenReturn(mock(FlowCapableNodeConnector.class));
Mockito.when(translatorLibrary.lookupTranslator(eq(new TranslatorKey(OFConstants.OFP_VERSION_1_3, PacketIn.class.getName())))).thenReturn(messageTranslatorPacketReceived);
Mockito.when(translatorLibrary.lookupTranslator(eq(new TranslatorKey(OFConstants.OFP_VERSION_1_3, PortGrouping.class.getName())))).thenReturn(messageTranslatorFlowCapableNodeConnector);
Mockito.when(translatorLibrary.lookupTranslator(eq(new TranslatorKey(OFConstants.OFP_VERSION_1_3,
.setCookie(new FlowCookie(BigInteger.ONE))
.setMatch(new MatchBuilder().build());
- Mockito.when(messageTranslatorFlowRemoved.translate(any(Object.class), any(DeviceContext.class), any(Object.class)))
+ Mockito.when(messageTranslatorFlowRemoved.translate(any(Object.class), any(DeviceState.class), any(Object.class)))
.thenReturn(flowRemovedMdsalBld.build());
// insert flow+flowId into local registry
.setPortNo(41L);
when(mockFeatures.getPhyPort()).thenReturn(Collections.singletonList(phyPort.build()));
final MessageTranslator<Object, Object> mockedTranslator = mock(MessageTranslator.class);
- when(mockedTranslator.translate(Matchers.<Object>any(), Matchers.<DeviceContext>any(), Matchers.any()))
+ when(mockedTranslator.translate(Matchers.<Object>any(), Matchers.<DeviceState>any(), Matchers.any()))
.thenReturn(null);
when(translatorLibrary.lookupTranslator(Matchers.<TranslatorKey>any())).thenReturn(mockedTranslator);
private OpendaylightFlowStatisticsServiceImpl flowStatisticsService;
public void setUp() {
- flowStatisticsService = new OpendaylightFlowStatisticsServiceImpl(rqContextStack, deviceContext);
+ flowStatisticsService = OpendaylightFlowStatisticsServiceImpl.createWithOook(rqContextStack, deviceContext);
rqContext = new AbstractRequestContext<Object>(42L) {
@Override
public void setUp() {
- flowStatisticsService = new OpendaylightFlowStatisticsServiceImpl(rqContextStack, deviceContext);
+ flowStatisticsService = OpendaylightFlowStatisticsServiceImpl.createWithOook(rqContextStack, deviceContext);
rqContextMp = new AbstractRequestContext<List<MultipartReply>>(42L) {
@Override
}
).when(multiMsgCollector).endCollecting(Matchers.any(EventIdentifier.class));
Mockito.when(translator.translate(
- Matchers.any(MultipartReply.class), Matchers.same(deviceContext), Matchers.isNull())
+ Matchers.any(MultipartReply.class), Matchers.same(deviceState), Matchers.isNull())
).thenReturn(new AggregatedFlowStatisticsBuilder().build());
private OpendaylightFlowStatisticsServiceImpl flowStatisticsService;
public void setUp() {
- flowStatisticsService = new OpendaylightFlowStatisticsServiceImpl(rqContextStack, deviceContext);
+ flowStatisticsService = OpendaylightFlowStatisticsServiceImpl.createWithOook(rqContextStack, deviceContext);
flowStatisticsService.setDelegate(flowStatisticsDelegate);
}
Mockito.when(translatorLibrary.lookupTranslator(Matchers.any(TranslatorKey.class))).thenReturn(translator);
- service = new AggregateFlowsInTableService(rqContextStack, deviceContext, new AtomicLong(20L));
+ service = AggregateFlowsInTableService.createWithOook(rqContextStack, deviceContext, new AtomicLong(20L));
}
@Test
.setFlowCount(new Counter32(12L))
.setPacketCount(new Counter64(BigInteger.valueOf(13L)))
.build();
- Mockito.when(translator.translate(Matchers.any(MultipartReply.class), Matchers.eq(deviceContext), Matchers.any()))
+ Mockito.when(translator.translate(Matchers.any(MultipartReply.class), Matchers.eq(deviceState), Matchers.any()))
.thenReturn(aggregatedStats);
.setNode(createNodeRef("unitProt:123"))
.setTableId(new TableId((short) 1));
- Mockito.when(translator.translate(Matchers.any(MultipartReply.class), Matchers.eq(deviceContext), Matchers.any()))
+ Mockito.when(translator.translate(Matchers.any(MultipartReply.class), Matchers.eq(deviceState), Matchers.any()))
.thenReturn(new AggregatedFlowStatisticsBuilder()
.setByteCount(new Counter64(BigInteger.valueOf(50L)))
.setPacketCount(new Counter64(BigInteger.valueOf(51L)))
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;
import org.opendaylight.openflowplugin.api.openflow.device.DeviceContext;
+import org.opendaylight.openflowplugin.api.openflow.device.DeviceState;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.get.aggregate.flow.statistics.from.flow.table._for.given.match.output.AggregatedFlowStatistics;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.MultipartReplyMessageBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.MultipartReplyAggregateCaseBuilder;
private AggregatedFlowStatisticsTranslator translator;
@Mock
- private DeviceContext deviceContext;
+ private DeviceState deviceState;
@Before
public void setUp() throws Exception {
MultipartReplyMessageBuilder mpInputBld = new MultipartReplyMessageBuilder()
.setMultipartReplyBody(inputBld.build());
- final AggregatedFlowStatistics statistics = translator.translate(mpInputBld.build(), deviceContext, null);
+ final AggregatedFlowStatistics statistics = translator.translate(mpInputBld.build(), deviceState, null);
Assert.assertEquals(aggregateStatsValueBld.getByteCount(), statistics.getByteCount().getValue());
Assert.assertEquals(aggregateStatsValueBld.getFlowCount(), statistics.getFlowCount().getValue());
@Test
public void testTranslate() throws Exception {
org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.FlowRemoved flowRemovedMessage = buildMessage(false);
- final FlowRemoved flowRemoved = translator.translate(flowRemovedMessage, deviceContext, null);
+ final FlowRemoved flowRemoved = translator.translate(flowRemovedMessage, deviceState, null);
assertEquals(flowRemovedMessage.getCookie(), flowRemoved.getCookie().getValue());
assertEquals(flowRemovedMessage.getPriority(), flowRemoved.getPriority());
@Test
public void testTranslateV10() throws Exception {
org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.FlowRemoved flowRemovedMessage = buildMessage(true);
- final FlowRemoved flowRemoved = translatorV10.translate(flowRemovedMessage, deviceContext, null);
+ final FlowRemoved flowRemoved = translatorV10.translate(flowRemovedMessage, deviceState, null);
assertEquals(flowRemovedMessage.getCookie(), flowRemoved.getCookie().getValue());
assertEquals(flowRemovedMessage.getPriority(), flowRemoved.getPriority());
final PacketInMessage packetInMessage = createPacketInMessage(DATA.getBytes(), PORT_NO);
Mockito.when(deviceState.getNodeInstanceIdentifier()).thenReturn(nodePath);
- final PacketReceived packetReceived = packetReceivedTranslator.translate(packetInMessage, deviceContext, null);
+ final PacketReceived packetReceived = packetReceivedTranslator.translate(packetInMessage, deviceState, null);
Assert.assertArrayEquals(packetInMessage.getData(), packetReceived.getPayload());
Assert.assertEquals("org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.SendToController",
.getDefaultInstance("hundredGbFd");
- final FlowCapableNodeConnector nodeConnector = portUpdateTranslator.translate(portBld.build(), deviceContext, null);
+ final FlowCapableNodeConnector nodeConnector = portUpdateTranslator.translate(portBld.build(), deviceState, null);
commonCheck(nodeConnector);
null, false, false, null, null, null, null, null
);
- final FlowCapableNodeConnector nodeConnector = portUpdateTranslator.translate(portBld.build(), deviceContext, null);
+ final FlowCapableNodeConnector nodeConnector = portUpdateTranslator.translate(portBld.build(), deviceState, null);
commonCheck(nodeConnector);