use of org.opendaylight.yang.gen.v1.urn.opendaylight.model.statistics.types.rev130925.duration.DurationBuilder in project openflowplugin by opendaylight.
the class GroupStatsResponseConvertor method convert.
@Override
public List<GroupStats> convert(List<org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.multipart.reply.group._case.multipart.reply.group.GroupStats> source, VersionConvertorData data) {
List<GroupStats> convertedSALGroups = new ArrayList<>();
for (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.multipart.reply.group._case.multipart.reply.group.GroupStats groupStats : source) {
GroupStatsBuilder salGroupStats = new GroupStatsBuilder();
salGroupStats.setBuckets(toSALBuckets(groupStats.getBucketStats()));
salGroupStats.setByteCount(new Counter64(groupStats.getByteCount()));
DurationBuilder time = new DurationBuilder();
time.setSecond(new Counter32(groupStats.getDurationSec()));
time.setNanosecond(new Counter32(groupStats.getDurationNsec()));
salGroupStats.setDuration(time.build());
salGroupStats.setGroupId(new GroupId(groupStats.getGroupId().getValue()));
salGroupStats.setPacketCount(new Counter64(groupStats.getPacketCount()));
salGroupStats.setRefCount(new Counter32(groupStats.getRefCount()));
salGroupStats.setKey(new GroupStatsKey(salGroupStats.getGroupId()));
convertedSALGroups.add(salGroupStats.build());
}
return convertedSALGroups;
}
Aggregations