use of org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.MeterId in project openflowplugin by opendaylight.
the class MeterStatsService method buildRequest.
@Override
protected OfHeader buildRequest(final Xid xid, final GetMeterStatisticsInput input) throws ServiceException {
MultipartRequestMeterCaseBuilder caseBuilder = new MultipartRequestMeterCaseBuilder();
MultipartRequestMeterBuilder mprMeterBuild = new MultipartRequestMeterBuilder();
mprMeterBuild.setMeterId(new MeterId(input.getMeterId().getValue()));
caseBuilder.setMultipartRequestMeter(mprMeterBuild.build());
MultipartRequestInputBuilder mprInput = RequestInputUtils.createMultipartHeader(MultipartType.OFPMPMETER, xid.getValue(), getVersion());
mprInput.setMultipartRequestBody(caseBuilder.build());
return mprInput.build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.MeterId in project openflowplugin by opendaylight.
the class SalMeterServiceImplTest method removeMeter.
private void removeMeter() throws Exception {
final MeterId dummyMeterId = new MeterId(DUMMY_METER_ID);
RemoveMeterInput removeMeterInput = new RemoveMeterInputBuilder().setMeterId(dummyMeterId).build();
this.<RemoveMeterOutput>mockSuccessfulFuture();
salMeterService.removeMeter(removeMeterInput);
verify(mockedRequestContextStack).createRequestContext();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.MeterId in project openflowplugin by opendaylight.
the class MeterStatsResponseConvertorTest method createMeterStatsLit.
private static List<org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.multipart.reply.meter._case.multipart.reply.meter.MeterStats> createMeterStatsLit() {
List<org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.multipart.reply.meter._case.multipart.reply.meter.MeterStats> allMeterStats = new ArrayList<>();
MeterStatsBuilder meterStatsBuilder = new MeterStatsBuilder();
for (int i = 0; i < PRESET_COUNT; i++) {
meterStatsBuilder.setByteInCount(BigInteger.valueOf(i));
meterStatsBuilder.setDurationNsec((long) 1000 * i);
meterStatsBuilder.setDurationSec((long) 10 * i);
meterStatsBuilder.setFlowCount((long) i);
MeterBandStatsBuilder meterBandStatsBuilder = new MeterBandStatsBuilder();
List<MeterBandStats> meterBandStatses = new ArrayList<>();
for (int j = 0; j < PRESET_COUNT; j++) {
meterBandStatsBuilder.setByteBandCount(BigInteger.valueOf(j));
meterBandStatsBuilder.setPacketBandCount(BigInteger.valueOf(j));
meterBandStatses.add(meterBandStatsBuilder.build());
}
meterStatsBuilder.setMeterBandStats(meterBandStatses);
meterStatsBuilder.setMeterId(new MeterId((long) i));
meterStatsBuilder.setPacketInCount(BigInteger.valueOf(i));
allMeterStats.add(meterStatsBuilder.build());
}
return allMeterStats;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.MeterId in project openflowplugin by opendaylight.
the class DeviceMeterRegistryImplTest method setUp.
@Before
public void setUp() throws Exception {
deviceMeterRegistry = new DeviceMeterRegistryImpl();
meterId = new MeterId(42L);
meterId2 = new MeterId(84L);
Assert.assertEquals(0, deviceMeterRegistry.getAllMeterIds().size());
deviceMeterRegistry.store(meterId);
Assert.assertEquals(1, deviceMeterRegistry.getAllMeterIds().size());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.MeterId in project openflowplugin by opendaylight.
the class OpenflowPluginBulkTransactionProvider method createMeterInstructions.
private static InstructionsBuilder createMeterInstructions() {
MeterBuilder aab = new MeterBuilder();
aab.setMeterId(new MeterId(1L));
InstructionBuilder ib = new InstructionBuilder();
ib.setInstruction(new MeterCaseBuilder().setMeter(aab.build()).build());
// Put our Instruction in a list of Instructions
InstructionsBuilder isb = new InstructionsBuilder();
List<Instruction> instructions = new ArrayList<>();
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
}
Aggregations