Search in sources :

Example 6 with GetNodeConnectorStatisticsInput

use of org.opendaylight.yang.gen.v1.urn.opendaylight.direct.statistics.rev160511.GetNodeConnectorStatisticsInput in project openflowplugin by opendaylight.

the class OpendaylightDirectStatisticsServiceImplTest method testGetNodeConnectorStatisticsFail.

@Test
public void testGetNodeConnectorStatisticsFail() throws Exception {
    RpcResult<GetNodeConnectorStatisticsOutput> result = emptyService.getNodeConnectorStatistics(getNodeConnectorStatisticsInput).get();
    assertFalse(result.isSuccessful());
    for (RpcError error : result.getErrors()) {
        assertTrue(error.getMessage().contains(AbstractPortDirectStatisticsService.class.getSimpleName()));
    }
    verify(nodeConnectorDirectStatisticsService, times(0)).handleAndReply(getNodeConnectorStatisticsInput);
}
Also used : GetNodeConnectorStatisticsOutput(org.opendaylight.yang.gen.v1.urn.opendaylight.direct.statistics.rev160511.GetNodeConnectorStatisticsOutput) RpcError(org.opendaylight.yangtools.yang.common.RpcError) Test(org.junit.Test)

Example 7 with GetNodeConnectorStatisticsInput

use of org.opendaylight.yang.gen.v1.urn.opendaylight.direct.statistics.rev160511.GetNodeConnectorStatisticsInput in project openflowplugin by opendaylight.

the class PortStatsService method buildRequest.

@Override
protected OfHeader buildRequest(final Xid xid, final GetNodeConnectorStatisticsInput input) throws ServiceException {
    MultipartRequestPortStatsCaseBuilder caseBuilder = new MultipartRequestPortStatsCaseBuilder();
    MultipartRequestPortStatsBuilder mprPortStatsBuilder = new MultipartRequestPortStatsBuilder();
    // Set specific port
    final short version = getVersion();
    mprPortStatsBuilder.setPortNo(InventoryDataServiceUtil.portNumberfromNodeConnectorId(OpenflowVersion.get(version), input.getNodeConnectorId()));
    caseBuilder.setMultipartRequestPortStats(mprPortStatsBuilder.build());
    MultipartRequestInputBuilder mprInput = RequestInputUtils.createMultipartHeader(MultipartType.OFPMPPORTSTATS, xid.getValue(), version);
    mprInput.setMultipartRequestBody(caseBuilder.build());
    return mprInput.build();
}
Also used : MultipartRequestInputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.MultipartRequestInputBuilder) 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)

Aggregations

GetNodeConnectorStatisticsInput (org.opendaylight.yang.gen.v1.urn.opendaylight.direct.statistics.rev160511.GetNodeConnectorStatisticsInput)5 GetNodeConnectorStatisticsOutput (org.opendaylight.yang.gen.v1.urn.opendaylight.direct.statistics.rev160511.GetNodeConnectorStatisticsOutput)3 ExecutionException (java.util.concurrent.ExecutionException)2 Xid (org.opendaylight.openflowplugin.api.openflow.device.Xid)2 ArrayList (java.util.ArrayList)1 CompletableFuture (java.util.concurrent.CompletableFuture)1 TimeoutException (java.util.concurrent.TimeoutException)1 Test (org.junit.Test)1 GetNodeConnectorStatisticsInputBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.direct.statistics.rev160511.GetNodeConnectorStatisticsInputBuilder)1 NodeRef (org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRef)1 Nodes (org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes)1 NodeConnector (org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnector)1 NodeKey (org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey)1 MultipartRequestInputBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.MultipartRequestInputBuilder)1 MultipartRequestPortStatsCase (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestPortStatsCase)1 MultipartRequestPortStatsCaseBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestPortStatsCaseBuilder)1 MultipartRequestPortStats (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.port.stats._case.MultipartRequestPortStats)1 MultipartRequestPortStatsBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.port.stats._case.MultipartRequestPortStatsBuilder)1 MultipartRequestPortStats (org.opendaylight.yang.gen.v1.urn.opendaylight.port.statistics.rev131214.multipart.request.multipart.request.body.MultipartRequestPortStats)1 RpcError (org.opendaylight.yangtools.yang.common.RpcError)1