use of org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.flow.and.statistics.map.list.FlowAndStatisticsMapListKey in project openflowplugin by opendaylight.
the class FlowDirectStatisticsService method buildReply.
@Override
protected GetFlowStatisticsOutput buildReply(List<MultipartReply> input, boolean success) {
final List<FlowAndStatisticsMapList> statsList = new ArrayList<>();
if (success) {
for (final MultipartReply mpReply : input) {
final MultipartReplyFlowCase caseBody = (MultipartReplyFlowCase) mpReply.getMultipartReplyBody();
final MultipartReplyFlow replyBody = caseBody.getMultipartReplyFlow();
final Optional<List<FlowAndStatisticsMapList>> statsListPart = getConvertorExecutor().convert(replyBody.getFlowStats(), data);
statsListPart.ifPresent(flowAndStatisticsMapLists -> {
for (final FlowAndStatisticsMapList part : flowAndStatisticsMapLists) {
final FlowId flowId = new FlowId(generateFlowId(part).getValue());
statsList.add(new FlowAndStatisticsMapListBuilder(part).setKey(new FlowAndStatisticsMapListKey(flowId)).setFlowId(flowId).build());
}
});
}
}
return new GetFlowStatisticsOutputBuilder().setFlowAndStatisticsMapList(statsList).build();
}
Aggregations