use of org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionBuilder in project openflowplugin by opendaylight.
the class SalToOfSetVlanIdActionCase method process.
@Nonnull
@Override
public Optional<Action> process(@Nonnull final SetVlanIdActionCase source, final ActionConvertorData data, ConvertorExecutor convertorExecutor) {
MatchEntryBuilder matchBuilder = new MatchEntryBuilder();
matchBuilder.setOxmClass(OpenflowBasicClass.class);
matchBuilder.setOxmMatchField(VlanVid.class);
matchBuilder.setHasMask(false);
VlanVidCaseBuilder vlanVidCaseBuilder = new VlanVidCaseBuilder();
VlanVidBuilder vlanVidBuilder = new VlanVidBuilder();
vlanVidBuilder.setCfiBit(true);
SetVlanIdAction setvlanidaction = source.getSetVlanIdAction();
vlanVidBuilder.setVlanVid(setvlanidaction.getVlanId().getValue());
vlanVidCaseBuilder.setVlanVid(vlanVidBuilder.build());
matchBuilder.setMatchEntryValue(vlanVidCaseBuilder.build());
List<MatchEntry> entries = new ArrayList<>();
entries.add(matchBuilder.build());
SetFieldActionBuilder setFieldBuilder = new SetFieldActionBuilder();
setFieldBuilder.setMatchEntry(entries);
SetFieldCaseBuilder setFieldCaseBuilder = new SetFieldCaseBuilder();
setFieldCaseBuilder.setSetFieldAction(setFieldBuilder.build());
return Optional.of(new ActionBuilder().setActionChoice(setFieldCaseBuilder.build()).build());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionBuilder in project openflowplugin by opendaylight.
the class SalToOfSetVlanPcpActionCase method process.
@Nonnull
@Override
public Optional<Action> process(@Nonnull final SetVlanPcpActionCase source, final ActionConvertorData data, ConvertorExecutor convertorExecutor) {
SetVlanPcpAction setvlanpcpaction = source.getSetVlanPcpAction();
SetFieldCaseBuilder setFieldCaseBuilder = new SetFieldCaseBuilder();
SetFieldActionBuilder setFieldBuilder = new SetFieldActionBuilder();
List<MatchEntry> matchEntriesList = new ArrayList<>();
matchEntriesList.add(MatchConvertorUtil.toOfVlanPcp(setvlanpcpaction.getVlanPcp()));
setFieldBuilder.setMatchEntry(matchEntriesList);
setFieldCaseBuilder.setSetFieldAction(setFieldBuilder.build());
return Optional.of(new ActionBuilder().setActionChoice(setFieldCaseBuilder.build()).build());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionBuilder in project openflowplugin by opendaylight.
the class GroupConvertorTest method assembleActionBuilder.
private static ActionBuilder assembleActionBuilder(final String groupName, final int actionOrder) {
final GroupActionBuilder groupActionBuilder = new GroupActionBuilder();
groupActionBuilder.setGroup(groupName);
final GroupActionCaseBuilder groupActionCaseBuilder = new GroupActionCaseBuilder();
groupActionCaseBuilder.setGroupAction(groupActionBuilder.build());
final ActionBuilder actionsBld = new ActionBuilder();
actionsBld.setOrder(actionOrder).setAction(groupActionCaseBuilder.build());
return actionsBld;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionBuilder in project openflowplugin by opendaylight.
the class GroupConvertorTest method assembleSetMplsTtlActionBuilder.
private static ActionBuilder assembleSetMplsTtlActionBuilder(final int actionOrder) {
final SetMplsTtlActionBuilder setMplsTtlActionBuilder = new SetMplsTtlActionBuilder();
setMplsTtlActionBuilder.setMplsTtl((short) 0X1);
final SetMplsTtlActionCaseBuilder setMplsTtlActionCaseBuilder = new SetMplsTtlActionCaseBuilder();
setMplsTtlActionCaseBuilder.setSetMplsTtlAction(setMplsTtlActionBuilder.build());
final ActionBuilder actionsB3 = new ActionBuilder();
actionsB3.setOrder(actionOrder).setAction(setMplsTtlActionCaseBuilder.build());
return actionsB3;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionBuilder in project openflowplugin by opendaylight.
the class GroupConvertorTest method assembleCopyTtlInBuilder.
private static ActionBuilder assembleCopyTtlInBuilder(final int actionOrder) {
final CopyTtlInBuilder copyTtlB = new CopyTtlInBuilder();
final CopyTtlInCaseBuilder copyTtlInCaseBuilder = new CopyTtlInCaseBuilder();
copyTtlInCaseBuilder.setCopyTtlIn(copyTtlB.build());
final ActionBuilder actionsB2 = new ActionBuilder();
actionsB2.setOrder(actionOrder).setAction(copyTtlInCaseBuilder.build());
return actionsB2;
}
Aggregations