Search in sources :

Example 11 with MeterId

use of org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.MeterId in project openflowplugin by opendaylight.

the class MultipartRequestInputFactory method makeDefaultMultiLayerBody.

private static MultipartRequestBody makeDefaultMultiLayerBody(@Nonnull final MultipartType type, final short version) {
    switch(type) {
        case OFPMPDESC:
            return new MultipartRequestDescCaseBuilder().build();
        case OFPMPFLOW:
            final MultipartRequestFlowCaseBuilder multipartRequestFlowCaseBuilder = new MultipartRequestFlowCaseBuilder();
            MultipartRequestFlowBuilder multipartRequestFlowBuilder = new MultipartRequestFlowBuilder();
            multipartRequestFlowBuilder.setTableId(OFConstants.OFPTT_ALL);
            multipartRequestFlowBuilder.setOutPort(OFConstants.OFPP_ANY);
            multipartRequestFlowBuilder.setOutGroup(OFConstants.OFPG_ANY);
            multipartRequestFlowBuilder.setCookie(OFConstants.DEFAULT_COOKIE);
            multipartRequestFlowBuilder.setCookieMask(OFConstants.DEFAULT_COOKIE_MASK);
            switch(version) {
                case OFConstants.OFP_VERSION_1_0:
                    MatchV10Builder matchV10Builder = MatchUtil.createEmptyV10Match();
                    multipartRequestFlowBuilder.setMatchV10(matchV10Builder.build());
                    break;
                case OFConstants.OFP_VERSION_1_3:
                    multipartRequestFlowBuilder.setMatch(new MatchBuilder().setType(OxmMatchType.class).build());
                    break;
                default:
                    throw new IllegalArgumentException("Unknown version " + version);
            }
            multipartRequestFlowCaseBuilder.setMultipartRequestFlow(multipartRequestFlowBuilder.build());
            return multipartRequestFlowCaseBuilder.build();
        case OFPMPAGGREGATE:
            return new MultipartRequestAggregateCaseBuilder().build();
        case OFPMPTABLE:
            return new MultipartRequestTableCaseBuilder().build();
        case OFPMPPORTSTATS:
            MultipartRequestPortStatsCaseBuilder multipartRequestPortStatsCaseBuilder = new MultipartRequestPortStatsCaseBuilder();
            MultipartRequestPortStatsBuilder multipartRequestPortStatsBuilder = new MultipartRequestPortStatsBuilder();
            multipartRequestPortStatsBuilder.setPortNo(OFConstants.OFPP_ANY);
            multipartRequestPortStatsCaseBuilder.setMultipartRequestPortStats(multipartRequestPortStatsBuilder.build());
            return multipartRequestPortStatsCaseBuilder.build();
        case OFPMPQUEUE:
            MultipartRequestQueueCaseBuilder multipartRequestQueueCaseBuilder = new MultipartRequestQueueCaseBuilder();
            MultipartRequestQueueBuilder multipartRequestQueueBuilder = new MultipartRequestQueueBuilder();
            multipartRequestQueueBuilder.setPortNo(OFConstants.OFPP_ANY);
            multipartRequestQueueBuilder.setQueueId(OFConstants.OFPQ_ALL);
            multipartRequestQueueCaseBuilder.setMultipartRequestQueue(multipartRequestQueueBuilder.build());
            return multipartRequestQueueCaseBuilder.build();
        case OFPMPGROUP:
            MultipartRequestGroupCaseBuilder multipartRequestGroupCaseBuilder = new MultipartRequestGroupCaseBuilder();
            MultipartRequestGroupBuilder multipartRequestGroupBuilder = new MultipartRequestGroupBuilder();
            GroupId groupId = new GroupId(OFConstants.OFPG_ALL);
            multipartRequestGroupBuilder.setGroupId(groupId);
            multipartRequestGroupCaseBuilder.setMultipartRequestGroup(multipartRequestGroupBuilder.build());
            return multipartRequestGroupCaseBuilder.build();
        case OFPMPGROUPDESC:
            return new MultipartRequestGroupDescCaseBuilder().build();
        case OFPMPGROUPFEATURES:
            return new MultipartRequestGroupFeaturesCaseBuilder().build();
        case OFPMPMETER:
            MultipartRequestMeterCaseBuilder multipartRequestMeterCaseBuilder = new MultipartRequestMeterCaseBuilder();
            MultipartRequestMeterBuilder multipartRequestMeterBuilder = new MultipartRequestMeterBuilder();
            MeterId meterId = new MeterId(OFConstants.OFPM_ALL);
            multipartRequestMeterBuilder.setMeterId(meterId);
            multipartRequestMeterCaseBuilder.setMultipartRequestMeter(multipartRequestMeterBuilder.build());
            return multipartRequestMeterCaseBuilder.build();
        case OFPMPMETERCONFIG:
            MultipartRequestMeterConfigCaseBuilder multipartRequestMeterConfigCaseBuilder = new MultipartRequestMeterConfigCaseBuilder();
            MultipartRequestMeterConfigBuilder multipartRequestMeterConfigBuilder = new MultipartRequestMeterConfigBuilder();
            MeterId configMeterId = new MeterId(OFConstants.OFPM_ALL);
            multipartRequestMeterConfigBuilder.setMeterId(configMeterId);
            multipartRequestMeterConfigCaseBuilder.setMultipartRequestMeterConfig(multipartRequestMeterConfigBuilder.build());
            return multipartRequestMeterConfigCaseBuilder.build();
        case OFPMPMETERFEATURES:
            return new MultipartRequestMeterFeaturesCaseBuilder().build();
        case OFPMPTABLEFEATURES:
            MultipartRequestTableFeaturesCaseBuilder tableFeaturesCaseBuilder = new MultipartRequestTableFeaturesCaseBuilder();
            tableFeaturesCaseBuilder.setMultipartRequestTableFeatures(new MultipartRequestTableFeaturesBuilder().build());
            return tableFeaturesCaseBuilder.build();
        case OFPMPPORTDESC:
            return new MultipartRequestPortDescCaseBuilder().build();
        case OFPMPEXPERIMENTER:
            return new MultipartRequestExperimenterCaseBuilder().build();
        default:
            throw new IllegalArgumentException("Unknown MultipartType " + type);
    }
}
Also used : MultipartRequestPortStatsCaseBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestPortStatsCaseBuilder) MultipartRequestMeterConfigBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.meter.config._case.MultipartRequestMeterConfigBuilder) MultipartRequestMeterCaseBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestMeterCaseBuilder) MultipartRequestQueueCaseBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestQueueCaseBuilder) MultipartRequestPortDescCaseBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestPortDescCaseBuilder) MeterId(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.MeterId) MultipartRequestQueueBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.queue._case.MultipartRequestQueueBuilder) MultipartRequestFlowCaseBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestFlowCaseBuilder) MultipartRequestFlowBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.flow._case.MultipartRequestFlowBuilder) MultipartRequestExperimenterCaseBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestExperimenterCaseBuilder) MultipartRequestGroupBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.group._case.MultipartRequestGroupBuilder) MultipartRequestAggregateCaseBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestAggregateCaseBuilder) MultipartRequestDescCaseBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestDescCaseBuilder) MultipartRequestMeterBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.meter._case.MultipartRequestMeterBuilder) MultipartRequestGroupDescCaseBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestGroupDescCaseBuilder) GroupId(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.GroupId) MultipartRequestGroupCaseBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestGroupCaseBuilder) MultipartRequestTableFeaturesCaseBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestTableFeaturesCaseBuilder) MultipartRequestTableFeaturesBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.table.features._case.MultipartRequestTableFeaturesBuilder) MultipartRequestTableCaseBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestTableCaseBuilder) MatchV10Builder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.v10.grouping.MatchV10Builder) MultipartRequestMeterConfigCaseBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestMeterConfigCaseBuilder) MultipartRequestMeterFeaturesCaseBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestMeterFeaturesCaseBuilder) MultipartRequestGroupFeaturesCaseBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestGroupFeaturesCaseBuilder) MatchBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.grouping.MatchBuilder) MultipartRequestPortStatsBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.port.stats._case.MultipartRequestPortStatsBuilder)

Example 12 with MeterId

use of org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.MeterId in project openflowplugin by opendaylight.

the class SalMeterServiceImplTest method updateMeter.

private void updateMeter() throws Exception {
    final UpdatedMeter dummyUpdatedMeter = new UpdatedMeterBuilder().setMeterId(new MeterId(DUMMY_METTER_ID)).build();
    final OriginalMeter dummyOriginalMeter = new OriginalMeterBuilder().setMeterId(new MeterId(DUMMY_METTER_ID)).build();
    final UpdateMeterInput updateMeterInput = new UpdateMeterInputBuilder().setUpdatedMeter(dummyUpdatedMeter).setOriginalMeter(dummyOriginalMeter).build();
    this.<AddMeterOutput>mockSuccessfulFuture();
    salMeterService.updateMeter(updateMeterInput);
    verify(mockedRequestContextStack).createRequestContext();
}
Also used : OriginalMeter(org.opendaylight.yang.gen.v1.urn.opendaylight.meter.service.rev130918.meter.update.OriginalMeter) UpdateMeterInputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.meter.service.rev130918.UpdateMeterInputBuilder) AddMeterOutput(org.opendaylight.yang.gen.v1.urn.opendaylight.meter.service.rev130918.AddMeterOutput) UpdatedMeter(org.opendaylight.yang.gen.v1.urn.opendaylight.meter.service.rev130918.meter.update.UpdatedMeter) UpdatedMeterBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.meter.service.rev130918.meter.update.UpdatedMeterBuilder) OriginalMeterBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.meter.service.rev130918.meter.update.OriginalMeterBuilder) UpdateMeterInput(org.opendaylight.yang.gen.v1.urn.opendaylight.meter.service.rev130918.UpdateMeterInput) MeterId(org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.MeterId)

Example 13 with MeterId

use of org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.MeterId in project openflowplugin by opendaylight.

the class SalMeterServiceImplTest method addMeter.

private void addMeter() {
    final MeterId dummyMeterId = new MeterId(DUMMY_METER_ID);
    AddMeterInput addMeterInput = new AddMeterInputBuilder().setMeterId(dummyMeterId).build();
    this.<AddMeterOutput>mockSuccessfulFuture();
    salMeterService.addMeter(addMeterInput);
    verify(mockedRequestContextStack).createRequestContext();
}
Also used : AddMeterOutput(org.opendaylight.yang.gen.v1.urn.opendaylight.meter.service.rev130918.AddMeterOutput) AddMeterInput(org.opendaylight.yang.gen.v1.urn.opendaylight.meter.service.rev130918.AddMeterInput) AddMeterInputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.meter.service.rev130918.AddMeterInputBuilder) MeterId(org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.MeterId)

Example 14 with MeterId

use of org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.MeterId in project openflowplugin by opendaylight.

the class FlowConvertorTest method testInstructionsTranslation.

/**
 * Tests {@link FlowConvertor#convert(Flow, VersionDatapathIdConvertorData)} }.
 */
@Test
public void testInstructionsTranslation() {
    InstructionBuilder instructionBuilder = new InstructionBuilder();
    GoToTableCaseBuilder goToCaseBuilder = new GoToTableCaseBuilder();
    GoToTableBuilder goToBuilder = new GoToTableBuilder();
    goToBuilder.setTableId((short) 1);
    goToCaseBuilder.setGoToTable(goToBuilder.build());
    instructionBuilder.setInstruction(goToCaseBuilder.build());
    instructionBuilder.setOrder(0);
    List<Instruction> instructions = new ArrayList<>();
    instructions.add(instructionBuilder.build());
    instructionBuilder = new InstructionBuilder();
    WriteMetadataCaseBuilder metaCaseBuilder = new WriteMetadataCaseBuilder();
    WriteMetadataBuilder metaBuilder = new WriteMetadataBuilder();
    metaBuilder.setMetadata(new BigInteger("2"));
    metaBuilder.setMetadataMask(new BigInteger("3"));
    metaCaseBuilder.setWriteMetadata(metaBuilder.build());
    instructionBuilder.setInstruction(metaCaseBuilder.build());
    instructionBuilder.setOrder(1);
    instructions.add(instructionBuilder.build());
    instructionBuilder = new InstructionBuilder();
    WriteActionsCaseBuilder writeCaseBuilder = new WriteActionsCaseBuilder();
    WriteActionsBuilder writeBuilder = new WriteActionsBuilder();
    List<Action> actions = new ArrayList<>();
    writeBuilder.setAction(actions);
    writeCaseBuilder.setWriteActions(writeBuilder.build());
    instructionBuilder.setInstruction(writeCaseBuilder.build());
    instructionBuilder.setOrder(2);
    instructions.add(instructionBuilder.build());
    instructionBuilder = new InstructionBuilder();
    ApplyActionsCaseBuilder applyCaseBuilder = new ApplyActionsCaseBuilder();
    ApplyActionsBuilder applyBuilder = new ApplyActionsBuilder();
    actions = new ArrayList<>();
    applyBuilder.setAction(actions);
    applyCaseBuilder.setApplyActions(applyBuilder.build());
    instructionBuilder.setInstruction(applyCaseBuilder.build());
    instructionBuilder.setOrder(3);
    instructions.add(instructionBuilder.build());
    instructionBuilder = new InstructionBuilder();
    ClearActionsCaseBuilder clearCaseBuilder = new ClearActionsCaseBuilder();
    ClearActionsBuilder clearBuilder = new ClearActionsBuilder();
    actions = new ArrayList<>();
    clearBuilder.setAction(actions);
    clearCaseBuilder.setClearActions(clearBuilder.build());
    instructionBuilder.setInstruction(clearCaseBuilder.build());
    instructionBuilder.setOrder(4);
    instructions.add(instructionBuilder.build());
    instructionBuilder = new InstructionBuilder();
    MeterCaseBuilder meterCaseBuilder = new MeterCaseBuilder();
    MeterBuilder meterBuilder = new MeterBuilder();
    meterBuilder.setMeterId(new MeterId(5L));
    meterCaseBuilder.setMeter(meterBuilder.build());
    instructionBuilder.setInstruction(meterCaseBuilder.build());
    instructionBuilder.setOrder(5);
    instructions.add(instructionBuilder.build());
    InstructionsBuilder instructionsBuilder = new InstructionsBuilder();
    instructionsBuilder.setInstruction(instructions);
    AddFlowInputBuilder flowBuilder = new AddFlowInputBuilder();
    flowBuilder.setInstructions(instructionsBuilder.build());
    AddFlowInput flow = flowBuilder.build();
    VersionDatapathIdConvertorData data = new VersionDatapathIdConvertorData(OFConstants.OFP_VERSION_1_0);
    data.setDatapathId(new BigInteger("42"));
    List<FlowModInputBuilder> flowMod = convert(flow, data);
    Assert.assertEquals("Wrong version", 1, flowMod.get(0).getVersion().intValue());
    Assert.assertEquals("Wrong command", FlowModCommand.OFPFCADD, flowMod.get(0).getCommand());
    Assert.assertEquals("Wrong instructions size", 6, flowMod.get(0).getInstruction().size());
    org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instructions.grouping.Instruction instruction = flowMod.get(0).getInstruction().get(0);
    Assert.assertEquals("Wrong type", "org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common" + ".instruction.rev130731.instruction.grouping.instruction.choice.GotoTableCase", instruction.getInstructionChoice().getImplementedInterface().getName());
    GotoTableCase gotoTableCase = (GotoTableCase) instruction.getInstructionChoice();
    Assert.assertEquals("Wrong table id", 1, gotoTableCase.getGotoTable().getTableId().intValue());
    instruction = flowMod.get(0).getInstruction().get(1);
    Assert.assertEquals("Wrong type", "org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common" + ".instruction.rev130731.instruction.grouping.instruction.choice.WriteMetadataCase", instruction.getInstructionChoice().getImplementedInterface().getName());
    WriteMetadataCase writeMetadataCase = (WriteMetadataCase) instruction.getInstructionChoice();
    Assert.assertArrayEquals("Wrong metadata", new byte[] { 0, 0, 0, 0, 0, 0, 0, 2 }, writeMetadataCase.getWriteMetadata().getMetadata());
    Assert.assertArrayEquals("Wrong metadata mask", new byte[] { 0, 0, 0, 0, 0, 0, 0, 3 }, writeMetadataCase.getWriteMetadata().getMetadataMask());
    instruction = flowMod.get(0).getInstruction().get(2);
    Assert.assertEquals("Wrong type", "org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common" + ".instruction.rev130731.instruction.grouping.instruction.choice.WriteActionsCase", instruction.getInstructionChoice().getImplementedInterface().getName());
    WriteActionsCase writeActionsCase = (WriteActionsCase) instruction.getInstructionChoice();
    Assert.assertEquals("Wrong actions size", 0, writeActionsCase.getWriteActions().getAction().size());
    instruction = flowMod.get(0).getInstruction().get(3);
    Assert.assertEquals("Wrong type", "org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common" + ".instruction.rev130731.instruction.grouping.instruction.choice.ApplyActionsCase", instruction.getInstructionChoice().getImplementedInterface().getName());
    ApplyActionsCase applyActionsCase = (ApplyActionsCase) instruction.getInstructionChoice();
    Assert.assertEquals("Wrong actions size", 0, applyActionsCase.getApplyActions().getAction().size());
    instruction = flowMod.get(0).getInstruction().get(4);
    Assert.assertEquals("Wrong type", "org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common" + ".instruction.rev130731.instruction.grouping.instruction.choice.ClearActionsCase", instruction.getInstructionChoice().getImplementedInterface().getName());
    instruction = flowMod.get(0).getInstruction().get(5);
    Assert.assertEquals("Wrong type", "org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common" + ".instruction.rev130731.instruction.grouping.instruction.choice.MeterCase", instruction.getInstructionChoice().getImplementedInterface().getName());
    MeterCase meterCase = (MeterCase) instruction.getInstructionChoice();
    Assert.assertEquals("Wrong meter id", 5, meterCase.getMeter().getMeterId().intValue());
}
Also used : MeterBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.meter._case.MeterBuilder) InstructionBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.InstructionBuilder) Action(org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action) VersionDatapathIdConvertorData(org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.data.VersionDatapathIdConvertorData) WriteMetadataCaseBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.WriteMetadataCaseBuilder) WriteMetadataCase(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instruction.grouping.instruction.choice.WriteMetadataCase) MeterCase(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instruction.grouping.instruction.choice.MeterCase) ArrayList(java.util.ArrayList) AddFlowInput(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.AddFlowInput) WriteActionsCase(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instruction.grouping.instruction.choice.WriteActionsCase) Instruction(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.Instruction) WriteMetadataBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.write.metadata._case.WriteMetadataBuilder) MeterId(org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.MeterId) InstructionsBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.InstructionsBuilder) ApplyActionsCaseBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.ApplyActionsCaseBuilder) AddFlowInputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.AddFlowInputBuilder) ClearActionsCaseBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.ClearActionsCaseBuilder) ApplyActionsBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.apply.actions._case.ApplyActionsBuilder) GoToTableBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.go.to.table._case.GoToTableBuilder) MeterCaseBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.MeterCaseBuilder) GotoTableCase(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instruction.grouping.instruction.choice.GotoTableCase) WriteActionsBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.write.actions._case.WriteActionsBuilder) WriteActionsCaseBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.WriteActionsCaseBuilder) ClearActionsBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.clear.actions._case.ClearActionsBuilder) GoToTableCaseBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.GoToTableCaseBuilder) FlowModInputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.FlowModInputBuilder) BigInteger(java.math.BigInteger) ApplyActionsCase(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instruction.grouping.instruction.choice.ApplyActionsCase) Test(org.junit.Test)

Example 15 with MeterId

use of org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.MeterId in project openflowplugin by opendaylight.

the class OpendaylightMeterStatisticsServiceImplTest method testGetMeterStatistics.

@Test
public void testGetMeterStatistics() throws Exception {
    GetMeterStatisticsInputBuilder input = new GetMeterStatisticsInputBuilder().setNode(createNodeRef("unitProt:123")).setMeterId(new MeterId(21L));
    rpcResult = buildMeterStatisticsReply();
    final Future<RpcResult<GetMeterStatisticsOutput>> resultFuture = meterStatisticsService.getMeterStatistics(input.build());
    Assert.assertTrue(resultFuture.isDone());
    final RpcResult<GetMeterStatisticsOutput> rpcResult = resultFuture.get();
    Assert.assertTrue(rpcResult.isSuccessful());
    Assert.assertEquals(MultipartType.OFPMPMETER, requestInput.getValue().getType());
}
Also used : GetMeterStatisticsOutput(org.opendaylight.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.GetMeterStatisticsOutput) RpcResult(org.opendaylight.yangtools.yang.common.RpcResult) GetMeterStatisticsInputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.GetMeterStatisticsInputBuilder) MeterId(org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.MeterId) Test(org.junit.Test)

Aggregations

MeterId (org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.MeterId)32 Test (org.junit.Test)26 ArrayList (java.util.ArrayList)24 MeterId (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.MeterId)23 ByteBuf (io.netty.buffer.ByteBuf)11 AddMeterInput (org.opendaylight.yang.gen.v1.urn.opendaylight.meter.service.rev130918.AddMeterInput)10 MeterFlags (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.MeterFlags)9 MeterBandType (org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.MeterBandType)8 DscpRemarkBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.band.type.band.type.DscpRemarkBuilder)8 MeterBandHeadersBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.meter.MeterBandHeadersBuilder)8 MeterBandHeader (org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.meter.meter.band.headers.MeterBandHeader)8 MeterBandHeaderBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.meter.meter.band.headers.MeterBandHeaderBuilder)8 MeterBandTypesBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.meter.meter.band.headers.meter.band.header.MeterBandTypesBuilder)8 MeterModInputBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.MeterModInputBuilder)8 MeterBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.meters.MeterBuilder)7 MeterKey (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.meters.MeterKey)7 FlowCapableNode (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode)6 Meter (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.meters.Meter)6 MeterCaseBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.MeterCaseBuilder)6 MeterBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.meter._case.MeterBuilder)6