Search in sources :

Example 1 with CodecPreconditionException

use of org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.CodecPreconditionException in project openflowplugin by opendaylight.

the class ArpShaConvertor method convert.

@Override
public MatchEntry convert(Extension extension) {
    Optional<NxmNxArpShaGrouping> matchGrouping = MatchUtil.ARP_SHA_RESOLVER.getExtension(extension);
    if (!matchGrouping.isPresent()) {
        throw new CodecPreconditionException(extension);
    }
    MacAddress macAddress = matchGrouping.get().getNxmNxArpSha().getMacAddress();
    ArpShaCaseValueBuilder arpShaCaseValueBuilder = new ArpShaCaseValueBuilder();
    arpShaCaseValueBuilder.setArpShaValues(new ArpShaValuesBuilder().setMacAddress(macAddress).build());
    return MatchUtil.createDefaultMatchEntryBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxArpSha.class, Nxm1Class.class, arpShaCaseValueBuilder.build()).build();
}
Also used : NxmNxArpShaGrouping(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxmNxArpShaGrouping) Nxm1Class(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Nxm1Class) ArpShaValuesBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.ofj.nxm.nx.match.arp.sha.grouping.ArpShaValuesBuilder) ArpShaCaseValueBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.ArpShaCaseValueBuilder) 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) NxmNxArpSha(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.nxm.nx.arp.sha.grouping.NxmNxArpSha)

Example 2 with CodecPreconditionException

use of org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.CodecPreconditionException in project openflowplugin by opendaylight.

the class ArpThaConvertor method convert.

@Override
public MatchEntry convert(Extension extension) {
    Optional<NxmNxArpThaGrouping> matchGrouping = MatchUtil.ARP_THA_RESOLVER.getExtension(extension);
    if (!matchGrouping.isPresent()) {
        throw new CodecPreconditionException(extension);
    }
    MacAddress macAddress = matchGrouping.get().getNxmNxArpTha().getMacAddress();
    ArpThaCaseValueBuilder arpThaCaseValueBuilder = new ArpThaCaseValueBuilder();
    arpThaCaseValueBuilder.setArpThaValues(new ArpThaValuesBuilder().setMacAddress(macAddress).build());
    return MatchUtil.createDefaultMatchEntryBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxArpTha.class, Nxm1Class.class, arpThaCaseValueBuilder.build()).build();
}
Also used : 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) NxmNxArpTha(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.nxm.nx.arp.tha.grouping.NxmNxArpTha) ArpThaValuesBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.ofj.nxm.nx.match.arp.tha.grouping.ArpThaValuesBuilder) NxmNxArpThaGrouping(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxmNxArpThaGrouping) ArpThaCaseValueBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.ArpThaCaseValueBuilder)

Example 3 with CodecPreconditionException

use of org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.CodecPreconditionException in project openflowplugin by opendaylight.

the class CtMarkConvertor method convert.

/*
     * (non-Javadoc)
     *
     * @see
     * org.opendaylight.openflowplugin.extension.api.ConvertorToOFJava#convert
     * (org
     * .opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.general
     * .rev140714.general.extension.grouping.Extension)
     */
@Override
public MatchEntry convert(Extension extension) {
    Optional<NxmNxCtMarkGrouping> matchGrouping = MatchUtil.CT_MARK_RESOLVER.getExtension(extension);
    if (!matchGrouping.isPresent()) {
        throw new CodecPreconditionException(extension);
    }
    CtMarkCaseValueBuilder ctMarkCaseValueBuilder = new CtMarkCaseValueBuilder();
    CtMarkValuesBuilder ctMarkValuesBuilder = new CtMarkValuesBuilder();
    ctMarkValuesBuilder.setCtMark(matchGrouping.get().getNxmNxCtMark().getCtMark());
    ctMarkValuesBuilder.setMask(matchGrouping.get().getNxmNxCtMark().getMask());
    ctMarkCaseValueBuilder.setCtMarkValues(ctMarkValuesBuilder.build());
    MatchEntryBuilder ofMatch = MatchUtil.createDefaultMatchEntryBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxCtMark.class, Nxm1Class.class, ctMarkCaseValueBuilder.build());
    ofMatch.setHasMask(true);
    return ofMatch.build();
}
Also used : CtMarkValuesBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.ofj.nxm.nx.match.ct.mark.grouping.CtMarkValuesBuilder) MatchEntryBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder) CtMarkCaseValueBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.CtMarkCaseValueBuilder) NxmNxCtMarkGrouping(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxmNxCtMarkGrouping) CodecPreconditionException(org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.CodecPreconditionException)

Example 4 with CodecPreconditionException

use of org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.CodecPreconditionException in project openflowplugin by opendaylight.

the class CtZoneConvertor method convert.

@Override
public MatchEntry convert(Extension extension) {
    Optional<NxmNxCtZoneGrouping> matchGrouping = MatchUtil.CT_ZONE_RESOLVER.getExtension(extension);
    if (!matchGrouping.isPresent()) {
        throw new CodecPreconditionException(extension);
    }
    CtZoneCaseValueBuilder ctZoneCaseValueBuilder = new CtZoneCaseValueBuilder();
    CtZoneValuesBuilder ctZoneValuesBuilder = new CtZoneValuesBuilder();
    ctZoneValuesBuilder.setCtZone(matchGrouping.get().getNxmNxCtZone().getCtZone());
    ctZoneCaseValueBuilder.setCtZoneValues(ctZoneValuesBuilder.build());
    MatchEntryBuilder ofMatch = MatchUtil.createDefaultMatchEntryBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxCtZone.class, Nxm1Class.class, ctZoneCaseValueBuilder.build());
    return ofMatch.build();
}
Also used : CtZoneCaseValueBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.CtZoneCaseValueBuilder) MatchEntryBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder) NxmNxCtZoneGrouping(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxmNxCtZoneGrouping) CtZoneValuesBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.ofj.nxm.nx.match.ct.zone.grouping.CtZoneValuesBuilder) CodecPreconditionException(org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.CodecPreconditionException)

Example 5 with CodecPreconditionException

use of org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.CodecPreconditionException 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)32 Nxm1Class (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Nxm1Class)17 Nxm0Class (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Nxm0Class)7 MatchEntryBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder)7 MacAddress (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.MacAddress)6 Ipv4Address (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Address)2 BigInteger (java.math.BigInteger)1 ArpShaValuesBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.ofj.nxm.nx.match.arp.sha.grouping.ArpShaValuesBuilder)1 ArpThaValuesBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.ofj.nxm.nx.match.arp.tha.grouping.ArpThaValuesBuilder)1 CtMarkValuesBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.ofj.nxm.nx.match.ct.mark.grouping.CtMarkValuesBuilder)1 CtStateValuesBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.ofj.nxm.nx.match.ct.state.grouping.CtStateValuesBuilder)1 CtZoneValuesBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.ofj.nxm.nx.match.ct.zone.grouping.CtZoneValuesBuilder)1 EncapEthDstValuesBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.ofj.nxm.nx.match.encap.eth.dst.grouping.EncapEthDstValuesBuilder)1 EncapEthSrcValuesBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.ofj.nxm.nx.match.encap.eth.src.grouping.EncapEthSrcValuesBuilder)1 EncapEthTypeValuesBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.ofj.nxm.nx.match.encap.eth.type.grouping.EncapEthTypeValuesBuilder)1 NshMdtypeValuesBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.ofj.nxm.nx.match.nsh.mdtype.grouping.NshMdtypeValuesBuilder)1 NshNpValuesBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.ofj.nxm.nx.match.nsh.np.grouping.NshNpValuesBuilder)1 Nshc1ValuesBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.ofj.nxm.nx.match.nshc._1.grouping.Nshc1ValuesBuilder)1 Nshc2ValuesBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.ofj.nxm.nx.match.nshc._2.grouping.Nshc2ValuesBuilder)1 Nshc3ValuesBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.ofj.nxm.nx.match.nshc._3.grouping.Nshc3ValuesBuilder)1