use of org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.CodecPreconditionException in project openflowplugin by opendaylight.
the class EthDstConvertor method convert.
@Override
public MatchEntry convert(Extension extension) {
Optional<NxmOfEthDstGrouping> matchGrouping = MatchUtil.ETH_DST_RESOLVER.getExtension(extension);
if (!matchGrouping.isPresent()) {
throw new CodecPreconditionException(extension);
}
MacAddress macAddress = matchGrouping.get().getNxmOfEthDst().getMacAddress();
EthDstCaseValueBuilder ethDstCaseValueBuilder = new EthDstCaseValueBuilder();
ethDstCaseValueBuilder.setEthDstValues(new EthDstValuesBuilder().setMacAddress(macAddress).build());
return MatchUtil.createDefaultMatchEntryBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmOfEthDst.class, Nxm0Class.class, ethDstCaseValueBuilder.build()).build();
}
use of org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.CodecPreconditionException in project openflowplugin by opendaylight.
the class NshMdtypeConvertor method convert.
@Override
public MatchEntry convert(Extension extension) {
Optional<NxmNxNshMdtypeGrouping> matchGrouping = MatchUtil.NSH_MDTYPE_RESOLVER.getExtension(extension);
if (!matchGrouping.isPresent()) {
throw new CodecPreconditionException(extension);
}
Short value = matchGrouping.get().getNxmNxNshMdtype().getValue();
NshMdtypeCaseValueBuilder nshMdtypeCaseValueBuilder = new NshMdtypeCaseValueBuilder();
nshMdtypeCaseValueBuilder.setNshMdtypeValues(new NshMdtypeValuesBuilder().setValue(value).build());
return MatchUtil.createDefaultMatchEntryBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxNshMdtype.class, Nxm1Class.class, nshMdtypeCaseValueBuilder.build()).build();
}
use of org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.CodecPreconditionException in project openflowplugin by opendaylight.
the class Nshc1Convertor method convert.
@Override
public MatchEntry convert(Extension extension) {
Optional<NxmNxNshc1Grouping> matchGrouping = MatchUtil.NSC1_RESOLVER.getExtension(extension);
if (!matchGrouping.isPresent()) {
throw new CodecPreconditionException(extension);
}
Long value = matchGrouping.get().getNxmNxNshc1().getValue();
Nshc1CaseValueBuilder nsc1CaseValueBuilder = new Nshc1CaseValueBuilder();
nsc1CaseValueBuilder.setNshc1Values(new Nshc1ValuesBuilder().setNshc(value).build());
return MatchUtil.createDefaultMatchEntryBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxNshc1.class, Nxm1Class.class, nsc1CaseValueBuilder.build()).build();
}
use of org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.CodecPreconditionException in project openflowplugin by opendaylight.
the class NsiConvertor method convert.
@Override
public MatchEntry convert(Extension extension) {
Optional<NxmNxNsiGrouping> matchGrouping = MatchUtil.NSI_RESOLVER.getExtension(extension);
if (!matchGrouping.isPresent()) {
throw new CodecPreconditionException(extension);
}
Short value = matchGrouping.get().getNxmNxNsi().getNsi();
NsiCaseValueBuilder nsiCaseValueBuilder = new NsiCaseValueBuilder();
nsiCaseValueBuilder.setNsiValues(new NsiValuesBuilder().setNsi(value).build());
return MatchUtil.createDefaultMatchEntryBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxNsi.class, Nxm1Class.class, nsiCaseValueBuilder.build()).build();
}
use of org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.CodecPreconditionException in project openflowplugin by opendaylight.
the class NxmInPortConvertor method convert.
@Override
public MatchEntry convert(Extension extension) {
Optional<NxmOfInPortGrouping> matchGrouping = MatchUtil.NXM_OF_INPORT_RESOLVER.getExtension(extension);
if (!matchGrouping.isPresent()) {
throw new CodecPreconditionException(extension);
}
Integer value = matchGrouping.get().getOfInPort().getValue();
OfInPortCaseValueBuilder inPortCaseValueBuilder = new OfInPortCaseValueBuilder();
inPortCaseValueBuilder.setNxmOfInPortValues(new NxmOfInPortValuesBuilder().setValue(value).build());
return MatchUtil.createDefaultMatchEntryBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmOfInPort.class, Nxm0Class.class, inPortCaseValueBuilder.build()).build();
}
Aggregations