use of org.opendaylight.yang.gen.v1.urn.opendaylight.multipart.types.rev170112.multipart.request.MultipartRequestBody in project openflowplugin by opendaylight.
the class MultipartSerializerInjector method injectSerializers.
/**
* Injects multipart serializers into provided
* {@link org.opendaylight.openflowjava.protocol.api.extensibility.SerializerExtensionProvider}.
*
* @param provider OpenflowJava serializer extension provider
*/
static void injectSerializers(final SerializerExtensionProvider provider) {
// Inject new message serializers here using injector created by createInjector method
final Function<Class<? extends MultipartRequestBody>, Consumer<OFSerializer<? extends MultipartRequestBody>>> injector = createInjector(provider, EncodeConstants.OF13_VERSION_ID);
MultipartMatchFieldSerializerInjector.injectSerializers(provider);
MultipartTableFeaturesSerializerInjector.injectSerializers(provider);
injector.apply(MultipartRequestDesc.class).accept(new MultipartRequestDescSerializer());
injector.apply(MultipartRequestFlowTableStats.class).accept(new MultipartRequestFlowTableStatsSerializer());
injector.apply(MultipartRequestGroupDesc.class).accept(new MultipartRequestGroupDescSerializer());
injector.apply(MultipartRequestGroupFeatures.class).accept(new MultipartRequestGroupFeaturesSerializer());
injector.apply(MultipartRequestGroupStats.class).accept(new MultipartRequestGroupStatsSerializer());
injector.apply(MultipartRequestMeterFeatures.class).accept(new MultipartRequestMeterFeaturesSerializer());
injector.apply(MultipartRequestMeterStats.class).accept(new MultipartRequestMeterStatsSerializer());
injector.apply(MultipartRequestMeterConfig.class).accept(new MultipartRequestMeterConfigSerializer());
injector.apply(MultipartRequestPortDesc.class).accept(new MultipartRequestPortDescSerializer());
injector.apply(MultipartRequestPortStats.class).accept(new MultipartRequestPortStatsSerializer());
injector.apply(MultipartRequestQueueStats.class).accept(new MultipartRequestQueueStatsSerializer());
injector.apply(MultipartRequestFlowStats.class).accept(new MultipartRequestFlowStatsSerializer());
injector.apply(MultipartRequestFlowAggregateStats.class).accept(new MultipartRequestFlowAggregateStatsSerializer());
injector.apply(MultipartRequestExperimenter.class).accept(new MultipartRequestExperimenterSerializer());
injector.apply(MultipartRequestTableFeatures.class).accept(new MultipartRequestTableFeaturesSerializer());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.multipart.types.rev170112.multipart.request.MultipartRequestBody in project openflowplugin by opendaylight.
the class MultipartRequestInputFactoryTest method testMakeMultipartRequestInputMeterConfig.
@Test
public void testMakeMultipartRequestInputMeterConfig() throws Exception {
final MultipartType mpType = MultipartType.OFPMPMETERCONFIG;
final MultipartRequestInput mpRqInput = (MultipartRequestInput) MultipartRequestInputFactory.makeMultipartRequest(xid, ofVersion, mpType, false);
checkHeader(mpRqInput, mpType);
final MultipartRequestBody mpRqBody = mpRqInput.getMultipartRequestBody();
Assert.assertTrue(mpRqBody instanceof MultipartRequestMeterConfigCase);
MultipartRequestMeterConfig mpRq = ((MultipartRequestMeterConfigCase) mpRqBody).getMultipartRequestMeterConfig();
Assert.assertEquals(OFConstants.OFPM_ALL, mpRq.getMeterId().getValue());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.multipart.types.rev170112.multipart.request.MultipartRequestBody in project openflowplugin by opendaylight.
the class MultipartRequestInputFactoryTest method testMakeMultipartRequestInputTableFeatures.
@Test
public void testMakeMultipartRequestInputTableFeatures() throws Exception {
final MultipartType mpType = MultipartType.OFPMPTABLEFEATURES;
final MultipartRequestInput mpRqInput = (MultipartRequestInput) MultipartRequestInputFactory.makeMultipartRequest(xid, ofVersion, mpType, false);
checkHeader(mpRqInput, mpType);
final MultipartRequestBody mpRqBody = mpRqInput.getMultipartRequestBody();
Assert.assertTrue(mpRqBody instanceof MultipartRequestTableFeaturesCase);
MultipartRequestTableFeatures mpRq = ((MultipartRequestTableFeaturesCase) mpRqBody).getMultipartRequestTableFeatures();
Assert.assertNotNull(mpRq);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.multipart.types.rev170112.multipart.request.MultipartRequestBody in project openflowplugin by opendaylight.
the class MultipartRequestInputFactoryTest method testMakeMultipartRequestInputPortStats.
@Test
public void testMakeMultipartRequestInputPortStats() throws Exception {
final MultipartType mpType = MultipartType.OFPMPPORTSTATS;
final MultipartRequestInput mpRqInput = (MultipartRequestInput) MultipartRequestInputFactory.makeMultipartRequest(xid, ofVersion, mpType, false);
checkHeader(mpRqInput, mpType);
final MultipartRequestBody mpRqBody = mpRqInput.getMultipartRequestBody();
Assert.assertTrue(mpRqBody instanceof MultipartRequestPortStatsCase);
MultipartRequestPortStats mpRq = ((MultipartRequestPortStatsCase) mpRqBody).getMultipartRequestPortStats();
Assert.assertEquals(OFConstants.OFPP_ANY, mpRq.getPortNo());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.multipart.types.rev170112.multipart.request.MultipartRequestBody in project openflowplugin by opendaylight.
the class MultipartRequestInputFactoryTest method testMakeMultipartRequestInputQueue.
@Test
public void testMakeMultipartRequestInputQueue() throws Exception {
final MultipartType mpType = MultipartType.OFPMPQUEUE;
final MultipartRequestInput mpRqInput = (MultipartRequestInput) MultipartRequestInputFactory.makeMultipartRequest(xid, ofVersion, mpType, false);
checkHeader(mpRqInput, mpType);
final MultipartRequestBody mpRqBody = mpRqInput.getMultipartRequestBody();
Assert.assertTrue(mpRqBody instanceof MultipartRequestQueueCase);
MultipartRequestQueue mpRq = ((MultipartRequestQueueCase) mpRqBody).getMultipartRequestQueue();
Assert.assertEquals(OFConstants.OFPP_ANY, mpRq.getPortNo());
Assert.assertEquals(OFConstants.OFPQ_ALL, mpRq.getQueueId());
}
Aggregations