Search in sources :

Example 1 with NxmNxEncapEthSrcGrouping

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxmNxEncapEthSrcGrouping in project openflowplugin by opendaylight.

the class EncapEthSrcConvertor method convert.

@Override
public MatchEntry convert(Extension extension) {
    Optional<NxmNxEncapEthSrcGrouping> matchGrouping = MatchUtil.ENCAP_ETH_SRC_RESOLVER.getExtension(extension);
    if (!matchGrouping.isPresent()) {
        throw new CodecPreconditionException(extension);
    }
    MacAddress macAddress = matchGrouping.get().getNxmNxEncapEthSrc().getMacAddress();
    EncapEthSrcCaseValueBuilder encapEthSrcCaseValueBuilder = new EncapEthSrcCaseValueBuilder();
    encapEthSrcCaseValueBuilder.setEncapEthSrcValues(new EncapEthSrcValuesBuilder().setMacAddress(macAddress).build());
    return MatchUtil.createDefaultMatchEntryBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxEncapEthSrc.class, Nxm1Class.class, encapEthSrcCaseValueBuilder.build()).build();
}
Also used : EncapEthSrcValuesBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.ofj.nxm.nx.match.encap.eth.src.grouping.EncapEthSrcValuesBuilder) Nxm1Class(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Nxm1Class) MacAddress(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.MacAddress) CodecPreconditionException(org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.CodecPreconditionException) EncapEthSrcCaseValueBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.EncapEthSrcCaseValueBuilder) NxmNxEncapEthSrc(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.nxm.nx.encap.eth.src.grouping.NxmNxEncapEthSrc) NxmNxEncapEthSrcGrouping(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxmNxEncapEthSrcGrouping)

Aggregations

CodecPreconditionException (org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.CodecPreconditionException)1 MacAddress (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.MacAddress)1 Nxm1Class (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Nxm1Class)1 EncapEthSrcValuesBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.ofj.nxm.nx.match.encap.eth.src.grouping.EncapEthSrcValuesBuilder)1 EncapEthSrcCaseValueBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.EncapEthSrcCaseValueBuilder)1 NxmNxEncapEthSrcGrouping (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxmNxEncapEthSrcGrouping)1 NxmNxEncapEthSrc (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.nxm.nx.encap.eth.src.grouping.NxmNxEncapEthSrc)1