Search in sources :

Example 1 with MultipartRequestMeterCase

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestMeterCase in project openflowplugin by opendaylight.

the class MultipartRequestInputFactoryTest method testMakeMultipartRequestInputMeter.

@Test
public void testMakeMultipartRequestInputMeter() throws Exception {
    final MultipartType mpType = MultipartType.OFPMPMETER;
    final MultipartRequestInput mpRqInput = (MultipartRequestInput) MultipartRequestInputFactory.makeMultipartRequest(xid, ofVersion, mpType, false);
    checkHeader(mpRqInput, mpType);
    final MultipartRequestBody mpRqBody = mpRqInput.getMultipartRequestBody();
    Assert.assertTrue(mpRqBody instanceof MultipartRequestMeterCase);
    MultipartRequestMeter mpRq = ((MultipartRequestMeterCase) mpRqBody).getMultipartRequestMeter();
    Assert.assertEquals(OFConstants.OFPM_ALL, mpRq.getMeterId().getValue());
}
Also used : MultipartRequestMeterCase(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestMeterCase) MultipartType(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.MultipartType) MultipartRequestBody(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.MultipartRequestBody) MultipartRequestMeter(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.meter._case.MultipartRequestMeter) MultipartRequestInput(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.MultipartRequestInput) Test(org.junit.Test)

Example 2 with MultipartRequestMeterCase

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestMeterCase in project openflowplugin by opendaylight.

the class MultipartRequestMeterInputMessageFactoryTest method createRequestMeter.

private static MultipartRequestMeterCase createRequestMeter() {
    MultipartRequestMeterCaseBuilder caseBuilder = new MultipartRequestMeterCaseBuilder();
    MultipartRequestMeterBuilder builder = new MultipartRequestMeterBuilder();
    builder.setMeterId(new MeterId(1121L));
    caseBuilder.setMultipartRequestMeter(builder.build());
    return caseBuilder.build();
}
Also used : MultipartRequestMeterCaseBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestMeterCaseBuilder) MultipartRequestMeterBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.meter._case.MultipartRequestMeterBuilder) MeterId(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.MeterId)

Example 3 with MultipartRequestMeterCase

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestMeterCase in project openflowplugin by opendaylight.

the class MultipartRequestInputFactoryTest method createRequestMeter.

private static MultipartRequestMeterCase createRequestMeter() {
    MultipartRequestMeterCaseBuilder caseBuilder = new MultipartRequestMeterCaseBuilder();
    MultipartRequestMeterBuilder builder = new MultipartRequestMeterBuilder();
    builder.setMeterId(new MeterId(1121L));
    caseBuilder.setMultipartRequestMeter(builder.build());
    return caseBuilder.build();
}
Also used : MultipartRequestMeterCaseBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestMeterCaseBuilder) MultipartRequestMeterBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.meter._case.MultipartRequestMeterBuilder) MeterId(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.MeterId)

Example 4 with MultipartRequestMeterCase

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestMeterCase in project openflowplugin by opendaylight.

the class MultipartRequestInputFactory method serializeMeterBody.

private static void serializeMeterBody(final MultipartRequestBody multipartRequestBody, final ByteBuf output) {
    MultipartRequestMeterCase meterCase = (MultipartRequestMeterCase) multipartRequestBody;
    MultipartRequestMeter meter = meterCase.getMultipartRequestMeter();
    output.writeInt(meter.getMeterId().getValue().intValue());
    output.writeZero(PADDING_IN_MULTIPART_REQUEST_METER_BODY);
}
Also used : MultipartRequestMeterCase(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestMeterCase) MultipartRequestMeter(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.meter._case.MultipartRequestMeter)

Example 5 with MultipartRequestMeterCase

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestMeterCase in project openflowplugin by opendaylight.

the class MeterDirectStatisticsServiceTest method testBuildRequestBody.

@Override
public void testBuildRequestBody() throws Exception {
    final GetMeterStatisticsInput input = mock(GetMeterStatisticsInput.class);
    when(input.getNode()).thenReturn(createNodeRef(NODE_ID));
    when(input.getMeterId()).thenReturn(new MeterId(METER_NO));
    final MultipartRequestMeterCase body = (MultipartRequestMeterCase) ((MultipartRequestInput) service.buildRequest(new Xid(42L), input)).getMultipartRequestBody();
    final MultipartRequestMeter meter = body.getMultipartRequestMeter();
    assertEquals(METER_NO, meter.getMeterId().getValue());
}
Also used : MultipartRequestMeterCase(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestMeterCase) Xid(org.opendaylight.openflowplugin.api.openflow.device.Xid) MultipartRequestMeter(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.meter._case.MultipartRequestMeter) GetMeterStatisticsInput(org.opendaylight.yang.gen.v1.urn.opendaylight.direct.statistics.rev160511.GetMeterStatisticsInput) MeterId(org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.MeterId)

Aggregations

MeterId (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.MeterId)4 MultipartRequestMeterCaseBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestMeterCaseBuilder)4 MultipartRequestMeterBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.meter._case.MultipartRequestMeterBuilder)4 MultipartRequestMeterCase (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestMeterCase)3 MultipartRequestMeter (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.meter._case.MultipartRequestMeter)3 Test (org.junit.Test)1 Xid (org.opendaylight.openflowplugin.api.openflow.device.Xid)1 GetMeterStatisticsInput (org.opendaylight.yang.gen.v1.urn.opendaylight.direct.statistics.rev160511.GetMeterStatisticsInput)1 MeterId (org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.MeterId)1 MultipartType (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.MultipartType)1 MultipartRequestInput (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.MultipartRequestInput)1 MultipartRequestBody (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.MultipartRequestBody)1