use of org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.CodecPreconditionException in project openflowplugin by opendaylight.
the class TunIPv4DstConvertor method convert.
@Override
public MatchEntry convert(Extension extension) {
Optional<NxmNxTunIpv4DstGrouping> matchGrouping = MatchUtil.TUN_IPV4_DST_RESOLVER.getExtension(extension);
if (!matchGrouping.isPresent()) {
throw new CodecPreconditionException(extension);
}
Ipv4Address value = matchGrouping.get().getNxmNxTunIpv4Dst().getIpv4Address();
TunIpv4DstCaseValueBuilder tunIpv4DstCaseValueBuilder = new TunIpv4DstCaseValueBuilder();
tunIpv4DstCaseValueBuilder.setTunIpv4DstValues(new TunIpv4DstValuesBuilder().setValue(MatchUtil.ipv4ToLong(value)).build());
return MatchUtil.createDefaultMatchEntryBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxTunIpv4Dst.class, Nxm1Class.class, tunIpv4DstCaseValueBuilder.build()).build();
}
use of org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.CodecPreconditionException in project openflowplugin by opendaylight.
the class TunIdConvertor method convert.
@Override
public MatchEntry convert(final Extension extension) {
Optional<NxmNxTunIdGrouping> matchGrouping = MatchUtil.TUN_ID_RESOLVER.getExtension(extension);
if (!matchGrouping.isPresent()) {
throw new CodecPreconditionException(extension);
}
BigInteger value = matchGrouping.get().getNxmNxTunId().getValue();
TunIdCaseValueBuilder tunnelIdCaseBuilder = new TunIdCaseValueBuilder();
TunIdValuesBuilder tunnelIdBuilder = new TunIdValuesBuilder();
tunnelIdBuilder.setValue(value);
tunnelIdCaseBuilder.setTunIdValues(tunnelIdBuilder.build());
return MatchUtil.createDefaultMatchEntryBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxTunId.class, Nxm1Class.class, tunnelIdCaseBuilder.build()).build();
}
use of org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.CodecPreconditionException in project openflowplugin by opendaylight.
the class Nshc2Convertor method convert.
@Override
public MatchEntry convert(Extension extension) {
Optional<NxmNxNshc2Grouping> matchGrouping = MatchUtil.NSC2_RESOLVER.getExtension(extension);
if (!matchGrouping.isPresent()) {
throw new CodecPreconditionException(extension);
}
Long value = matchGrouping.get().getNxmNxNshc2().getValue();
Nshc2CaseValueBuilder nsc2CaseValueBuilder = new Nshc2CaseValueBuilder();
nsc2CaseValueBuilder.setNshc2Values(new Nshc2ValuesBuilder().setNshc(value).build());
return MatchUtil.createDefaultMatchEntryBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxNshc2.class, Nxm1Class.class, nsc2CaseValueBuilder.build()).build();
}
use of org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.CodecPreconditionException in project openflowplugin by opendaylight.
the class Nshc4Convertor method convert.
@Override
public MatchEntry convert(Extension extension) {
Optional<NxmNxNshc4Grouping> matchGrouping = MatchUtil.NSC4_RESOLVER.getExtension(extension);
if (!matchGrouping.isPresent()) {
throw new CodecPreconditionException(extension);
}
Long value = matchGrouping.get().getNxmNxNshc4().getValue();
Nshc4CaseValueBuilder nsc4CaseValueBuilder = new Nshc4CaseValueBuilder();
nsc4CaseValueBuilder.setNshc4Values(new Nshc4ValuesBuilder().setNshc(value).build());
return MatchUtil.createDefaultMatchEntryBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxNshc4.class, Nxm1Class.class, nsc4CaseValueBuilder.build()).build();
}
use of org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.CodecPreconditionException in project openflowplugin by opendaylight.
the class NspConvertor method convert.
@Override
public MatchEntry convert(Extension extension) {
Optional<NxmNxNspGrouping> matchGrouping = MatchUtil.NSP_RESOLVER.getExtension(extension);
if (!matchGrouping.isPresent()) {
throw new CodecPreconditionException(extension);
}
Long value = matchGrouping.get().getNxmNxNsp().getValue();
NspCaseValueBuilder nspCaseValueBuilder = new NspCaseValueBuilder();
nspCaseValueBuilder.setNspValues(new NspValuesBuilder().setNsp(value).build());
return MatchUtil.createDefaultMatchEntryBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxNsp.class, Nxm1Class.class, nspCaseValueBuilder.build()).build();
}
Aggregations