Search in sources :

Example 1 with GetAllFlowStatisticsFromFlowTableInput

use of org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.GetAllFlowStatisticsFromFlowTableInput in project openflowplugin by opendaylight.

the class OpendaylightFlowStatisticsServiceImpl3Test method testGetAllFlowStatisticsFromFlowTable.

@Test
public void testGetAllFlowStatisticsFromFlowTable() throws Exception {
    GetAllFlowStatisticsFromFlowTableInput input = new GetAllFlowStatisticsFromFlowTableInputBuilder().setNode(createNodeRef("unitProt:123")).setTableId(new TableId((short) 1)).build();
    flowStatisticsService.getAllFlowStatisticsFromFlowTable(input);
    Mockito.verify(flowStatisticsDelegate).getAllFlowStatisticsFromFlowTable(input);
}
Also used : TableId(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.TableId) GetAllFlowStatisticsFromFlowTableInputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.GetAllFlowStatisticsFromFlowTableInputBuilder) GetAllFlowStatisticsFromFlowTableInput(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.GetAllFlowStatisticsFromFlowTableInput) Test(org.junit.Test)

Example 2 with GetAllFlowStatisticsFromFlowTableInput

use of org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.GetAllFlowStatisticsFromFlowTableInput in project openflowplugin by opendaylight.

the class AllFlowsInTableService method buildRequest.

@Override
protected OfHeader buildRequest(final Xid xid, final GetAllFlowStatisticsFromFlowTableInput input) throws ServiceException {
    final MultipartRequestFlowBuilder mprFlowRequestBuilder = new MultipartRequestFlowBuilder();
    mprFlowRequestBuilder.setTableId(input.getTableId().getValue());
    mprFlowRequestBuilder.setOutPort(OFConstants.OFPP_ANY);
    mprFlowRequestBuilder.setOutGroup(OFConstants.OFPG_ANY);
    mprFlowRequestBuilder.setCookie(OFConstants.DEFAULT_COOKIE);
    mprFlowRequestBuilder.setCookieMask(OFConstants.DEFAULT_COOKIE_MASK);
    final short version = getVersion();
    FlowCreatorUtil.setWildcardedFlowMatch(version, mprFlowRequestBuilder);
    final MultipartRequestFlowCaseBuilder multipartRequestFlowCaseBuilder = new MultipartRequestFlowCaseBuilder();
    multipartRequestFlowCaseBuilder.setMultipartRequestFlow(mprFlowRequestBuilder.build());
    final MultipartRequestInputBuilder mprInput = RequestInputUtils.createMultipartHeader(MultipartType.OFPMPFLOW, xid.getValue(), version);
    mprInput.setMultipartRequestBody(multipartRequestFlowCaseBuilder.build());
    return mprInput.build();
}
Also used : MultipartRequestInputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.MultipartRequestInputBuilder) MultipartRequestFlowBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.flow._case.MultipartRequestFlowBuilder) MultipartRequestFlowCaseBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestFlowCaseBuilder)

Aggregations

Test (org.junit.Test)1 GetAllFlowStatisticsFromFlowTableInput (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.GetAllFlowStatisticsFromFlowTableInput)1 GetAllFlowStatisticsFromFlowTableInputBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.GetAllFlowStatisticsFromFlowTableInputBuilder)1 MultipartRequestInputBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.MultipartRequestInputBuilder)1 MultipartRequestFlowCaseBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestFlowCaseBuilder)1 MultipartRequestFlowBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.flow._case.MultipartRequestFlowBuilder)1 TableId (org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.TableId)1