use of org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.GroupDescStatsUpdatedBuilder in project openflowplugin by opendaylight.
the class GroupDescriptionService method transformToNotification.
@Override
public GroupDescStatsUpdated transformToNotification(List<MultipartReply> result, TransactionId emulatedTxId) {
GroupDescStatsUpdatedBuilder notification = new GroupDescStatsUpdatedBuilder();
notification.setId(getDeviceInfo().getNodeId());
notification.setMoreReplies(Boolean.FALSE);
notification.setTransactionId(emulatedTxId);
notification.setGroupDescStats(new ArrayList<>());
final VersionConvertorData data = new VersionConvertorData(getVersion());
for (MultipartReply mpReply : result) {
MultipartReplyGroupDescCase caseBody = (MultipartReplyGroupDescCase) mpReply.getMultipartReplyBody();
MultipartReplyGroupDesc replyBody = caseBody.getMultipartReplyGroupDesc();
final Optional<List<GroupDescStats>> groupDescStatsList = convertorExecutor.convert(replyBody.getGroupDesc(), data);
groupDescStatsList.ifPresent(groupDescStats -> notification.getGroupDescStats().addAll(groupDescStats));
}
return notification.build();
}
Aggregations