use of org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.nw.tos.action._case.SetNwTosAction in project openflowplugin by opendaylight.
the class SalToOfSetNwTosActionV10Case method process.
@Nonnull
@Override
public Optional<Action> process(@Nonnull final SetNwTosActionCase source, final ActionConvertorData data, ConvertorExecutor convertorExecutor) {
SetNwTosAction setnwtosaction = source.getSetNwTosAction();
SetNwTosActionBuilder setNwTosActionBuilder = new SetNwTosActionBuilder();
SetNwTosCaseBuilder setNwTosCaseBuilder = new SetNwTosCaseBuilder();
setNwTosActionBuilder.setNwTos(setnwtosaction.getTos().shortValue());
setNwTosCaseBuilder.setSetNwTosAction(setNwTosActionBuilder.build());
return Optional.of(new ActionBuilder().setActionChoice(setNwTosCaseBuilder.build()).build());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.nw.tos.action._case.SetNwTosAction in project openflowplugin by opendaylight.
the class SalToOfSetNwTosActionCase method process.
@Nonnull
@Override
public Optional<Action> process(@Nonnull final SetNwTosActionCase source, final ActionConvertorData data, ConvertorExecutor convertorExecutor) {
SetNwTosAction setnwtosaction = source.getSetNwTosAction();
SetFieldCaseBuilder setFieldCaseBuilder = new SetFieldCaseBuilder();
SetFieldActionBuilder setFieldBuilder = new SetFieldActionBuilder();
List<MatchEntry> entries = new ArrayList<>();
entries.add(MatchConvertorUtil.toOfIpDscp(new Dscp(ActionUtil.tosToDscp(setnwtosaction.getTos().shortValue()))));
setFieldBuilder.setMatchEntry(entries);
setFieldCaseBuilder.setSetFieldAction(setFieldBuilder.build());
return Optional.of(new ActionBuilder().setActionChoice(setFieldCaseBuilder.build()).build());
}
Aggregations