Search in sources :

Example 1 with MultipartRequestPortStatsCase

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);
}
Also used : MultipartRequestPortStatsCase(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestPortStatsCase) MultipartRequestPortStats(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.port.stats._case.MultipartRequestPortStats)

Example 2 with MultipartRequestPortStatsCase

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);
}
Also used : MultipartRequestPortStatsCase(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestPortStatsCase) MultipartRequestPortStats(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.port.stats._case.MultipartRequestPortStats)

Example 3 with MultipartRequestPortStatsCase

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();
}
Also used : MultipartRequestPortStatsCaseBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestPortStatsCaseBuilder) MultipartRequestPortStatsBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.port.stats._case.MultipartRequestPortStatsBuilder)

Example 4 with MultipartRequestPortStatsCase

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());
}
Also used : GetNodeConnectorStatisticsInputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.port.statistics.rev131214.GetNodeConnectorStatisticsInputBuilder) Xid(org.opendaylight.openflowplugin.api.openflow.device.Xid) MultipartRequestPortStatsCase(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestPortStatsCase) OfHeader(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.OfHeader) NodeConnectorId(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId) MultipartRequestInput(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.MultipartRequestInput) Test(org.junit.Test)

Example 5 with MultipartRequestPortStatsCase

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());
}
Also used : Xid(org.opendaylight.openflowplugin.api.openflow.device.Xid) MultipartRequestPortStatsCase(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestPortStatsCase) MultipartRequestPortStats(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.port.stats._case.MultipartRequestPortStats) GetNodeConnectorStatisticsInput(org.opendaylight.yang.gen.v1.urn.opendaylight.direct.statistics.rev160511.GetNodeConnectorStatisticsInput)

Aggregations

MultipartRequestPortStatsCase (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestPortStatsCase)5 MultipartRequestPortStatsCaseBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestPortStatsCaseBuilder)5 MultipartRequestPortStatsBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.port.stats._case.MultipartRequestPortStatsBuilder)5 MultipartRequestPortStats (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.port.stats._case.MultipartRequestPortStats)4 Test (org.junit.Test)2 Xid (org.opendaylight.openflowplugin.api.openflow.device.Xid)2 MultipartRequestInput (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.MultipartRequestInput)2 GetNodeConnectorStatisticsInput (org.opendaylight.yang.gen.v1.urn.opendaylight.direct.statistics.rev160511.GetNodeConnectorStatisticsInput)1 NodeConnectorId (org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId)1 MultipartType (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.MultipartType)1 OfHeader (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.OfHeader)1 MultipartRequestBody (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.MultipartRequestBody)1 GetNodeConnectorStatisticsInputBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.port.statistics.rev131214.GetNodeConnectorStatisticsInputBuilder)1