use of org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetVlanIdActionCaseBuilder in project openflowplugin by opendaylight.
the class FlowConvertorTest method testCloneAndAugmentFlowWithSetVlanId.
@Test
public void testCloneAndAugmentFlowWithSetVlanId() {
MockFlow mockFlow = new MockFlow();
Action action1 = createAction(new SetVlanIdActionCaseBuilder().setSetVlanIdAction(new SetVlanIdActionBuilder().setVlanId(new VlanId(10)).build()).build(), 0);
mockFlow.setMatch(new MatchBuilder().setEthernetMatch(createEthernetMatch()).build());
mockFlow.setInstructions(toApplyInstruction(Collections.singletonList(action1)));
VersionDatapathIdConvertorData data = new VersionDatapathIdConvertorData(OFConstants.OFP_VERSION_1_3);
data.setDatapathId(BigInteger.ONE);
List<FlowModInputBuilder> flowModInputBuilders = convert(mockFlow, data);
Assert.assertEquals(2, flowModInputBuilders.size());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetVlanIdActionCaseBuilder in project openflowplugin by opendaylight.
the class OpenflowPluginBulkTransactionProvider method createAppyActionInstruction7.
private static InstructionsBuilder createAppyActionInstruction7() {
List<Action> actionList = new ArrayList<>();
ActionBuilder ab = new ActionBuilder();
SetVlanIdActionBuilder vl = new SetVlanIdActionBuilder();
VlanId vlanId = new VlanId(4012);
vl.setVlanId(vlanId);
ab.setAction(new SetVlanIdActionCaseBuilder().setSetVlanIdAction(vl.build()).build());
actionList.add(ab.build());
// Create an Apply Action
ApplyActionsBuilder aab = new ApplyActionsBuilder();
aab.setAction(actionList);
// Wrap our Apply Action in an Instruction
InstructionBuilder ib = new InstructionBuilder();
ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
// Put our Instruction in a list of Instructions
InstructionsBuilder isb = new InstructionsBuilder();
List<Instruction> instructions = new ArrayList<>();
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
}
Aggregations