Search in sources :

Example 1 with NxmOfUdpDstGrouping

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

the class UdpDstConvertor method convert.

@Override
public MatchEntry convert(Extension extension) {
    Optional<NxmOfUdpDstGrouping> matchGrouping = MatchUtil.UDP_DST_RESOLVER.getExtension(extension);
    if (!matchGrouping.isPresent()) {
        throw new CodecPreconditionException(extension);
    }
    UdpDstCaseValueBuilder udpDstCaseValueBuilder = new UdpDstCaseValueBuilder();
    UdpDstValuesBuilder udpDstValuesBuilder = new UdpDstValuesBuilder();
    udpDstValuesBuilder.setPort(matchGrouping.get().getNxmOfUdpDst().getPort());
    udpDstValuesBuilder.setMask(matchGrouping.get().getNxmOfUdpDst().getMask());
    udpDstCaseValueBuilder.setUdpDstValues(udpDstValuesBuilder.build());
    MatchEntryBuilder ofMatch = MatchUtil.createDefaultMatchEntryBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmOfUdpDst.class, Nxm0Class.class, udpDstCaseValueBuilder.build());
    ofMatch.setHasMask(true);
    return ofMatch.build();
}
Also used : NxmOfUdpDstGrouping(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxmOfUdpDstGrouping) MatchEntryBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder) UdpDstValuesBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.ofj.nxm.of.match.udp.dst.grouping.UdpDstValuesBuilder) UdpDstCaseValueBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.UdpDstCaseValueBuilder) CodecPreconditionException(org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.CodecPreconditionException)

Aggregations

CodecPreconditionException (org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.CodecPreconditionException)1 MatchEntryBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder)1 UdpDstValuesBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.ofj.nxm.of.match.udp.dst.grouping.UdpDstValuesBuilder)1 UdpDstCaseValueBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.UdpDstCaseValueBuilder)1 NxmOfUdpDstGrouping (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxmOfUdpDstGrouping)1