augment "/multipart:multipart-request/multipart:multipart-request-body" {
case multipart-request-flow-stats {
- uses flow;
+ container flow-stats {
+ uses flow;
+ }
}
case multipart-request-flow-aggregate-stats {
- uses flow;
+ container flow-aggregate-stats {
+ uses flow;
+ }
}
}
}
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.multipart.request.multipart.request.body.MultipartRequestPortDescBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.multipart.request.multipart.request.body.MultipartRequestFlowAggregateStatsBuilder;
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.flow.types.rev131026.multipart.request.multipart.request.body.multipart.request.flow.stats.FlowStatsBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.multipart.request.multipart.request.body.MultipartRequestGroupDescBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.multipart.request.multipart.request.body.MultipartRequestGroupFeaturesBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.multipart.request.multipart.request.body.MultipartRequestGroupStatsBuilder;
.MultipartRequestBody makeDefaultSingleLayerBody(final MultipartType type) {
switch (type) {
case OFPMPDESC: return new MultipartRequestDescBuilder().build();
- case OFPMPFLOW: return new MultipartRequestFlowStatsBuilder()
+ case OFPMPFLOW: return new MultipartRequestFlowStatsBuilder().setFlowStats(new FlowStatsBuilder()
.setMatch(new org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow
- .MatchBuilder().build())
- .build();
+ .MatchBuilder().build()).build()).build();
case OFPMPAGGREGATE: return new MultipartRequestFlowAggregateStatsBuilder().build();
case OFPMPTABLE: return new MultipartRequestFlowTableStatsBuilder().build();
case OFPMPPORTSTATS: return new org.opendaylight.yang.gen.v1.urn.opendaylight.port.statistics
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.openflowplugin.impl.protocol.serialization.multipart;
import com.google.common.base.MoreObjects;
import org.opendaylight.openflowplugin.api.OFConstants;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.FlowCookie;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.multipart.request.multipart.request.body.MultipartRequestFlowAggregateStats;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.multipart.request.multipart.request.body.multipart.request.flow.aggregate.stats.FlowAggregateStats;
import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.Match;
public class MultipartRequestFlowAggregateStatsSerializer implements OFSerializer<MultipartRequestFlowAggregateStats>,
@Override
public void serialize(final MultipartRequestFlowAggregateStats multipartRequestFlowAggregateStats,
final ByteBuf byteBuf) {
- byteBuf.writeByte(MoreObjects.firstNonNull(multipartRequestFlowAggregateStats.getTableId(),
- OFConstants.OFPTT_ALL).byteValue());
+ final FlowAggregateStats stats = multipartRequestFlowAggregateStats.getFlowAggregateStats();
+ byteBuf.writeByte(MoreObjects.firstNonNull(stats.getTableId(), OFConstants.OFPTT_ALL).byteValue());
byteBuf.writeZero(PADDING_IN_MULTIPART_REQUEST_FLOW_BODY_01);
- byteBuf.writeInt(MoreObjects.firstNonNull(multipartRequestFlowAggregateStats.getOutPort(),
- OFConstants.OFPP_ANY).intValue());
- byteBuf.writeInt(MoreObjects.firstNonNull(multipartRequestFlowAggregateStats.getOutGroup(),
- OFConstants.OFPG_ANY).intValue());
+ byteBuf.writeInt(MoreObjects.firstNonNull(stats.getOutPort(), OFConstants.OFPP_ANY).intValue());
+ byteBuf.writeInt(MoreObjects.firstNonNull(stats.getOutGroup(), OFConstants.OFPG_ANY).intValue());
byteBuf.writeZero(PADDING_IN_MULTIPART_REQUEST_FLOW_BODY_02);
- byteBuf.writeLong(MoreObjects.firstNonNull(multipartRequestFlowAggregateStats.getCookie(),
+ byteBuf.writeLong(MoreObjects.firstNonNull(stats.getCookie(),
new FlowCookie(OFConstants.DEFAULT_COOKIE)).getValue().longValue());
- byteBuf.writeLong(MoreObjects.firstNonNull(multipartRequestFlowAggregateStats.getCookieMask(),
+ byteBuf.writeLong(MoreObjects.firstNonNull(stats.getCookieMask(),
new FlowCookie(OFConstants.DEFAULT_COOKIE_MASK)).getValue().longValue());
Preconditions.checkNotNull(registry).<Match, OFSerializer<Match>>getSerializer(
new MessageTypeKey<>(EncodeConstants.OF13_VERSION_ID, Match.class))
- .serialize(multipartRequestFlowAggregateStats.getMatch(), byteBuf);
+ .serialize(stats.getMatch(), byteBuf);
}
@Override
import org.opendaylight.openflowplugin.api.OFConstants;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.FlowCookie;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.multipart.request.multipart.request.body.MultipartRequestFlowStats;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.multipart.request.multipart.request.body.multipart.request.flow.stats.FlowStats;
import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.Match;
public class MultipartRequestFlowStatsSerializer implements OFSerializer<MultipartRequestFlowStats>,
@Override
public void serialize(final MultipartRequestFlowStats multipartRequestFlowStats, final ByteBuf byteBuf) {
- byteBuf.writeByte(MoreObjects.firstNonNull(multipartRequestFlowStats.getTableId(),
- OFConstants.OFPTT_ALL).byteValue());
+ final FlowStats stats = multipartRequestFlowStats.getFlowStats();
+ byteBuf.writeByte(MoreObjects.firstNonNull(stats.getTableId(), OFConstants.OFPTT_ALL).byteValue());
byteBuf.writeZero(PADDING_IN_MULTIPART_REQUEST_FLOW_BODY_01);
- byteBuf.writeInt(MoreObjects.firstNonNull(multipartRequestFlowStats.getOutPort(),
- OFConstants.OFPP_ANY).intValue());
- byteBuf.writeInt(MoreObjects.firstNonNull(multipartRequestFlowStats.getOutGroup(),
- OFConstants.OFPG_ANY).intValue());
+ byteBuf.writeInt(MoreObjects.firstNonNull(stats.getOutPort(), OFConstants.OFPP_ANY).intValue());
+ byteBuf.writeInt(MoreObjects.firstNonNull(stats.getOutGroup(), OFConstants.OFPG_ANY).intValue());
byteBuf.writeZero(PADDING_IN_MULTIPART_REQUEST_FLOW_BODY_02);
- byteBuf.writeLong(MoreObjects.firstNonNull(multipartRequestFlowStats.getCookie(),
+ byteBuf.writeLong(MoreObjects.firstNonNull(stats.getCookie(),
new FlowCookie(OFConstants.DEFAULT_COOKIE)).getValue().longValue());
- byteBuf.writeLong(MoreObjects.firstNonNull(multipartRequestFlowStats.getCookieMask(),
+ byteBuf.writeLong(MoreObjects.firstNonNull(stats.getCookieMask(),
new FlowCookie(OFConstants.DEFAULT_COOKIE_MASK)).getValue().longValue());
Preconditions.checkNotNull(registry).<Match, OFSerializer<Match>>getSerializer(
new MessageTypeKey<>(EncodeConstants.OF13_VERSION_ID, Match.class))
- .serialize(multipartRequestFlowStats.getMatch(), byteBuf);
+ .serialize(stats.getMatch(), byteBuf);
}
@Override
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.get.aggregate.flow.statistics.from.flow.table._for.given.match.output.AggregatedFlowStatisticsBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.multipart.reply.multipart.reply.body.MultipartReplyFlowAggregateStats;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.multipart.request.multipart.request.body.MultipartRequestFlowAggregateStatsBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.multipart.request.multipart.request.body.multipart.request.flow.aggregate.stats.FlowAggregateStatsBuilder;
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;
.setXid(xid.getValue())
.setVersion(getVersion())
.setRequestMore(false)
- .setMultipartRequestBody(new MultipartRequestFlowAggregateStatsBuilder(input)
- .build())
+ .setMultipartRequestBody(new MultipartRequestFlowAggregateStatsBuilder()
+ .setFlowAggregateStats(new FlowAggregateStatsBuilder(input).build()).build())
.build();
}
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.flow.types.rev131026.multipart.request.multipart.request.body.multipart.request.flow.stats.FlowStatsBuilder;
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;
}
@Override
- protected GetFlowStatisticsOutput buildReply(List<MultipartReply> input, boolean success) {
+ protected GetFlowStatisticsOutput buildReply(final List<MultipartReply> input, final boolean success) {
return new GetFlowStatisticsOutputBuilder()
.setFlowAndStatisticsMapList(input
.stream()
.setXid(xid.getValue())
.setVersion(getVersion())
.setRequestMore(false)
- .setMultipartRequestBody(new MultipartRequestFlowStatsBuilder(input)
+ .setMultipartRequestBody(new MultipartRequestFlowStatsBuilder()
+ .setFlowStats(new FlowStatsBuilder(input).build())
.build())
.build();
}
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.multipart.request.multipart.request.body.MultipartRequestFlowAggregateStats;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.multipart.request.multipart.request.body.MultipartRequestFlowAggregateStatsBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.multipart.request.multipart.request.body.multipart.request.flow.aggregate.stats.FlowAggregateStatsBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.IpMatchBuilder;
public class MultipartRequestFlowAggregateStatsSerializerTest extends AbstractSerializerTest {
.build())
.build();
private static final MultipartRequestFlowAggregateStats BODY = new MultipartRequestFlowAggregateStatsBuilder()
- .setTableId(TABLE_ID)
- .setOutPort(OUT_PORT)
- .setOutGroup(OUT_GROUP)
- .setCookie(COOKIE)
- .setCookieMask(COOKIE_MASK)
- .setMatch(MATCH)
- .build();
+ .setFlowAggregateStats(new FlowAggregateStatsBuilder()
+ .setTableId(TABLE_ID)
+ .setOutPort(OUT_PORT)
+ .setOutGroup(OUT_GROUP)
+ .setCookie(COOKIE)
+ .setCookieMask(COOKIE_MASK)
+ .setMatch(MATCH)
+ .build()).build();
private MultipartRequestFlowAggregateStatsSerializer serializer;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.multipart.request.multipart.request.body.MultipartRequestFlowStats;
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.flow.types.rev131026.multipart.request.multipart.request.body.multipart.request.flow.stats.FlowStatsBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.IpMatchBuilder;
public class MultipartRequestFlowStatsSerializerTest extends AbstractSerializerTest {
.build())
.build();
private static final MultipartRequestFlowStats BODY = new MultipartRequestFlowStatsBuilder()
- .setTableId(TABLE_ID)
- .setOutPort(OUT_PORT)
- .setOutGroup(OUT_GROUP)
- .setCookie(COOKIE)
- .setCookieMask(COOKIE_MASK)
- .setMatch(MATCH)
- .build();
+ .setFlowStats(new FlowStatsBuilder()
+ .setTableId(TABLE_ID)
+ .setOutPort(OUT_PORT)
+ .setOutGroup(OUT_GROUP)
+ .setCookie(COOKIE)
+ .setCookieMask(COOKIE_MASK)
+ .setMatch(MATCH)
+ .build()).build();
private MultipartRequestFlowStatsSerializer serializer;
MultipartRequest.class.cast(ofHeader)
.getMultipartRequestBody());
- assertEquals(TABLE_ID, result.getTableId().shortValue());
+ assertEquals(TABLE_ID, result.getFlowAggregateStats().getTableId().shortValue());
}
@Test
.buildRequest(new Xid(42L), input))
.getMultipartRequestBody();
- assertEquals(TABLE_NO, body.getTableId());
+ assertEquals(TABLE_NO, body.getFlowStats().getTableId());
}
@Override