X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=openflowplugin-impl%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fopenflowplugin%2Fimpl%2Fstatistics%2Fservices%2Fdirect%2Fsinglelayer%2FFlowDirectStatisticsService.java;h=e761e829d4e32e04f118a8bec478cece569cdc74;hb=137e4d7d86e8f402f3d52fd0fa162792f9ff60eb;hp=e2e47bed5bdcd13c537e00b5661f33ef64e40ad7;hpb=c373ae004e9e04a40ea9c3a7d7476fdf47faee09;p=openflowplugin.git diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/services/direct/singlelayer/FlowDirectStatisticsService.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/services/direct/singlelayer/FlowDirectStatisticsService.java index e2e47bed5b..e761e829d4 100644 --- a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/services/direct/singlelayer/FlowDirectStatisticsService.java +++ b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/services/direct/singlelayer/FlowDirectStatisticsService.java @@ -12,16 +12,22 @@ import java.util.List; import java.util.stream.Collectors; 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.datastore.MultipartWriterProvider; +import org.opendaylight.openflowplugin.impl.services.util.ServiceException; import org.opendaylight.openflowplugin.impl.statistics.services.direct.AbstractFlowDirectStatisticsService; import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.ConvertorExecutor; +import org.opendaylight.yang.gen.v1.urn.opendaylight.direct.statistics.rev160511.GetFlowStatisticsInput; import org.opendaylight.yang.gen.v1.urn.opendaylight.direct.statistics.rev160511.GetFlowStatisticsOutput; import org.opendaylight.yang.gen.v1.urn.opendaylight.direct.statistics.rev160511.GetFlowStatisticsOutputBuilder; import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.FlowId; import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.flow.and.statistics.map.list.FlowAndStatisticsMapListBuilder; import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.flow.and.statistics.map.list.FlowAndStatisticsMapListKey; import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.multipart.reply.multipart.reply.body.MultipartReplyFlowStats; +import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.multipart.request.multipart.request.body.MultipartRequestFlowStatsBuilder; import org.opendaylight.yang.gen.v1.urn.opendaylight.multipart.types.rev170112.MultipartReply; +import org.opendaylight.yang.gen.v1.urn.opendaylight.multipart.types.rev170112.MultipartRequestBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.OfHeader; public class FlowDirectStatisticsService extends AbstractFlowDirectStatisticsService { @@ -29,7 +35,8 @@ public class FlowDirectStatisticsService extends AbstractFlowDirectStatisticsSer final DeviceContext deviceContext, final ConvertorExecutor convertorExecutor, final MultipartWriterProvider statisticsWriterProvider) { - super(requestContextStack, deviceContext, convertorExecutor, statisticsWriterProvider); } + super(requestContextStack, deviceContext, convertorExecutor, statisticsWriterProvider); + } @Override protected GetFlowStatisticsOutput buildReply(List input, boolean success) { @@ -43,7 +50,7 @@ public class FlowDirectStatisticsService extends AbstractFlowDirectStatisticsSer .map(flowAndStatisticsMapList -> { final FlowId flowId = new FlowId(generateFlowId(flowAndStatisticsMapList)); return new FlowAndStatisticsMapListBuilder(flowAndStatisticsMapList) - .setKey(new FlowAndStatisticsMapListKey(flowId)) + .withKey(new FlowAndStatisticsMapListKey(flowId)) .setFlowId(flowId) .build(); }) @@ -51,4 +58,15 @@ public class FlowDirectStatisticsService extends AbstractFlowDirectStatisticsSer .build(); } + @Override + protected OfHeader buildRequest(final Xid xid, final GetFlowStatisticsInput input) throws ServiceException { + return new MultipartRequestBuilder() + .setXid(xid.getValue()) + .setVersion(getVersion()) + .setRequestMore(false) + .setMultipartRequestBody(new MultipartRequestFlowStatsBuilder(input) + .build()) + .build(); + } + }