use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestPortStatsCase in project openflowplugin by opendaylight.
the class MultipartRequestInputFactory method serializePortStatsBody.
private static void serializePortStatsBody(final MultipartRequestBody multipartRequestBody, final ByteBuf output) {
MultipartRequestPortStatsCase portstatsCase = (MultipartRequestPortStatsCase) multipartRequestBody;
MultipartRequestPortStats portstats = portstatsCase.getMultipartRequestPortStats();
output.writeInt(portstats.getPortNo().intValue());
output.writeZero(PADDING_IN_MULTIPART_REQUEST_PORTSTATS_BODY);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestPortStatsCase in project openflowplugin by opendaylight.
the class OF10StatsRequestInputFactory method serializePortBody.
private static void serializePortBody(final MultipartRequestBody multipartRequestBody, final ByteBuf output) {
MultipartRequestPortStatsCase portstatsCase = (MultipartRequestPortStatsCase) multipartRequestBody;
MultipartRequestPortStats portstats = portstatsCase.getMultipartRequestPortStats();
output.writeShort(portstats.getPortNo().intValue());
output.writeZero(PADDING_IN_MULTIPART_REQUEST_PORT_BODY);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestPortStatsCase in project openflowplugin by opendaylight.
the class MultipartRequestInputMessageFactory method setPortStats.
private MultipartRequestPortStatsCase setPortStats(ByteBuf input) {
MultipartRequestPortStatsCaseBuilder caseBuilder = new MultipartRequestPortStatsCaseBuilder();
MultipartRequestPortStatsBuilder portBuilder = new MultipartRequestPortStatsBuilder();
portBuilder.setPortNo(input.readUnsignedInt());
caseBuilder.setMultipartRequestPortStats(portBuilder.build());
return caseBuilder.build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestPortStatsCase in project openflowplugin by opendaylight.
the class PortStatsServiceTest method testBuildRequest.
@Test
public void testBuildRequest() throws Exception {
Xid xid = new Xid(42L);
GetNodeConnectorStatisticsInputBuilder input = new GetNodeConnectorStatisticsInputBuilder().setNodeConnectorId(new NodeConnectorId("junitProto:11:12")).setNode(createNodeRef("junitProto:11"));
final OfHeader request = portStatsService.buildRequest(xid, input.build());
Assert.assertTrue(request instanceof MultipartRequestInput);
final MultipartRequestInput mpRequest = (MultipartRequestInput) request;
Assert.assertTrue(mpRequest.getMultipartRequestBody() instanceof MultipartRequestPortStatsCase);
final MultipartRequestPortStatsCase mpRequestBody = (MultipartRequestPortStatsCase) mpRequest.getMultipartRequestBody();
Assert.assertEquals(12L, mpRequestBody.getMultipartRequestPortStats().getPortNo().longValue());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestPortStatsCase in project openflowplugin by opendaylight.
the class NodeConnectorDirectStatisticsServiceTest method testBuildRequestBody.
@Override
public void testBuildRequestBody() throws Exception {
final GetNodeConnectorStatisticsInput input = mock(GetNodeConnectorStatisticsInput.class);
when(input.getNode()).thenReturn(createNodeRef(NODE_ID));
when(input.getNodeConnectorId()).thenReturn(nodeConnectorId);
final MultipartRequestPortStatsCase body = (MultipartRequestPortStatsCase) ((MultipartRequestInput) service.buildRequest(new Xid(42L), input)).getMultipartRequestBody();
final MultipartRequestPortStats nodeConnector = body.getMultipartRequestPortStats();
assertEquals(PORT_NO, nodeConnector.getPortNo());
}
Aggregations