X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=openflowplugin-impl%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fopenflowplugin%2Fimpl%2Fstatistics%2Fservices%2FFlowsInTableService.java;h=048fd71c84d092351890607d411a88085906b4c2;hb=e2c931cd748cbcfc0dbfab7b8d97061507aacc92;hp=a875c0d6e316a5785becf5cb4b40806b599778e4;hpb=617a0726d931230945a8a8d28a6e34be39f56b16;p=openflowplugin.git diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/services/FlowsInTableService.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/services/FlowsInTableService.java index a875c0d6e3..048fd71c84 100644 --- a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/services/FlowsInTableService.java +++ b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/services/FlowsInTableService.java @@ -1,4 +1,4 @@ -/** +/* * Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved. * * This program and the accompanying materials are made available under the @@ -8,17 +8,18 @@ package org.opendaylight.openflowplugin.impl.statistics.services; import java.util.List; +import java.util.Optional; import java.util.concurrent.atomic.AtomicLong; import org.opendaylight.openflowplugin.api.OFConstants; import org.opendaylight.openflowplugin.api.openflow.device.DeviceContext; import org.opendaylight.openflowplugin.api.openflow.device.RequestContextStack; import org.opendaylight.openflowplugin.api.openflow.device.Xid; import org.opendaylight.openflowplugin.impl.services.util.RequestInputUtils; -import org.opendaylight.openflowplugin.impl.services.util.ServiceException; import org.opendaylight.openflowplugin.impl.statistics.services.compatibility.AbstractCompatibleStatService; import org.opendaylight.openflowplugin.impl.statistics.services.compatibility.FlowStatisticsToNotificationTransformer; import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.ConvertorExecutor; -import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.match.MatchReactor; +import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.data.VersionConvertorData; +import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.match.MatchInjector; import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.FlowsStatisticsUpdate; import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.GetFlowStatisticsFromFlowTableInput; import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.GetFlowStatisticsFromFlowTableOutput; @@ -35,14 +36,20 @@ public final class FlowsInTableService extends AbstractCompatibleStatService { private final ConvertorExecutor convertorExecutor; + private final VersionConvertorData data; - public FlowsInTableService(final RequestContextStack requestContextStack, final DeviceContext deviceContext, AtomicLong compatibilityXidSeed, ConvertorExecutor convertorExecutor) { + public FlowsInTableService(final RequestContextStack requestContextStack, + final DeviceContext deviceContext, + AtomicLong compatibilityXidSeed, + ConvertorExecutor convertorExecutor) { super(requestContextStack, deviceContext, compatibilityXidSeed); this.convertorExecutor = convertorExecutor; + this.data = new VersionConvertorData(getVersion()); } @Override - protected OfHeader buildRequest(final Xid xid, final GetFlowStatisticsFromFlowTableInput input) throws ServiceException { + protected OfHeader buildRequest(final Xid xid, + final GetFlowStatisticsFromFlowTableInput input) { final MultipartRequestFlowCaseBuilder multipartRequestFlowCaseBuilder = new MultipartRequestFlowCaseBuilder(); final MultipartRequestFlowBuilder mprFlowRequestBuilder = new MultipartRequestFlowBuilder(); @@ -77,13 +84,13 @@ public final class FlowsInTableService extends AbstractCompatibleStatService conversionMatch = convertorExecutor.convert(input.getMatch(), data); + MatchInjector.inject(conversionMatch, mprFlowRequestBuilder, data.getVersion()); // Set request body to main multipart request multipartRequestFlowCaseBuilder.setMultipartRequestFlow(mprFlowRequestBuilder.build()); final MultipartRequestInputBuilder mprInput = RequestInputUtils.createMultipartHeader( - MultipartType.OFPMPFLOW, xid.getValue(), version); + MultipartType.OFPMPFLOW, xid.getValue(), getVersion()); mprInput.setMultipartRequestBody(multipartRequestFlowCaseBuilder.build()); return mprInput.build(); @@ -96,6 +103,10 @@ public final class FlowsInTableService extends AbstractCompatibleStatService result, TransactionId emulatedTxId) { - return FlowStatisticsToNotificationTransformer.transformToNotification(result, getDeviceInfo(), getOfVersion(), emulatedTxId, convertorExecutor); + return FlowStatisticsToNotificationTransformer.transformToNotification(result, + getDeviceInfo(), + getOfVersion(), + emulatedTxId, + convertorExecutor); } }