use of org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.meter._case.MeterBuilder in project openflowplugin by opendaylight.
the class MeterInstructionSerializerTest method testSerialize.
@Test
public void testSerialize() throws Exception {
final long meter = 2;
final Instruction instruction = new MeterCaseBuilder().setMeter(new MeterBuilder().setMeterId(new MeterId(meter)).build()).build();
assertInstruction(instruction, out -> assertEquals(out.readUnsignedInt(), meter));
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.meter._case.MeterBuilder in project openflowplugin by opendaylight.
the class OpenflowpluginMeterTestCommandProvider method _modifyMeter.
public void _modifyMeter(CommandInterpreter ci) {
String nref = ci.nextArgument();
if (nref == null) {
ci.println("test node added");
createTestNode();
} else {
ci.println("User node added" + nref);
createUserNode(nref);
}
MeterBuilder meter = createTestMeter();
meter.setMeterName(updatedMeterName);
writeMeter(ci, meter.build());
meter.setMeterName(originalMeterName);
writeMeter(ci, meter.build());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.meter._case.MeterBuilder in project openflowplugin by opendaylight.
the class OpenflowpluginMeterTestCommandProvider method createTestMeter.
private MeterBuilder createTestMeter() {
// Sample data , committing to DataStore
long id = 12;
MeterKey key = new MeterKey(new MeterId(id));
MeterBuilder meter = new MeterBuilder();
meter.setContainerName("abcd");
meter.setKey(key);
meter.setMeterId(new MeterId(9L));
meter.setMeterName(originalMeterName);
meter.setFlags(new MeterFlags(true, false, false, false));
MeterBandHeaderBuilder bandHeader = new MeterBandHeaderBuilder();
bandHeader.setBandRate((long) 234);
bandHeader.setBandBurstSize((long) 444);
DscpRemarkBuilder dscpRemark = new DscpRemarkBuilder();
dscpRemark.setDscpRemarkBurstSize((long) 5);
dscpRemark.setPrecLevel((short) 1);
dscpRemark.setDscpRemarkRate((long) 12);
bandHeader.setBandType(dscpRemark.build());
MeterBandTypesBuilder bandTypes = new MeterBandTypesBuilder();
MeterBandType bandType = new MeterBandType(false, true, false);
bandTypes.setFlags(bandType);
bandHeader.setMeterBandTypes(bandTypes.build());
bandHeader.setBandId(new BandId(0L));
List<MeterBandHeader> bandHdr = new ArrayList<>();
bandHdr.add(bandHeader.build());
MeterBandHeadersBuilder bandHeaders = new MeterBandHeadersBuilder();
bandHeaders.setMeterBandHeader(bandHdr);
meter.setMeterBandHeaders(bandHeaders.build());
testMeter = meter.build();
return meter;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.meter._case.MeterBuilder in project openflowplugin by opendaylight.
the class MultipartRequestInputMessageFactory method setMeter.
private MultipartRequestMeterCase setMeter(ByteBuf input) {
MultipartRequestMeterCaseBuilder caseBuilder = new MultipartRequestMeterCaseBuilder();
MultipartRequestMeterBuilder meterBuilder = new MultipartRequestMeterBuilder();
meterBuilder.setMeterId(new MeterId(input.readUnsignedInt()));
caseBuilder.setMultipartRequestMeter(meterBuilder.build());
return caseBuilder.build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.meter._case.MeterBuilder in project openflowplugin by opendaylight.
the class MultipartRequestInputMessageFactory method setMeterConfig.
private MultipartRequestMeterConfigCase setMeterConfig(ByteBuf input) {
MultipartRequestMeterConfigCaseBuilder caseBuilder = new MultipartRequestMeterConfigCaseBuilder();
MultipartRequestMeterConfigBuilder meterBuilder = new MultipartRequestMeterConfigBuilder();
meterBuilder.setMeterId(new MeterId(input.readUnsignedInt()));
caseBuilder.setMultipartRequestMeterConfig(meterBuilder.build());
return caseBuilder.build();
}
Aggregations