Search in sources :

Example 1 with ConvertorKey

use of org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.common.ConvertorKey in project openflowplugin by opendaylight.

the class FlowFlagsInjector method addInjectors.

private static void addInjectors(final Map<ConvertorKey, ResultInjector<?, ?>> injectionMapping) {
    // OF-1.3|FlowModFlags --> FlowModInputBuilder
    injectionMapping.put(new ConvertorKey(OFConstants.OFP_VERSION_1_3, FlowModInputBuilder.class), (ResultInjector<FlowModFlags, FlowModInputBuilder>) (value, target) -> target.setFlags(value));
    // OF-1.3|FlowModFlagsV10 --> FlowModInputBuilder
    injectionMapping.put(new ConvertorKey(OFConstants.OFP_VERSION_1_0, FlowModInputBuilder.class), (ResultInjector<FlowModFlagsV10, FlowModInputBuilder>) (value, target) -> target.setFlagsV10(value));
}
Also used : FlowModFlags(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.FlowModFlags) EncodeConstants(org.opendaylight.openflowjava.protocol.api.util.EncodeConstants) Map(java.util.Map) ConvertorKey(org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.common.ConvertorKey) Optional(java.util.Optional) HashMap(java.util.HashMap) ResultInjector(org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.common.ResultInjector) FlowModInputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.FlowModInputBuilder) FlowModFlagsV10(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.FlowModFlagsV10) OFConstants(org.opendaylight.openflowplugin.api.OFConstants) FlowModFlags(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.FlowModFlags) ConvertorKey(org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.common.ConvertorKey) FlowModFlagsV10(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.FlowModFlagsV10) FlowModInputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.FlowModInputBuilder)

Example 2 with ConvertorKey

use of org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.common.ConvertorKey in project openflowplugin by opendaylight.

the class MatchInjector method addInjectors.

private static void addInjectors(final Map<ConvertorKey, ResultInjector<?, ?>> injectionMapping) {
    // OF-1.3|List<MatchEntries> --> FlowModInputBuilder
    injectionMapping.put(new ConvertorKey(OFConstants.OFP_VERSION_1_3, FlowModInputBuilder.class), (ResultInjector<List<MatchEntry>, FlowModInputBuilder>) (value, target) -> target.setMatch(wrapMatchV13(value).build()));
    // OF-1.3|List<MatchEntries> --> OxmFieldsActionBuilder
    injectionMapping.put(new ConvertorKey(OFConstants.OFP_VERSION_1_3, SetFieldActionBuilder.class), (ResultInjector<List<MatchEntry>, SetFieldActionBuilder>) (value, target) -> target.setMatchEntry(value));
    // OF-1.0|MatchV10Builder --> FlowModInputBuilder
    injectionMapping.put(new ConvertorKey(OFConstants.OFP_VERSION_1_0, FlowModInputBuilder.class), (ResultInjector<MatchV10, FlowModInputBuilder>) (value, target) -> target.setMatchV10(value));
    // OF-1.3|List<MatchEntries> --> MultipartRequestFlowBuilder
    injectionMapping.put(new ConvertorKey(OFConstants.OFP_VERSION_1_3, MultipartRequestFlowBuilder.class), (ResultInjector<List<MatchEntry>, MultipartRequestFlowBuilder>) (value, target) -> target.setMatch(wrapMatchV13(value).build()));
    // OF-1.0|List<MatchEntries> --> MultipartRequestFlowBuilder
    injectionMapping.put(new ConvertorKey(OFConstants.OFP_VERSION_1_0, MultipartRequestFlowBuilder.class), (ResultInjector<MatchV10, MultipartRequestFlowBuilder>) (value, target) -> target.setMatchV10(value));
    // OF-1.3|List<MatchEntries> --> MultipartRequestAggregateBuilder
    injectionMapping.put(new ConvertorKey(OFConstants.OFP_VERSION_1_3, MultipartRequestAggregateBuilder.class), (ResultInjector<List<MatchEntry>, MultipartRequestAggregateBuilder>) (value, target) -> target.setMatch(wrapMatchV13(value).build()));
    // OF-1.0|List<MatchEntries> --> MultipartRequestAggregateBuilder
    injectionMapping.put(new ConvertorKey(OFConstants.OFP_VERSION_1_0, MultipartRequestAggregateBuilder.class), (ResultInjector<MatchV10, MultipartRequestAggregateBuilder>) (value, target) -> target.setMatchV10(value));
}
Also used : MultipartRequestAggregateBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.aggregate._case.MultipartRequestAggregateBuilder) ConvertorKey(org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.common.ConvertorKey) HashMap(java.util.HashMap) OFConstants(org.opendaylight.openflowplugin.api.OFConstants) List(java.util.List) MatchEntry(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry) EncodeConstants(org.opendaylight.openflowjava.protocol.api.util.EncodeConstants) Map(java.util.Map) SetFieldActionBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.set.field._case.SetFieldActionBuilder) Optional(java.util.Optional) MatchBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.grouping.MatchBuilder) MatchV10(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.v10.grouping.MatchV10) ResultInjector(org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.common.ResultInjector) MultipartRequestFlowBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.flow._case.MultipartRequestFlowBuilder) FlowModInputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.FlowModInputBuilder) FlowConvertor(org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.flow.FlowConvertor) MultipartRequestAggregateBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.aggregate._case.MultipartRequestAggregateBuilder) MultipartRequestFlowBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.flow._case.MultipartRequestFlowBuilder) ConvertorKey(org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.common.ConvertorKey) List(java.util.List) SetFieldActionBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.set.field._case.SetFieldActionBuilder) FlowModInputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.FlowModInputBuilder) MatchV10(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.v10.grouping.MatchV10)

Aggregations

HashMap (java.util.HashMap)2 Map (java.util.Map)2 Optional (java.util.Optional)2 EncodeConstants (org.opendaylight.openflowjava.protocol.api.util.EncodeConstants)2 OFConstants (org.opendaylight.openflowplugin.api.OFConstants)2 ConvertorKey (org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.common.ConvertorKey)2 ResultInjector (org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.common.ResultInjector)2 FlowModInputBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.FlowModInputBuilder)2 List (java.util.List)1 FlowConvertor (org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.flow.FlowConvertor)1 SetFieldActionBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.set.field._case.SetFieldActionBuilder)1 FlowModFlags (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.FlowModFlags)1 FlowModFlagsV10 (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.FlowModFlagsV10)1 MatchEntry (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry)1 MatchBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.grouping.MatchBuilder)1 MatchV10 (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.v10.grouping.MatchV10)1 MultipartRequestAggregateBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.aggregate._case.MultipartRequestAggregateBuilder)1 MultipartRequestFlowBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.flow._case.MultipartRequestFlowBuilder)1