Search in sources :

Example 26 with MultipartRequestBody

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.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());
}
Also used : MultipartRequestGroupFeatures(org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.multipart.request.multipart.request.body.MultipartRequestGroupFeatures) MultipartRequestQueueStatsSerializer(org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.MultipartRequestQueueStatsSerializer) MultipartRequestPortStats(org.opendaylight.yang.gen.v1.urn.opendaylight.port.statistics.rev131214.multipart.request.multipart.request.body.MultipartRequestPortStats) MultipartRequestFlowTableStatsSerializer(org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.MultipartRequestFlowTableStatsSerializer) MultipartRequestMeterConfigSerializer(org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.MultipartRequestMeterConfigSerializer) Consumer(java.util.function.Consumer) MultipartRequestFlowAggregateStatsSerializer(org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.MultipartRequestFlowAggregateStatsSerializer) MultipartRequestExperimenter(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.experimenter.types.rev151020.multipart.request.multipart.request.body.MultipartRequestExperimenter) MultipartRequestFlowTableStats(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.table.statistics.rev131215.multipart.request.multipart.request.body.MultipartRequestFlowTableStats) MultipartRequestGroupFeaturesSerializer(org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.MultipartRequestGroupFeaturesSerializer) MultipartRequestBody(org.opendaylight.yang.gen.v1.urn.opendaylight.multipart.types.rev170112.multipart.request.MultipartRequestBody) MultipartRequestExperimenterSerializer(org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.MultipartRequestExperimenterSerializer) MultipartRequestPortStatsSerializer(org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.MultipartRequestPortStatsSerializer) MultipartRequestMeterConfig(org.opendaylight.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.multipart.request.multipart.request.body.MultipartRequestMeterConfig) MultipartRequestTableFeaturesSerializer(org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.MultipartRequestTableFeaturesSerializer) MultipartRequestMeterFeaturesSerializer(org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.MultipartRequestMeterFeaturesSerializer) MultipartRequestDescSerializer(org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.MultipartRequestDescSerializer) MultipartRequestPortDesc(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.multipart.request.multipart.request.body.MultipartRequestPortDesc) MultipartRequestDesc(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.multipart.request.multipart.request.body.MultipartRequestDesc) MultipartRequestGroupStats(org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.multipart.request.multipart.request.body.MultipartRequestGroupStats) MultipartRequestGroupDescSerializer(org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.MultipartRequestGroupDescSerializer) MultipartRequestMeterStats(org.opendaylight.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.multipart.request.multipart.request.body.MultipartRequestMeterStats) MultipartRequestPortDescSerializer(org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.MultipartRequestPortDescSerializer) MultipartRequestFlowStatsSerializer(org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.MultipartRequestFlowStatsSerializer) MultipartRequestGroupDesc(org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.multipart.request.multipart.request.body.MultipartRequestGroupDesc) MultipartRequestMeterFeatures(org.opendaylight.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.multipart.request.multipart.request.body.MultipartRequestMeterFeatures) MultipartRequestQueueStats(org.opendaylight.yang.gen.v1.urn.opendaylight.queue.statistics.rev131216.multipart.request.multipart.request.body.MultipartRequestQueueStats) MultipartRequestFlowStats(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.multipart.request.multipart.request.body.MultipartRequestFlowStats) MultipartRequestGroupStatsSerializer(org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.MultipartRequestGroupStatsSerializer) MultipartRequestMeterStatsSerializer(org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.MultipartRequestMeterStatsSerializer) MultipartRequestTableFeatures(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.multipart.request.multipart.request.body.MultipartRequestTableFeatures) MultipartRequestFlowAggregateStats(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.multipart.request.multipart.request.body.MultipartRequestFlowAggregateStats)

Example 27 with MultipartRequestBody

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.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());
}
Also used : MultipartRequestMeterConfig(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.meter.config._case.MultipartRequestMeterConfig) 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) MultipartRequestMeterConfigCase(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestMeterConfigCase) MultipartRequestInput(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.MultipartRequestInput) Test(org.junit.Test)

Example 28 with MultipartRequestBody

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.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);
}
Also used : 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) MultipartRequestTableFeaturesCase(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestTableFeaturesCase) MultipartRequestTableFeatures(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.table.features._case.MultipartRequestTableFeatures) MultipartRequestInput(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.MultipartRequestInput) Test(org.junit.Test)

Example 29 with MultipartRequestBody

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.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());
}
Also used : MultipartRequestPortStatsCase(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestPortStatsCase) 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) MultipartRequestPortStats(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.port.stats._case.MultipartRequestPortStats) MultipartRequestInput(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.MultipartRequestInput) Test(org.junit.Test)

Example 30 with MultipartRequestBody

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.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());
}
Also used : MultipartRequestQueue(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.queue._case.MultipartRequestQueue) 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) MultipartRequestQueueCase(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestQueueCase) MultipartRequestInput(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.MultipartRequestInput) Test(org.junit.Test)

Aggregations

MultipartType (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.MultipartType)10 Test (org.junit.Test)8 MultipartRequestInput (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.MultipartRequestInput)8 MultipartRequestBody (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.MultipartRequestBody)8 MultipartRequestDescCaseBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestDescCaseBuilder)3 MultipartRequestFlowCase (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestFlowCase)3 MultipartRequestQueueCase (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestQueueCase)3 MultipartRequestFlow (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.flow._case.MultipartRequestFlow)3 MultipartRequestQueue (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.queue._case.MultipartRequestQueue)3 Ipv4Address (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Address)2 MacAddress (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.MacAddress)2 MultipartRequestDesc (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.multipart.request.multipart.request.body.MultipartRequestDesc)2 MultipartRequestPortDesc (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.multipart.request.multipart.request.body.MultipartRequestPortDesc)2 MultipartRequestFlowStats (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.multipart.request.multipart.request.body.MultipartRequestFlowStats)2 MultipartRequestGroupDesc (org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.multipart.request.multipart.request.body.MultipartRequestGroupDesc)2 MultipartRequestGroupStats (org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.multipart.request.multipart.request.body.MultipartRequestGroupStats)2 MultipartRequestBody (org.opendaylight.yang.gen.v1.urn.opendaylight.multipart.types.rev170112.multipart.request.MultipartRequestBody)2 MatchV10 (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.v10.grouping.MatchV10)2 MatchV10Builder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.v10.grouping.MatchV10Builder)2 MultipartRequestAggregateCase (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestAggregateCase)2