use of org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.CodecPreconditionException in project openflowplugin by opendaylight.
the class ArpOpConvertor method convert.
@Override
public MatchEntry convert(Extension extension) {
Optional<NxmOfArpOpGrouping> matchGrouping = MatchUtil.ARP_OP_RESOLVER.getExtension(extension);
if (!matchGrouping.isPresent()) {
throw new CodecPreconditionException(extension);
}
Integer value = matchGrouping.get().getNxmOfArpOp().getValue();
ArpOpCaseValueBuilder arpOpCaseValueBuilder = new ArpOpCaseValueBuilder();
arpOpCaseValueBuilder.setArpOpValues(new ArpOpValuesBuilder().setValue(value).build());
return MatchUtil.createDefaultMatchEntryBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmOfArpOp.class, Nxm0Class.class, arpOpCaseValueBuilder.build()).build();
}
use of org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.CodecPreconditionException in project openflowplugin by opendaylight.
the class ArpSpaConvertor method convert.
@Override
public MatchEntry convert(Extension extension) {
Optional<NxmOfArpSpaGrouping> matchGrouping = MatchUtil.ARP_SPA_RESOLVER.getExtension(extension);
if (!matchGrouping.isPresent()) {
throw new CodecPreconditionException(extension);
}
Long value = IpConverter.ipv4AddressToLong(matchGrouping.get().getNxmOfArpSpa().getIpv4Address());
ArpSpaCaseValueBuilder arpSpaCaseValueBuilder = new ArpSpaCaseValueBuilder();
arpSpaCaseValueBuilder.setArpSpaValues(new ArpSpaValuesBuilder().setValue(value).build());
return MatchUtil.createDefaultMatchEntryBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmOfArpSpa.class, Nxm0Class.class, arpSpaCaseValueBuilder.build()).build();
}
use of org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.CodecPreconditionException in project openflowplugin by opendaylight.
the class ArpTpaConvertor method convert.
@Override
public MatchEntry convert(Extension extension) {
Optional<NxmOfArpTpaGrouping> matchGrouping = MatchUtil.ARP_TPA_RESOLVER.getExtension(extension);
if (!matchGrouping.isPresent()) {
throw new CodecPreconditionException(extension);
}
Long value = IpConverter.ipv4AddressToLong(matchGrouping.get().getNxmOfArpTpa().getIpv4Address());
ArpTpaCaseValueBuilder arpTpaCaseValueBuilder = new ArpTpaCaseValueBuilder();
arpTpaCaseValueBuilder.setArpTpaValues(new ArpTpaValuesBuilder().setValue(value).build());
return MatchUtil.createDefaultMatchEntryBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmOfArpTpa.class, Nxm0Class.class, arpTpaCaseValueBuilder.build()).build();
}
use of org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.CodecPreconditionException in project openflowplugin by opendaylight.
the class EncapEthTypeConvertor method convert.
@Override
public MatchEntry convert(Extension extension) {
Optional<NxmNxEncapEthTypeGrouping> matchGrouping = MatchUtil.ENCAP_ETH_TYPE_RESOLVER.getExtension(extension);
if (!matchGrouping.isPresent()) {
throw new CodecPreconditionException(extension);
}
Integer value = matchGrouping.get().getNxmNxEncapEthType().getValue();
EncapEthTypeCaseValueBuilder encapEthTypeCaseValueBuilder = new EncapEthTypeCaseValueBuilder();
encapEthTypeCaseValueBuilder.setEncapEthTypeValues(new EncapEthTypeValuesBuilder().setEncapEthType(value).build());
return MatchUtil.createDefaultMatchEntryBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxEncapEthType.class, Nxm1Class.class, encapEthTypeCaseValueBuilder.build()).build();
}
use of org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.CodecPreconditionException in project openflowplugin by opendaylight.
the class EthSrcConvertor method convert.
@Override
public MatchEntry convert(Extension extension) {
Optional<NxmOfEthSrcGrouping> matchGrouping = MatchUtil.ETH_SRC_RESOLVER.getExtension(extension);
if (!matchGrouping.isPresent()) {
throw new CodecPreconditionException(extension);
}
MacAddress macAddress = matchGrouping.get().getNxmOfEthSrc().getMacAddress();
EthSrcCaseValueBuilder ethSrcCaseValueBuilder = new EthSrcCaseValueBuilder();
ethSrcCaseValueBuilder.setEthSrcValues(new EthSrcValuesBuilder().setMacAddress(macAddress).build());
return MatchUtil.createDefaultMatchEntryBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmOfEthSrc.class, Nxm0Class.class, ethSrcCaseValueBuilder.build()).build();
}
Aggregations