use of org.opendaylight.yang.gen.v1.urn.opendaylight.flow.table.statistics.rev131215.flow.table.and.statistics.map.FlowTableAndStatisticsMapKey in project openflowplugin by opendaylight.
the class FlowTableStatNotificationSupplierImpl method createNotification.
@Override
public FlowTableStatisticsUpdate createNotification(final FlowTableStatistics flowTableStatistics, final InstanceIdentifier<FlowTableStatistics> path) {
Preconditions.checkArgument(flowTableStatistics != null);
Preconditions.checkArgument(path != null);
final FlowTableAndStatisticsMapBuilder ftsmBuilder = new FlowTableAndStatisticsMapBuilder(flowTableStatistics);
ftsmBuilder.setKey(new FlowTableAndStatisticsMapKey(new TableId(path.firstKeyOf(Table.class, TableKey.class).getId())));
final FlowTableStatisticsUpdateBuilder builder = new FlowTableStatisticsUpdateBuilder();
builder.setId(getNodeId(path));
builder.setMoreReplies(Boolean.FALSE);
// NOTE : fix if it needs, but we have to ask DataStore for the NodeConnector list
builder.setNodeConnector(Collections.<NodeConnector>emptyList());
builder.setFlowTableAndStatisticsMap(Collections.singletonList(ftsmBuilder.build()));
return builder.build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.flow.table.statistics.rev131215.flow.table.and.statistics.map.FlowTableAndStatisticsMapKey in project openflowplugin by opendaylight.
the class MultipartReplyFlowTableStatsDeserializer method deserialize.
@Override
public MultipartReplyBody deserialize(ByteBuf message) {
final MultipartReplyFlowTableStatsBuilder builder = new MultipartReplyFlowTableStatsBuilder();
final List<FlowTableAndStatisticsMap> items = new ArrayList<>();
while (message.readableBytes() > 0) {
final FlowTableAndStatisticsMapBuilder itemBuilder = new FlowTableAndStatisticsMapBuilder().setTableId(new TableId(message.readUnsignedByte()));
message.skipBytes(PADDING_IN_TABLE_HEADER);
itemBuilder.setKey(new FlowTableAndStatisticsMapKey(itemBuilder.getTableId())).setActiveFlows(new Counter32(message.readUnsignedInt()));
final byte[] packetsLooked = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
message.readBytes(packetsLooked);
final byte[] packetsMatched = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
message.readBytes(packetsMatched);
items.add(itemBuilder.setPacketsLookedUp(new Counter64(new BigInteger(1, packetsLooked))).setPacketsMatched(new Counter64(new BigInteger(1, packetsMatched))).build());
}
return builder.setFlowTableAndStatisticsMap(items).build();
}
Aggregations