package org.opendaylight.openflowplugin.test;
-import com.google.common.util.concurrent.CheckedFuture;
import com.google.common.util.concurrent.FutureCallback;
import com.google.common.util.concurrent.Futures;
+import com.google.common.util.concurrent.ListenableFuture;
import com.google.common.util.concurrent.MoreExecutors;
import java.math.BigInteger;
import java.util.ArrayList;
-import java.util.Collection;
import java.util.List;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import org.opendaylight.controller.md.sal.binding.api.DataBroker;
import org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;
import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;
import org.opendaylight.controller.sal.binding.api.NotificationService;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Dscp;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Prefix;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6Address;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6FlowLabel;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6Prefix;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.PortNumber;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.InstructionKey;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRef;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeBuilder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+@SuppressWarnings("checkstyle:MethodName")
public class OpenflowpluginTestCommandProvider implements CommandProvider {
private static final Logger LOG = LoggerFactory.getLogger(OpenflowpluginTestCommandProvider.class);
private DataBroker dataBroker;
private final BundleContext ctx;
- private FlowBuilder testFlow;
private static final String ORIGINAL_FLOW_NAME = "Foo";
private static final String UPDATED_FLOW_NAME = "Bar";
private static final String IPV4_PREFIX = "10.0.0.1/24";
private static final String SRC_MAC_ADDRESS = "00:00:00:00:23:ae";
private final SalFlowListener flowEventListener = new FlowEventListenerLoggingImpl();
private final NodeErrorListener nodeErrorListener = new NodeErrorListenerLoggingImpl();
- private static NotificationService notificationService;
+ private NotificationService notificationService;
public OpenflowpluginTestCommandProvider(final BundleContext ctx) {
this.ctx = ctx;
final NodeBuilder builder = new NodeBuilder();
builder.setId(new NodeId(localNodeId));
- builder.setKey(new NodeKey(builder.getId()));
+ builder.withKey(new NodeKey(builder.getId()));
return builder;
}
private InstanceIdentifier<Node> nodeBuilderToInstanceId(final NodeBuilder node) {
- return InstanceIdentifier.create(Nodes.class).child(Node.class, node.getKey());
+ return InstanceIdentifier.create(Nodes.class).child(Node.class, node.key());
}
private FlowBuilder createTestFlow(final NodeBuilder nodeBuilder, final String flowTypeArg, final String tableId) {
flow.setId(new FlowId("12"));
flow.setTableId(getTableId(tableId));
- flow.setKey(key);
+ flow.withKey(key);
flow.setFlowName(ORIGINAL_FLOW_NAME + "X" + flowType);
- testFlow = flow;
return flow;
}
flow.setId(new FlowId("12"));
flow.setTableId(getTableId(tableId));
- flow.setKey(key);
+ flow.withKey(key);
flow.setFlowName(ORIGINAL_FLOW_NAME + "X" + flowType);
- testFlow = flow;
return flow;
}
flow.setPriority(0);
flow.setTableId((short) 0);
final FlowKey key = new FlowKey(new FlowId(Long.toString(id)));
- flow.setKey(key);
- testFlow = flow;
+ flow.withKey(key);
return flow;
}
private short getTableId(final String tableId) {
final short TABLE_ID = 2;
short table = TABLE_ID;
+
+ if (tableId == null) {
+ return table;
+ }
+
try {
table = Short.parseShort(tableId);
- } catch (final Exception ex) {
+ } catch (NumberFormatException ex) {
LOG.info("Parsing String tableId {} failed. Continuing with default tableId {}.",
tableId, table);
}
return table;
}
- /**
- * @return
- */
private static InstructionsBuilder createDecNwTtlInstructions() {
final DecNwTtlBuilder ta = new DecNwTtlBuilder();
final DecNwTtl decNwTtl = ta.build();
final ActionBuilder ab = new ActionBuilder();
ab.setAction(new DecNwTtlCaseBuilder().setDecNwTtl(decNwTtl).build());
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
// Add our drop action to a list
- final List<Action> actionList = new ArrayList<Action>();
+ final List<Action> actionList = new ArrayList<>();
actionList.add(ab.build());
// Create an Apply Action
// Wrap our Apply Action in an Instruction
final InstructionBuilder ib = new InstructionBuilder();
ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
- ib.setKey(new InstructionKey(0));
+ ib.withKey(new InstructionKey(0));
ib.setOrder(0);
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
- final List<Instruction> instructions = new ArrayList<Instruction>();
+ final List<Instruction> instructions = new ArrayList<>();
instructions.add(ib.build());
- ib.setKey(new InstructionKey(0));
+ ib.withKey(new InstructionKey(0));
isb.setInstruction(instructions);
return isb;
}
- /**
- * @return
- */
private static InstructionsBuilder createMeterInstructions() {
final MeterBuilder aab = new MeterBuilder();
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
- final List<Instruction> instructions = new ArrayList<Instruction>();
- ib.setKey(new InstructionKey(0));
+ final List<Instruction> instructions = new ArrayList<>();
+ ib.withKey(new InstructionKey(0));
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
- final List<Instruction> instructions = new ArrayList<Instruction>();
- ib.setKey(new InstructionKey(0));
+ final List<Instruction> instructions = new ArrayList<>();
+ ib.withKey(new InstructionKey(0));
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
- final List<Instruction> instructions = new ArrayList<Instruction>();
- ib.setKey(new InstructionKey(0));
+ final List<Instruction> instructions = new ArrayList<>();
+ ib.withKey(new InstructionKey(0));
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
final DropAction dropAction = dab.build();
final ActionBuilder ab = new ActionBuilder();
ab.setAction(new DropActionCaseBuilder().setDropAction(dropAction).build());
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
// Add our drop action to a list
- final List<Action> actionList = new ArrayList<Action>();
+ final List<Action> actionList = new ArrayList<>();
actionList.add(ab.build());
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
// Create an Apply Action
final ApplyActionsBuilder aab = new ApplyActionsBuilder();
aab.setAction(actionList);
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
- final List<Instruction> instructions = new ArrayList<Instruction>();
- ib.setKey(new InstructionKey(0));
+ final List<Instruction> instructions = new ArrayList<>();
+ ib.withKey(new InstructionKey(0));
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
private static InstructionsBuilder createAppyActionInstruction() {
- final List<Action> actionList = new ArrayList<Action>();
+ final List<Action> actionList = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
final ControllerActionBuilder controller = new ControllerActionBuilder();
controller.setMaxLength(5);
ab.setAction(new ControllerActionCaseBuilder().setControllerAction(controller.build()).build());
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
actionList.add(ab.build());
// Create an Apply Action
final ApplyActionsBuilder aab = new ApplyActionsBuilder();
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
- final List<Instruction> instructions = new ArrayList<Instruction>();
- ib.setKey(new InstructionKey(0));
+ final List<Instruction> instructions = new ArrayList<>();
+ ib.withKey(new InstructionKey(0));
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
private static InstructionsBuilder createAppyActionInstruction1() {
- final List<Action> actionList = new ArrayList<Action>();
+ final List<Action> actionList = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
final OutputActionBuilder output = new OutputActionBuilder();
final Uri value = new Uri("PCEP");
output.setOutputNodeConnector(value);
ab.setAction(new OutputActionCaseBuilder().setOutputAction(output.build()).build());
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
actionList.add(ab.build());
// Create an Apply Action
final ApplyActionsBuilder aab = new ApplyActionsBuilder();
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
- final List<Instruction> instructions = new ArrayList<Instruction>();
- ib.setKey(new InstructionKey(0));
+ final List<Instruction> instructions = new ArrayList<>();
+ ib.withKey(new InstructionKey(0));
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
// test case for Output Port works if the particular port exists
// this particular test-case is for Port : 1
// tested as (addMDFlow openflow:<dpid> f82)
- final List<Action> actionList = new ArrayList<Action>();
+ final List<Action> actionList = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
final OutputActionBuilder output = new OutputActionBuilder();
output.setOutputNodeConnector(value);
ab.setAction(new OutputActionCaseBuilder().setOutputAction(output.build()).build());
ab.setOrder(0);
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
actionList.add(ab.build());
// Create an Apply Action
final ApplyActionsBuilder aab = new ApplyActionsBuilder();
final InstructionBuilder ib = new InstructionBuilder();
ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
ib.setOrder(0);
- ib.setKey(new InstructionKey(0));
+ ib.withKey(new InstructionKey(0));
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
- final List<Instruction> instructions = new ArrayList<Instruction>();
+ final List<Instruction> instructions = new ArrayList<>();
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
}
- private static InstructionsBuilder createSentToControllerInstructions() {
- final List<Action> actionList = new ArrayList<Action>();
+ private static InstructionsBuilder createOutputInstructions(final String outputType, final int outputValue) {
+ final List<Action> actionList = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
final OutputActionBuilder output = new OutputActionBuilder();
- output.setMaxLength(Integer.valueOf(0xffff));
- final Uri value = new Uri(OutputPortValues.CONTROLLER.toString());
+ output.setMaxLength(outputValue);
+ final Uri value = new Uri(outputType);
output.setOutputNodeConnector(value);
ab.setAction(new OutputActionCaseBuilder().setOutputAction(output.build()).build());
ab.setOrder(0);
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
actionList.add(ab.build());
// Create an Apply Action
final ApplyActionsBuilder aab = new ApplyActionsBuilder();
final InstructionBuilder ib = new InstructionBuilder();
ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
ib.setOrder(0);
- ib.setKey(new InstructionKey(0));
+ ib.withKey(new InstructionKey(0));
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
- final List<Instruction> instructions = new ArrayList<Instruction>();
+ final List<Instruction> instructions = new ArrayList<>();
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
}
- private static InstructionsBuilder createOutputInstructions(final String outputType, final int outputValue) {
- final List<Action> actionList = new ArrayList<Action>();
+ private static InstructionsBuilder createSentToControllerInstructions() {
+ final List<Action> actionList = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
final OutputActionBuilder output = new OutputActionBuilder();
- output.setMaxLength(outputValue);
- final Uri value = new Uri(outputType);
+ output.setMaxLength(Integer.valueOf(0xffff));
+ final Uri value = new Uri(OutputPortValues.CONTROLLER.toString());
output.setOutputNodeConnector(value);
ab.setAction(new OutputActionCaseBuilder().setOutputAction(output.build()).build());
ab.setOrder(0);
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
actionList.add(ab.build());
// Create an Apply Action
final ApplyActionsBuilder aab = new ApplyActionsBuilder();
final InstructionBuilder ib = new InstructionBuilder();
ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
ib.setOrder(0);
- ib.setKey(new InstructionKey(0));
+ ib.withKey(new InstructionKey(0));
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
- final List<Instruction> instructions = new ArrayList<Instruction>();
+ final List<Instruction> instructions = new ArrayList<>();
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
}
+
private static InstructionsBuilder createStripVlanInstructions() {
- final List<Action> actionList = new ArrayList<Action>();
+ final List<Action> actionList = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
final StripVlanActionBuilder stripActionBuilder = new StripVlanActionBuilder();
ab.setAction(new StripVlanActionCaseBuilder().setStripVlanAction(stripActionBuilder.build()).build());
ab.setOrder(0);
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
actionList.add(ab.build());
// Create an Apply Action
final ApplyActionsBuilder aab = new ApplyActionsBuilder();
final InstructionBuilder ib = new InstructionBuilder();
ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
ib.setOrder(0);
- ib.setKey(new InstructionKey(0));
+ ib.withKey(new InstructionKey(0));
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
- final List<Instruction> instructions = new ArrayList<Instruction>();
+ final List<Instruction> instructions = new ArrayList<>();
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
private static InstructionsBuilder createAppyActionInstruction2() {
- final List<Action> actionList = new ArrayList<Action>();
+ final List<Action> actionList = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
final PushMplsActionBuilder push = new PushMplsActionBuilder();
push.setEthernetType(Integer.valueOf(0x8847));
ab.setAction(new PushMplsActionCaseBuilder().setPushMplsAction(push.build()).build());
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
actionList.add(ab.build());
// Create an Apply Action
final ApplyActionsBuilder aab = new ApplyActionsBuilder();
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
- final List<Instruction> instructions = new ArrayList<Instruction>();
- ib.setKey(new InstructionKey(0));
+ final List<Instruction> instructions = new ArrayList<>();
+ ib.withKey(new InstructionKey(0));
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
private static InstructionsBuilder createAppyActionInstruction3() {
- final List<Action> actionList = new ArrayList<Action>();
+ final List<Action> actionList = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
final PushPbbActionBuilder pbb = new PushPbbActionBuilder();
pbb.setEthernetType(Integer.valueOf(0x88E7));
ab.setAction(new PushPbbActionCaseBuilder().setPushPbbAction(pbb.build()).build());
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
actionList.add(ab.build());
// Create an Apply Action
final ApplyActionsBuilder aab = new ApplyActionsBuilder();
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
- final List<Instruction> instructions = new ArrayList<Instruction>();
- ib.setKey(new InstructionKey(0));
+ final List<Instruction> instructions = new ArrayList<>();
+ ib.withKey(new InstructionKey(0));
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
private static InstructionsBuilder createAppyActionInstruction4() {
- final List<Action> actionList = new ArrayList<Action>();
+ final List<Action> actionList = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
final PushVlanActionBuilder vlan = new PushVlanActionBuilder();
vlan.setEthernetType(Integer.valueOf(0x8100));
ab.setAction(new PushVlanActionCaseBuilder().setPushVlanAction(vlan.build()).build());
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
actionList.add(ab.build());
// Create an Apply Action
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
- final List<Instruction> instructions = new ArrayList<Instruction>();
- ib.setKey(new InstructionKey(0));
+ final List<Instruction> instructions = new ArrayList<>();
+ ib.withKey(new InstructionKey(0));
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
private static InstructionsBuilder createAppyActionInstruction5() {
- final List<Action> actionList = new ArrayList<Action>();
+ final List<Action> actionList = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
final SetDlDstActionBuilder setdl = new SetDlDstActionBuilder();
setdl.setAddress(new MacAddress("00:05:b9:7c:81:5f"));
ab.setAction(new SetDlDstActionCaseBuilder().setSetDlDstAction(setdl.build()).build());
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
actionList.add(ab.build());
// Create an Apply Action
final ApplyActionsBuilder aab = new ApplyActionsBuilder();
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
- final List<Instruction> instructions = new ArrayList<Instruction>();
- ib.setKey(new InstructionKey(0));
+ final List<Instruction> instructions = new ArrayList<>();
+ ib.withKey(new InstructionKey(0));
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
private static InstructionsBuilder createAppyActionInstruction6() {
- final List<Action> actionList = new ArrayList<Action>();
+ final List<Action> actionList = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
final SetDlSrcActionBuilder src = new SetDlSrcActionBuilder();
src.setAddress(new MacAddress("00:05:b9:7c:81:5f"));
ab.setAction(new SetDlSrcActionCaseBuilder().setSetDlSrcAction(src.build()).build());
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
actionList.add(ab.build());
// Create an Apply Action
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
- final List<Instruction> instructions = new ArrayList<Instruction>();
- ib.setKey(new InstructionKey(0));
+ final List<Instruction> instructions = new ArrayList<>();
+ ib.withKey(new InstructionKey(0));
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
private static InstructionsBuilder createAppyActionInstruction7() {
- final List<Action> actionList = new ArrayList<Action>();
+ final List<Action> actionList = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
final SetVlanIdActionBuilder vl = new SetVlanIdActionBuilder();
final VlanId a = new VlanId(4000);
vl.setVlanId(a);
ab.setAction(new SetVlanIdActionCaseBuilder().setSetVlanIdAction(vl.build()).build());
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
actionList.add(ab.build());
// Create an Apply Action
final ApplyActionsBuilder aab = new ApplyActionsBuilder();
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
- final List<Instruction> instructions = new ArrayList<Instruction>();
- ib.setKey(new InstructionKey(0));
+ final List<Instruction> instructions = new ArrayList<>();
+ ib.withKey(new InstructionKey(0));
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
private static InstructionsBuilder createAppyActionInstruction8() {
- final List<Action> actionList = new ArrayList<Action>();
+ final List<Action> actionList = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
final SetVlanPcpActionBuilder pcp = new SetVlanPcpActionBuilder();
final VlanPcp pcp1 = new VlanPcp((short) 2);
pcp.setVlanPcp(pcp1);
ab.setAction(new SetVlanPcpActionCaseBuilder().setSetVlanPcpAction(pcp.build()).build());
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
actionList.add(ab.build());
// Create an Apply Action
final ApplyActionsBuilder aab = new ApplyActionsBuilder();
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
- final List<Instruction> instructions = new ArrayList<Instruction>();
- ib.setKey(new InstructionKey(0));
+ final List<Instruction> instructions = new ArrayList<>();
+ ib.withKey(new InstructionKey(0));
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
private static InstructionsBuilder createAppyActionInstruction88() {
- final List<Action> actionList = new ArrayList<Action>();
+ final List<Action> actionList = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
final SetVlanPcpActionBuilder pcp = new SetVlanPcpActionBuilder();
final VlanPcp pcp1 = new VlanPcp((short) 4);
pcp.setVlanPcp(pcp1);
ab.setAction(new SetVlanPcpActionCaseBuilder().setSetVlanPcpAction(pcp.build()).build());
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
actionList.add(ab.build());
// Create an Apply Action
final ApplyActionsBuilder aab = new ApplyActionsBuilder();
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
- final List<Instruction> instructions = new ArrayList<Instruction>();
- ib.setKey(new InstructionKey(0));
+ final List<Instruction> instructions = new ArrayList<>();
+ ib.withKey(new InstructionKey(0));
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
private static InstructionsBuilder createAppyActionInstruction9() {
- final List<Action> actionList = new ArrayList<Action>();
+ final List<Action> actionList = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
final CopyTtlInBuilder ttlin = new CopyTtlInBuilder();
ab.setAction(new CopyTtlInCaseBuilder().setCopyTtlIn(ttlin.build()).build());
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
actionList.add(ab.build());
// Create an Apply Action
final ApplyActionsBuilder aab = new ApplyActionsBuilder();
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
- final List<Instruction> instructions = new ArrayList<Instruction>();
- ib.setKey(new InstructionKey(0));
+ final List<Instruction> instructions = new ArrayList<>();
+ ib.withKey(new InstructionKey(0));
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
private static InstructionsBuilder createAppyActionInstruction10() {
- final List<Action> actionList = new ArrayList<Action>();
+ final List<Action> actionList = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
final CopyTtlOutBuilder ttlout = new CopyTtlOutBuilder();
ab.setAction(new CopyTtlOutCaseBuilder().setCopyTtlOut(ttlout.build()).build());
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
actionList.add(ab.build());
// Create an Apply Action
final ApplyActionsBuilder aab = new ApplyActionsBuilder();
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
- final List<Instruction> instructions = new ArrayList<Instruction>();
- ib.setKey(new InstructionKey(0));
+ final List<Instruction> instructions = new ArrayList<>();
+ ib.withKey(new InstructionKey(0));
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
private static InstructionsBuilder createAppyActionInstruction11() {
- final List<Action> actionList = new ArrayList<Action>();
+ final List<Action> actionList = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
final DecMplsTtlBuilder mpls = new DecMplsTtlBuilder();
ab.setAction(new DecMplsTtlCaseBuilder().setDecMplsTtl(mpls.build()).build());
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
actionList.add(ab.build());
// Create an Apply Action
final ApplyActionsBuilder aab = new ApplyActionsBuilder();
// Wrap our Apply Action in an Instruction
final InstructionBuilder ib = new InstructionBuilder();
ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
- ib.setKey(new InstructionKey(0));
+ ib.withKey(new InstructionKey(0));
ib.setOrder(0);
// Put our Instruction in a list of Instruction
final InstructionsBuilder isb = new InstructionsBuilder();
- final List<Instruction> instructions = new ArrayList<Instruction>();
+ final List<Instruction> instructions = new ArrayList<>();
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
private static InstructionsBuilder createAppyActionInstruction12() {
- final List<Action> actionList = new ArrayList<Action>();
+ final List<Action> actionList = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
final DecNwTtlBuilder nwttl = new DecNwTtlBuilder();
ab.setAction(new DecNwTtlCaseBuilder().setDecNwTtl(nwttl.build()).build());
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
actionList.add(ab.build());
// Create an Apply Action
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
- final List<Instruction> instructions = new ArrayList<Instruction>();
- ib.setKey(new InstructionKey(0));
+ final List<Instruction> instructions = new ArrayList<>();
+ ib.withKey(new InstructionKey(0));
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
private static InstructionsBuilder createAppyActionInstruction13() {
- final List<Action> actionList = new ArrayList<Action>();
+ final List<Action> actionList = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
final DropActionBuilder drop = new DropActionBuilder();
ab.setAction(new DropActionCaseBuilder().setDropAction(drop.build()).build());
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
actionList.add(ab.build());
// Create an Apply Action
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
- final List<Instruction> instructions = new ArrayList<Instruction>();
- ib.setKey(new InstructionKey(0));
+ final List<Instruction> instructions = new ArrayList<>();
+ ib.withKey(new InstructionKey(0));
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
private static InstructionsBuilder createAppyActionInstruction14() {
- final List<Action> actionList = new ArrayList<Action>();
+ final List<Action> actionList = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
final FloodActionBuilder fld = new FloodActionBuilder();
ab.setAction(new FloodActionCaseBuilder().setFloodAction(fld.build()).build());
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
actionList.add(ab.build());
// Create an Apply Action
final ApplyActionsBuilder aab = new ApplyActionsBuilder();
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
- final List<Instruction> instructions = new ArrayList<Instruction>();
- ib.setKey(new InstructionKey(0));
+ final List<Instruction> instructions = new ArrayList<>();
+ ib.withKey(new InstructionKey(0));
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
private static InstructionsBuilder createAppyActionInstruction15() {
- final List<Action> actionList = new ArrayList<Action>();
+ final List<Action> actionList = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
final FloodAllActionBuilder fldall = new FloodAllActionBuilder();
ab.setAction(new FloodAllActionCaseBuilder().setFloodAllAction(fldall.build()).build());
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
actionList.add(ab.build());
// Create an Apply Action
final ApplyActionsBuilder aab = new ApplyActionsBuilder();
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
- final List<Instruction> instructions = new ArrayList<Instruction>();
- ib.setKey(new InstructionKey(0));
+ final List<Instruction> instructions = new ArrayList<>();
+ ib.withKey(new InstructionKey(0));
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
private static InstructionsBuilder createAppyActionInstruction16() {
- final List<Action> actionList = new ArrayList<Action>();
+ final List<Action> actionList = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
final GroupActionBuilder groupActionB = new GroupActionBuilder();
groupActionB.setGroupId(1L);
groupActionB.setGroup("0");
ab.setAction(new GroupActionCaseBuilder().setGroupAction(groupActionB.build()).build());
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
actionList.add(ab.build());
// Create an Apply Action
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
- final List<Instruction> instructions = new ArrayList<Instruction>();
- ib.setKey(new InstructionKey(0));
+ final List<Instruction> instructions = new ArrayList<>();
+ ib.withKey(new InstructionKey(0));
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
private static InstructionsBuilder createAppyActionInstruction17() {
- final List<Action> actionList = new ArrayList<Action>();
+ final List<Action> actionList = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
final HwPathActionBuilder hwPathB = new HwPathActionBuilder();
ab.setAction(new HwPathActionCaseBuilder().setHwPathAction(hwPathB.build()).build());
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
actionList.add(ab.build());
// Create an Apply Action
final ApplyActionsBuilder aab = new ApplyActionsBuilder();
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
- final List<Instruction> instructions = new ArrayList<Instruction>();
- ib.setKey(new InstructionKey(0));
+ final List<Instruction> instructions = new ArrayList<>();
+ ib.withKey(new InstructionKey(0));
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
private static InstructionsBuilder createAppyActionInstruction18() {
- final List<Action> actionList = new ArrayList<Action>();
+ final List<Action> actionList = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
final LoopbackActionBuilder loopbackActionBuilder = new LoopbackActionBuilder();
ab.setAction(new LoopbackActionCaseBuilder().setLoopbackAction(loopbackActionBuilder.build()).build());
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
actionList.add(ab.build());
// Create an Apply Action
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
- final List<Instruction> instructions = new ArrayList<Instruction>();
- ib.setKey(new InstructionKey(0));
+ final List<Instruction> instructions = new ArrayList<>();
+ ib.withKey(new InstructionKey(0));
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
private static InstructionsBuilder createAppyActionInstruction19() {
- final List<Action> actionList = new ArrayList<Action>();
+ final List<Action> actionList = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
final PopMplsActionBuilder popMplsActionBuilder = new PopMplsActionBuilder();
popMplsActionBuilder.setEthernetType(0XB);
ab.setAction(new PopMplsActionCaseBuilder().setPopMplsAction(popMplsActionBuilder.build()).build());
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
actionList.add(ab.build());
// Create an Apply Action
final ApplyActionsBuilder aab = new ApplyActionsBuilder();
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
- final List<Instruction> instructions = new ArrayList<Instruction>();
- ib.setKey(new InstructionKey(0));
+ final List<Instruction> instructions = new ArrayList<>();
+ ib.withKey(new InstructionKey(0));
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
private static InstructionsBuilder createAppyActionInstruction20() {
- final List<Action> actionList = new ArrayList<Action>();
+ final List<Action> actionList = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
final PopPbbActionBuilder popPbbActionBuilder = new PopPbbActionBuilder();
ab.setAction(new PopPbbActionCaseBuilder().setPopPbbAction(popPbbActionBuilder.build()).build());
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
actionList.add(ab.build());
// Create an Apply Action
final ApplyActionsBuilder aab = new ApplyActionsBuilder();
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
- final List<Instruction> instructions = new ArrayList<Instruction>();
- ib.setKey(new InstructionKey(0));
+ final List<Instruction> instructions = new ArrayList<>();
+ ib.withKey(new InstructionKey(0));
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
private static InstructionsBuilder createAppyActionInstruction21() {
- final List<Action> actionList = new ArrayList<Action>();
+ final List<Action> actionList = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
final PopVlanActionBuilder popVlanActionBuilder = new PopVlanActionBuilder();
ab.setAction(new PopVlanActionCaseBuilder().setPopVlanAction(popVlanActionBuilder.build()).build());
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
actionList.add(ab.build());
// Create an Apply Action
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
- final List<Instruction> instructions = new ArrayList<Instruction>();
- ib.setKey(new InstructionKey(0));
+ final List<Instruction> instructions = new ArrayList<>();
+ ib.withKey(new InstructionKey(0));
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
private static InstructionsBuilder createAppyActionInstruction22() {
- final List<Action> actionList = new ArrayList<Action>();
+ final List<Action> actionList = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
final SetDlTypeActionBuilder setDlTypeActionBuilder = new SetDlTypeActionBuilder();
setDlTypeActionBuilder.setDlType(new EtherType(8L));
ab.setAction(new SetDlTypeActionCaseBuilder().setSetDlTypeAction(setDlTypeActionBuilder.build()).build());
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
actionList.add(ab.build());
// Create an Apply Action
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
- final List<Instruction> instructions = new ArrayList<Instruction>();
- ib.setKey(new InstructionKey(0));
+ final List<Instruction> instructions = new ArrayList<>();
+ ib.withKey(new InstructionKey(0));
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
private static InstructionsBuilder createAppyActionInstruction23(final NodeId nodeId) {
- final List<Action> actionList = new ArrayList<Action>();
+ final List<Action> actionList = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
final SetFieldBuilder setFieldBuilder = new SetFieldBuilder();
setFieldBuilder.setInPort(new NodeConnectorId(nodeId + ":2"));
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
actionList.add(ab.build());
// Create an Apply Action
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
- final List<Instruction> instructions = new ArrayList<Instruction>();
- ib.setKey(new InstructionKey(0));
+ final List<Instruction> instructions = new ArrayList<>();
+ ib.withKey(new InstructionKey(0));
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
private static InstructionsBuilder createAppyActionInstruction24() {
- final List<Action> actionList = new ArrayList<Action>();
+ final List<Action> actionList = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
final SetMplsTtlActionBuilder setMplsTtlActionBuilder = new SetMplsTtlActionBuilder();
setMplsTtlActionBuilder.setMplsTtl((short) 0X1);
ab.setAction(new SetMplsTtlActionCaseBuilder().setSetMplsTtlAction(setMplsTtlActionBuilder.build()).build());
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
actionList.add(ab.build());
// Create an Apply Action
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
- final List<Instruction> instructions = new ArrayList<Instruction>();
- ib.setKey(new InstructionKey(0));
+ final List<Instruction> instructions = new ArrayList<>();
+ ib.withKey(new InstructionKey(0));
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
private static InstructionsBuilder createAppyActionInstruction25() {
- final List<Action> actionList = new ArrayList<Action>();
+ final List<Action> actionList = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
final SetNextHopActionBuilder setNextHopActionBuilder = new SetNextHopActionBuilder();
ipnext.setIpv4Address(prefix);
setNextHopActionBuilder.setAddress(ipnext.build());
ab.setAction(new SetNextHopActionCaseBuilder().setSetNextHopAction(setNextHopActionBuilder.build()).build());
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
actionList.add(ab.build());
// Create an Apply Action
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
- final List<Instruction> instructions = new ArrayList<Instruction>();
- ib.setKey(new InstructionKey(0));
+ final List<Instruction> instructions = new ArrayList<>();
+ ib.withKey(new InstructionKey(0));
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
private static InstructionsBuilder createAppyActionInstruction26() {
- final List<Action> actionList = new ArrayList<Action>();
+ final List<Action> actionList = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
final SetNwDstActionBuilder setNwDstActionBuilder = new SetNwDstActionBuilder();
ipdst.setIpv4Address(prefixdst);
setNwDstActionBuilder.setAddress(ipdst.build());
ab.setAction(new SetNwDstActionCaseBuilder().setSetNwDstAction(setNwDstActionBuilder.build()).build());
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
actionList.add(ab.build());
// Create an Apply Action
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
- final List<Instruction> instructions = new ArrayList<Instruction>();
- ib.setKey(new InstructionKey(0));
+ final List<Instruction> instructions = new ArrayList<>();
+ ib.withKey(new InstructionKey(0));
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
private static InstructionsBuilder createAppyActionInstruction27() {
- final List<Action> actionList = new ArrayList<Action>();
+ final List<Action> actionList = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
final SetNwSrcActionBuilder setNwsrcActionBuilder = new SetNwSrcActionBuilder();
ipsrc.setIpv4Address(prefixsrc);
setNwsrcActionBuilder.setAddress(ipsrc.build());
ab.setAction(new SetNwSrcActionCaseBuilder().setSetNwSrcAction(setNwsrcActionBuilder.build()).build());
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
actionList.add(ab.build());
// Create an Apply Action
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
- final List<Instruction> instructions = new ArrayList<Instruction>();
- ib.setKey(new InstructionKey(0));
+ final List<Instruction> instructions = new ArrayList<>();
+ ib.withKey(new InstructionKey(0));
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
private static InstructionsBuilder createAppyActionInstruction28() {
- final List<Action> actionList = new ArrayList<Action>();
+ final List<Action> actionList = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
final SetNwTosActionBuilder setNwTosActionBuilder = new SetNwTosActionBuilder();
setNwTosActionBuilder.setTos(8);
ab.setAction(new SetNwTosActionCaseBuilder().setSetNwTosAction(setNwTosActionBuilder.build()).build());
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
actionList.add(ab.build());
// Create an Apply Action
final ApplyActionsBuilder aab = new ApplyActionsBuilder();
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
- final List<Instruction> instructions = new ArrayList<Instruction>();
- ib.setKey(new InstructionKey(0));
+ final List<Instruction> instructions = new ArrayList<>();
+ ib.withKey(new InstructionKey(0));
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
private static InstructionsBuilder createAppyActionInstruction29() {
- final List<Action> actionList = new ArrayList<Action>();
+ final List<Action> actionList = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
final SetNwTtlActionBuilder setNwTtlActionBuilder = new SetNwTtlActionBuilder();
setNwTtlActionBuilder.setNwTtl((short) 1);
ab.setAction(new SetNwTtlActionCaseBuilder().setSetNwTtlAction(setNwTtlActionBuilder.build()).build());
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
actionList.add(ab.build());
// Create an Apply Action
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
- final List<Instruction> instructions = new ArrayList<Instruction>();
- ib.setKey(new InstructionKey(0));
+ final List<Instruction> instructions = new ArrayList<>();
+ ib.withKey(new InstructionKey(0));
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
private static InstructionsBuilder createAppyActionInstruction30() {
- final List<Action> actionList = new ArrayList<Action>();
+ final List<Action> actionList = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
final SetQueueActionBuilder setQueueActionBuilder = new SetQueueActionBuilder();
setQueueActionBuilder.setQueueId(1L);
ab.setAction(new SetQueueActionCaseBuilder().setSetQueueAction(setQueueActionBuilder.build()).build());
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
actionList.add(ab.build());
// Create an Apply Action
final ApplyActionsBuilder aab = new ApplyActionsBuilder();
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
- final List<Instruction> instructions = new ArrayList<Instruction>();
- ib.setKey(new InstructionKey(0));
+ final List<Instruction> instructions = new ArrayList<>();
+ ib.withKey(new InstructionKey(0));
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
private static InstructionsBuilder createAppyActionInstruction31() {
- final List<Action> actionList = new ArrayList<Action>();
+ final List<Action> actionList = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
final SetTpDstActionBuilder setTpDstActionBuilder = new SetTpDstActionBuilder();
setTpDstActionBuilder.setPort(new PortNumber(109));
ab.setAction(new SetTpDstActionCaseBuilder().setSetTpDstAction(setTpDstActionBuilder.build()).build());
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
actionList.add(ab.build());
// Create an Apply Action
final ApplyActionsBuilder aab = new ApplyActionsBuilder();
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
- final List<Instruction> instructions = new ArrayList<Instruction>();
- ib.setKey(new InstructionKey(0));
+ final List<Instruction> instructions = new ArrayList<>();
+ ib.withKey(new InstructionKey(0));
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
private static InstructionsBuilder createAppyActionInstruction32() {
- final List<Action> actionList = new ArrayList<Action>();
+ final List<Action> actionList = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
final SetTpSrcActionBuilder setTpSrcActionBuilder = new SetTpSrcActionBuilder();
setTpSrcActionBuilder.setPort(new PortNumber(109));
ab.setAction(new SetTpSrcActionCaseBuilder().setSetTpSrcAction(setTpSrcActionBuilder.build()).build());
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
actionList.add(ab.build());
// Create an Apply Action
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
- final List<Instruction> instructions = new ArrayList<Instruction>();
- ib.setKey(new InstructionKey(0));
+ final List<Instruction> instructions = new ArrayList<>();
+ ib.withKey(new InstructionKey(0));
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
private static InstructionsBuilder createAppyActionInstruction33() {
- final List<Action> actionList = new ArrayList<Action>();
+ final List<Action> actionList = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
final SetVlanCfiActionBuilder setVlanCfiActionBuilder = new SetVlanCfiActionBuilder();
setVlanCfiActionBuilder.setVlanCfi(new VlanCfi(2));
ab.setAction(new SetVlanCfiActionCaseBuilder().setSetVlanCfiAction(setVlanCfiActionBuilder.build()).build());
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
actionList.add(ab.build());
// Create an Apply Action
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
- final List<Instruction> instructions = new ArrayList<Instruction>();
- ib.setKey(new InstructionKey(0));
+ final List<Instruction> instructions = new ArrayList<>();
+ ib.withKey(new InstructionKey(0));
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
private static InstructionsBuilder createAppyActionInstruction34() {
- final List<Action> actionList = new ArrayList<Action>();
+ final List<Action> actionList = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
final SwPathActionBuilder swPathAction = new SwPathActionBuilder();
ab.setAction(new SwPathActionCaseBuilder().setSwPathAction(swPathAction.build()).build());
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
actionList.add(ab.build());
// Create an Apply Action
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
- final List<Instruction> instructions = new ArrayList<Instruction>();
- ib.setKey(new InstructionKey(0));
+ final List<Instruction> instructions = new ArrayList<>();
+ ib.withKey(new InstructionKey(0));
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
private static InstructionsBuilder createAppyActionInstruction35() {
- final List<Action> actionList = new ArrayList<Action>();
+ final List<Action> actionList = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
final ActionBuilder ab1 = new ActionBuilder();
final ActionBuilder ab2 = new ActionBuilder();
setFieldBuilder1.setEthernetMatch(ethernetMatch1.build());
setFieldBuilder2.setEthernetMatch(ethernetMatch2.build());
ab.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder.build()).build());
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
actionList.add(ab.build());
ab1.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder1.build()).build());
- ab1.setKey(new ActionKey(1));
+ ab1.withKey(new ActionKey(1));
actionList.add(ab1.build());
ab2.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder2.build()).build());
- ab2.setKey(new ActionKey(2));
+ ab2.withKey(new ActionKey(2));
actionList.add(ab2.build());
final ApplyActionsBuilder aab = new ApplyActionsBuilder();
aab.setAction(actionList);
final InstructionBuilder ib = new InstructionBuilder();
- ib.setKey(new InstructionKey(0));
+ ib.withKey(new InstructionKey(0));
ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
- final List<Instruction> instructions = new ArrayList<Instruction>();
- ib.setKey(new InstructionKey(0));
+ final List<Instruction> instructions = new ArrayList<>();
+ ib.withKey(new InstructionKey(0));
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
private static InstructionsBuilder createAppyActionInstruction36() {
- final List<Action> actionList = new ArrayList<Action>();
+ final List<Action> actionList = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
final ActionBuilder ab1 = new ActionBuilder();
setFieldBuilder.setVlanMatch(vlanBuilder.build());
setFieldBuilder1.setVlanMatch(vlanBuilder1.build());
ab.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder.build()).build());
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
actionList.add(ab.build());
ab1.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder1.build()).build());
- ab1.setKey(new ActionKey(1));
+ ab1.withKey(new ActionKey(1));
actionList.add(ab1.build());
final ApplyActionsBuilder aab = new ApplyActionsBuilder();
aab.setAction(actionList);
final InstructionBuilder ib = new InstructionBuilder();
- ib.setKey(new InstructionKey(0));
+ ib.withKey(new InstructionKey(0));
ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
- final List<Instruction> instructions = new ArrayList<Instruction>();
+ final List<Instruction> instructions = new ArrayList<>();
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
private static InstructionsBuilder createAppyActionInstruction37() {
- final List<Action> actionList = new ArrayList<Action>();
+ final List<Action> actionList = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
final ActionBuilder ab1 = new ActionBuilder();
final ActionBuilder ab2 = new ActionBuilder();
ipmatch2.setIpProtocol((short) 120);
setFieldBuilder.setIpMatch(ipmatch.build());
ab.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder.build()).build());
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
actionList.add(ab.build());
setFieldBuilder1.setIpMatch(ipmatch1.build());
ab1.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder1.build()).build());
- ab1.setKey(new ActionKey(1));
+ ab1.withKey(new ActionKey(1));
actionList.add(ab1.build());
setFieldBuilder2.setIpMatch(ipmatch2.build());
ab2.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder2.build()).build());
- ab2.setKey(new ActionKey(2));
+ ab2.withKey(new ActionKey(2));
actionList.add(ab2.build());
final ApplyActionsBuilder aab = new ApplyActionsBuilder();
aab.setAction(actionList);
final InstructionBuilder ib = new InstructionBuilder();
- ib.setKey(new InstructionKey(0));
+ ib.withKey(new InstructionKey(0));
ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
- final List<Instruction> instructions = new ArrayList<Instruction>();
+ final List<Instruction> instructions = new ArrayList<>();
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
private static InstructionsBuilder createAppyActionInstruction38() {
- final List<Action> actionList = new ArrayList<Action>();
+ final List<Action> actionList = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
final ActionBuilder ab1 = new ActionBuilder();
ipv4Match.setIpv4Source(srcip);
setFieldBuilder.setLayer3Match(ipv4Match.build());
ab.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder.build()).build());
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
actionList.add(ab.build());
setFieldBuilder1.setLayer3Match(ipv4Match1.build());
ab1.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder1.build()).build());
- ab1.setKey(new ActionKey(1));
+ ab1.withKey(new ActionKey(1));
actionList.add(ab1.build());
final ApplyActionsBuilder aab = new ApplyActionsBuilder();
aab.setAction(actionList);
final InstructionBuilder ib = new InstructionBuilder();
- ib.setKey(new InstructionKey(0));
+ ib.withKey(new InstructionKey(0));
ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
- final List<Instruction> instructions = new ArrayList<Instruction>();
+ final List<Instruction> instructions = new ArrayList<>();
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
private static InstructionsBuilder createAppyActionInstruction39() {
- final List<Action> actionList = new ArrayList<Action>();
+ final List<Action> actionList = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
final ActionBuilder ab1 = new ActionBuilder();
tcpmatch1.setTcpDestinationPort(tcpdstport);
setFieldBuilder.setLayer4Match(tcpmatch.build());
ab.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder.build()).build());
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
actionList.add(ab.build());
setFieldBuilder1.setLayer4Match(tcpmatch1.build());
ab1.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder1.build()).build());
- ab1.setKey(new ActionKey(1));
+ ab1.withKey(new ActionKey(1));
actionList.add(ab.build());
final ApplyActionsBuilder aab = new ApplyActionsBuilder();
aab.setAction(actionList);
final InstructionBuilder ib = new InstructionBuilder();
- ib.setKey(new InstructionKey(0));
+ ib.withKey(new InstructionKey(0));
ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
- final List<Instruction> instructions = new ArrayList<Instruction>();
+ final List<Instruction> instructions = new ArrayList<>();
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
private static InstructionsBuilder createAppyActionInstruction40() {
- final List<Action> actionList = new ArrayList<Action>();
+ final List<Action> actionList = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
final ActionBuilder ab1 = new ActionBuilder();
udpmatch1.setUdpSourcePort(udpsrcport);
setFieldBuilder.setLayer4Match(udpmatch.build());
ab.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder.build()).build());
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
actionList.add(ab.build());
setFieldBuilder1.setLayer4Match(udpmatch1.build());
ab1.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder1.build()).build());
- ab1.setKey(new ActionKey(1));
+ ab1.withKey(new ActionKey(1));
actionList.add(ab1.build());
final ApplyActionsBuilder aab = new ApplyActionsBuilder();
aab.setAction(actionList);
final InstructionBuilder ib = new InstructionBuilder();
- ib.setKey(new InstructionKey(0));
+ ib.withKey(new InstructionKey(0));
ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
- final List<Instruction> instructions = new ArrayList<Instruction>();
+ final List<Instruction> instructions = new ArrayList<>();
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
private static InstructionsBuilder createAppyActionInstruction41() {
- final List<Action> actionList = new ArrayList<Action>();
+ final List<Action> actionList = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
final ActionBuilder ab1 = new ActionBuilder();
sctpmatch1.setSctpDestinationPort(dstport);
setFieldBuilder.setLayer4Match(sctpmatch.build());
ab.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder.build()).build());
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
actionList.add(ab.build());
setFieldBuilder1.setLayer4Match(sctpmatch1.build());
ab1.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder1.build()).build());
- ab1.setKey(new ActionKey(1));
+ ab1.withKey(new ActionKey(1));
actionList.add(ab1.build());
final ApplyActionsBuilder aab = new ApplyActionsBuilder();
aab.setAction(actionList);
final InstructionBuilder ib = new InstructionBuilder();
- ib.setKey(new InstructionKey(0));
+ ib.withKey(new InstructionKey(0));
ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
- final List<Instruction> instructions = new ArrayList<Instruction>();
+ final List<Instruction> instructions = new ArrayList<>();
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
private static InstructionsBuilder createAppyActionInstruction42() {
- final List<Action> actionList = new ArrayList<Action>();
+ final List<Action> actionList = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
final ActionBuilder ab1 = new ActionBuilder();
final SetFieldBuilder setFieldBuilder = new SetFieldBuilder();
icmpv4match1.setIcmpv4Code((short) 0);
setFieldBuilder.setIcmpv4Match(icmpv4match.build());
ab.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder.build()).build());
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
actionList.add(ab.build());
setFieldBuilder1.setIcmpv4Match(icmpv4match1.build());
ab1.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder1.build()).build());
- ab1.setKey(new ActionKey(1));
+ ab1.withKey(new ActionKey(1));
actionList.add(ab1.build());
final ApplyActionsBuilder aab = new ApplyActionsBuilder();
aab.setAction(actionList);
final InstructionBuilder ib = new InstructionBuilder();
- ib.setKey(new InstructionKey(0));
+ ib.withKey(new InstructionKey(0));
ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
- final List<Instruction> instructions = new ArrayList<Instruction>();
+ final List<Instruction> instructions = new ArrayList<>();
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
private static InstructionsBuilder createAppyActionInstruction43() {
- final List<Action> actionList = new ArrayList<Action>();
+ final List<Action> actionList = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
final ActionBuilder ab1 = new ActionBuilder();
final ActionBuilder ab2 = new ActionBuilder();
arpmatch4.setArpTargetTransportAddress(dstiparp);
setFieldBuilder.setLayer3Match(arpmatch.build());
ab.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder.build()).build());
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
actionList.add(ab.build());
setFieldBuilder1.setLayer3Match(arpmatch1.build());
ab1.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder1.build()).build());
- ab1.setKey(new ActionKey(1));
+ ab1.withKey(new ActionKey(1));
actionList.add(ab1.build());
setFieldBuilder2.setLayer3Match(arpmatch2.build());
ab2.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder2.build()).build());
- ab2.setKey(new ActionKey(2));
+ ab2.withKey(new ActionKey(2));
actionList.add(ab2.build());
setFieldBuilder3.setLayer3Match(arpmatch3.build());
ab3.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder3.build()).build());
- ab3.setKey(new ActionKey(3));
+ ab3.withKey(new ActionKey(3));
actionList.add(ab3.build());
setFieldBuilder4.setLayer3Match(arpmatch4.build());
ab4.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder4.build()).build());
- ab4.setKey(new ActionKey(4));
+ ab4.withKey(new ActionKey(4));
actionList.add(ab4.build());
final ApplyActionsBuilder aab = new ApplyActionsBuilder();
aab.setAction(actionList);
final InstructionBuilder ib = new InstructionBuilder();
- ib.setKey(new InstructionKey(0));
+ ib.withKey(new InstructionKey(0));
ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
- final List<Instruction> instructions = new ArrayList<Instruction>();
+ final List<Instruction> instructions = new ArrayList<>();
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
private static InstructionsBuilder createAppyActionInstruction44() {
- final List<Action> actionLists = new ArrayList<Action>();
+ final List<Action> actionLists = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
final SetFieldBuilder setFieldBuilder = new SetFieldBuilder();
final ActionBuilder ab1 = new ActionBuilder();
setFieldBuilder.setLayer3Match(ipv6Builder.build());
ab.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder.build()).build());
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
actionLists.add(ab.build());
setFieldBuilder1.setLayer3Match(ipv6Builder1.build());
ab1.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder1.build()).build());
- ab1.setKey(new ActionKey(1));
+ ab1.withKey(new ActionKey(1));
actionLists.add(ab1.build());
setFieldBuilder5.setLayer3Match(ipv6Builder5.build());
ab5.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder5.build()).build());
- ab5.setKey(new ActionKey(5));
+ ab5.withKey(new ActionKey(5));
actionLists.add(ab5.build());
setFieldBuilder6.setLayer3Match(ipv6Builder6.build());
ab6.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder6.build()).build());
- ab6.setKey(new ActionKey(6));
+ ab6.withKey(new ActionKey(6));
actionLists.add(ab6.build());
final ApplyActionsBuilder aab = new ApplyActionsBuilder();
aab.setAction(actionLists);
final InstructionBuilder ib = new InstructionBuilder();
- ib.setKey(new InstructionKey(0));
+ ib.withKey(new InstructionKey(0));
ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
- final List<Instruction> instructions = new ArrayList<Instruction>();
+ final List<Instruction> instructions = new ArrayList<>();
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
private static InstructionsBuilder createAppyActionInstruction45() {
- final List<Action> actionList = new ArrayList<Action>();
+ final List<Action> actionList = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
final SetFieldBuilder setFieldBuilder = new SetFieldBuilder();
final ActionBuilder ab1 = new ActionBuilder();
icmpv6match1.setIcmpv6Code((short) 0);
setFieldBuilder.setIcmpv6Match(icmpv6match.build());
ab.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder.build()).build());
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
actionList.add(ab.build());
setFieldBuilder1.setIcmpv6Match(icmpv6match1.build());
ab1.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder1.build()).build());
- ab1.setKey(new ActionKey(1));
+ ab1.withKey(new ActionKey(1));
actionList.add(ab1.build());
final ApplyActionsBuilder aab = new ApplyActionsBuilder();
aab.setAction(actionList);
final InstructionBuilder ib = new InstructionBuilder();
- ib.setKey(new InstructionKey(0));
+ ib.withKey(new InstructionKey(0));
ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
- final List<Instruction> instructions = new ArrayList<Instruction>();
+ final List<Instruction> instructions = new ArrayList<>();
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
private static InstructionsBuilder createAppyActionInstruction46() {
- final List<Action> actionList = new ArrayList<Action>();
+ final List<Action> actionList = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
final SetFieldBuilder setFieldBuilder = new SetFieldBuilder();
final ActionBuilder ab1 = new ActionBuilder();
protomatch2.setMplsBos((short) 1);
setFieldBuilder.setProtocolMatchFields(protomatch.build());
ab.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder.build()).build());
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
actionList.add(ab.build());
setFieldBuilder1.setProtocolMatchFields(protomatch1.build());
ab1.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder1.build()).build());
- ab1.setKey(new ActionKey(1));
+ ab1.withKey(new ActionKey(1));
actionList.add(ab1.build());
setFieldBuilder2.setProtocolMatchFields(protomatch2.build());
ab2.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder2.build()).build());
- ab2.setKey(new ActionKey(2));
+ ab2.withKey(new ActionKey(2));
actionList.add(ab2.build());
final ApplyActionsBuilder aab = new ApplyActionsBuilder();
aab.setAction(actionList);
final InstructionBuilder ib = new InstructionBuilder();
- ib.setKey(new InstructionKey(0));
+ ib.withKey(new InstructionKey(0));
ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
- final List<Instruction> instructions = new ArrayList<Instruction>();
+ final List<Instruction> instructions = new ArrayList<>();
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
private static InstructionsBuilder createAppyActionInstruction47() {
- final List<Action> actionList = new ArrayList<Action>();
+ final List<Action> actionList = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
final SetFieldBuilder setFieldBuilder = new SetFieldBuilder();
// PBB
final ProtocolMatchFieldsBuilder protomatch = new ProtocolMatchFieldsBuilder();
- protomatch.setPbb(new PbbBuilder().setPbbIsid(4L).setPbbMask((new BigInteger(new byte[]{0, 1, 0, 0}).longValue())).build());
+ protomatch.setPbb(new PbbBuilder().setPbbIsid(4L).setPbbMask(
+ new BigInteger(new byte[]{0, 1, 0, 0}).longValue()).build());
setFieldBuilder.setProtocolMatchFields(protomatch.build());
ab.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder.build()).build());
actionList.add(ab.build());
aab.setAction(actionList);
final InstructionBuilder ib = new InstructionBuilder();
- ib.setKey(new InstructionKey(0));
+ ib.withKey(new InstructionKey(0));
ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
- final List<Instruction> instructions = new ArrayList<Instruction>();
+ final List<Instruction> instructions = new ArrayList<>();
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
private static InstructionsBuilder createAppyActionInstruction48() {
- final List<Action> actionList = new ArrayList<Action>();
+ final List<Action> actionList = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
final SetFieldBuilder setFieldBuilder = new SetFieldBuilder();
// Tunnel
tunnel.setTunnelId(BigInteger.valueOf(10668));
setFieldBuilder.setTunnel(tunnel.build());
ab.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder.build()).build());
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
actionList.add(ab.build());
final ApplyActionsBuilder aab = new ApplyActionsBuilder();
aab.setAction(actionList);
final InstructionBuilder ib = new InstructionBuilder();
- ib.setKey(new InstructionKey(0));
+ ib.withKey(new InstructionKey(0));
ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
- final List<Instruction> instructions = new ArrayList<Instruction>();
+ final List<Instruction> instructions = new ArrayList<>();
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
private static InstructionsBuilder createTunnelIpv4DstInstructions() {
- final List<Action> actionList = new ArrayList<Action>();
+ final List<Action> actionList = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
// Build the tunnel endpoint destination IPv4 address
final SetFieldBuilder setFieldBuilder = new SetFieldBuilder();
// Add the IPv4 tunnel dst to the set_field value
ab.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder.build()).build());
ab.setOrder(0);
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
actionList.add(ab.build());
// Resulting action is a per/flow src TEP (set_field:172.16.100.100->tun_dst)
final ApplyActionsBuilder aab = new ApplyActionsBuilder();
// Add the action to the ordered list of Instructions
final InstructionBuilder ib = new InstructionBuilder();
ib.setOrder(0);
- ib.setKey(new InstructionKey(0));
+ ib.withKey(new InstructionKey(0));
ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
// Add the Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
- final List<Instruction> instructions = new ArrayList<Instruction>();
+ final List<Instruction> instructions = new ArrayList<>();
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
private static InstructionsBuilder createTunnelIpv4SrcInstructions() {
- final List<Action> actionList = new ArrayList<Action>();
+ final List<Action> actionList = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
// Build the tunnel endpoint source IPv4 address
final SetFieldBuilder setFieldBuilder = new SetFieldBuilder();
// Add the IPv4 tunnel src to the set_field value
ab.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder.build()).build());
ab.setOrder(0);
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
actionList.add(ab.build());
// Resulting action is a per/flow src TEP (set_field:172.16.100.100->tun_src)
final ApplyActionsBuilder aab = new ApplyActionsBuilder();
// Add the action to the ordered list of Instructions
final InstructionBuilder ib = new InstructionBuilder();
ib.setOrder(0);
- ib.setKey(new InstructionKey(0));
+ ib.withKey(new InstructionKey(0));
ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
- final List<Instruction> instructions = new ArrayList<Instruction>();
+ final List<Instruction> instructions = new ArrayList<>();
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
return match;
}
- /**
- * @return
- */
private static MatchBuilder createMatch1() {
final MatchBuilder match = new MatchBuilder();
final Ipv4MatchBuilder ipv4Match = new Ipv4MatchBuilder();
- final Ipv4Prefix prefix = new Ipv4Prefix(IPV4_PREFIX);;
+ final Ipv4Prefix prefix = new Ipv4Prefix(IPV4_PREFIX);
ipv4Match.setIpv4Destination(prefix);
final Ipv4Match i4m = ipv4Match.build();
match.setLayer3Match(i4m);
return match;
}
-
- /**
- * @return
- */
private static MatchBuilder createMatch2() {
final MatchBuilder match = new MatchBuilder();
final Ipv4MatchBuilder ipv4Match = new Ipv4MatchBuilder();
return match;
}
- /**
- * @return
- */
private static MatchBuilder createMatch3() {
final MatchBuilder match = new MatchBuilder();
final EthernetMatchBuilder ethernetMatch = new EthernetMatchBuilder();
return match;
}
- /**
- * @return
- */
private static MatchBuilder createICMPv6Match1() {
final MatchBuilder match = new MatchBuilder();
}
- /**
- * @return
- */
-
private static MatchBuilder createVlanMatch() {
final MatchBuilder match = new MatchBuilder();
// vlan match
return match;
}
- /**
- * @return
- */
private static MatchBuilder createArpMatch() {
final MatchBuilder match = new MatchBuilder();
return match;
}
-
- /**
- * @return
- */
- private static MatchBuilder createL3IPv4Match() {
- final MatchBuilder match = new MatchBuilder();
-
- final EthernetMatchBuilder eth = new EthernetMatchBuilder();
- final EthernetTypeBuilder ethTypeBuilder = new EthernetTypeBuilder();
- ethTypeBuilder.setType(new EtherType(0x0800L));
- eth.setEthernetType(ethTypeBuilder.build());
- match.setEthernetMatch(eth.build());
-
- final Ipv4MatchBuilder ipv4Match = new Ipv4MatchBuilder();
- // ipv4 match
- final Ipv4Prefix dstip = new Ipv4Prefix("200.71.9.52/10");
- final Ipv4Prefix srcip = new Ipv4Prefix("100.1.1.1/8");
- final Ipv4MatchBuilder ipv4match = new Ipv4MatchBuilder();
- ipv4match.setIpv4Destination(dstip);
- ipv4match.setIpv4Source(srcip);
- match.setLayer3Match(ipv4match.build());
-
- return match;
-
- }
-
- /**
- * @return
- */
private static MatchBuilder createL3IPv6Match() {
final MatchBuilder match = new MatchBuilder();
eth.setEthernetType(ethTypeBuilder.build());
match.setEthernetMatch(eth.build());
- final Ipv6Prefix dstip6 = new Ipv6Prefix("2002::2/64");
- final Ipv6Prefix srcip6 = new Ipv6Prefix("2001:0:0:0:0:0:0:1/56");
- final Ipv6Address ndtarget = new Ipv6Address("2001:db8:0:1:fd97:f9f0:a810:782e");
final MacAddress ndsll = new MacAddress("c2:00:54:f5:00:00");
final MacAddress ndtll = new MacAddress("00:0c:29:0e:4c:67");
final Ipv6ExtHeaderBuilder nextheader = new Ipv6ExtHeaderBuilder();
return match;
}
- /**
- * @return
- */
-
private static MatchBuilder createICMPv4Match() {
final MatchBuilder match = new MatchBuilder();
final EthernetMatchBuilder eth = new EthernetMatchBuilder();
return match;
}
- /**
- * @return
- */
private static MatchBuilder createICMPv6Match() {
final MatchBuilder match = new MatchBuilder();
return match;
}
- /**
- * @return
- */
private static MatchBuilder createToSMatch() {
final MatchBuilder match = new MatchBuilder();
final EthernetMatchBuilder ethmatch = new EthernetMatchBuilder();
return match;
}
- /**
- * @return
- */
-
private static MatchBuilder createL4TCPMatch() {
final MatchBuilder match = new MatchBuilder();
return match;
}
- /**
- * @return
- */
private static MatchBuilder createL4UDPMatch() {
final MatchBuilder match = new MatchBuilder();
return match;
}
- /**
- * @return
- */
private static MatchBuilder createL4SCTPMatch() {
final MatchBuilder match = new MatchBuilder();
return match;
}
- /**
- * @return
- */
private static MatchBuilder createMetadataMatch() {
final MatchBuilder match = new MatchBuilder();
final byte[] metamask = new byte[]{(byte) -1, (byte) -1, (byte) -1, 0, 0, 0, (byte) 1, (byte) 1};
return match;
}
- /**
- * @return
- */
private static MatchBuilder createMplsMatch() {
final MatchBuilder match = new MatchBuilder();
}
- /**
- * @return
- */
private static MatchBuilder createPbbMatch() {
final MatchBuilder match = new MatchBuilder();
final ProtocolMatchFieldsBuilder protomatch = new ProtocolMatchFieldsBuilder(); // mpls
// match
- protomatch.setPbb(new PbbBuilder().setPbbIsid(4L).setPbbMask(new BigInteger(new byte[]{0, 1, 0, 0}).longValue()).build());
+ protomatch.setPbb(new PbbBuilder().setPbbIsid(4L).setPbbMask(
+ new BigInteger(new byte[]{0, 1, 0, 0}).longValue()).build());
match.setProtocolMatchFields(protomatch.build());
return match;
}
- /**
- * @return
- */
private static MatchBuilder createTunnelIDMatch() {
final MatchBuilder match = new MatchBuilder();
final TunnelBuilder tunnel = new TunnelBuilder(); // tunnel id match
}
/**
- * Test match for TCP_Flags
+ * Test match for TCP_Flags.
*
* @return match containing Ethertype (0x0800), IP Protocol (TCP), TCP_Flag (SYN)
*/
} else {
tf = createTestFlow(tn, flowtype, ci.nextArgument());
}
- final InstanceIdentifier<Flow> path1 = InstanceIdentifier.create(Nodes.class).child(Node.class, tn.getKey())
+ final InstanceIdentifier<Flow> path1 = InstanceIdentifier.create(Nodes.class).child(Node.class, tn.key())
.augmentation(FlowCapableNode.class).child(Table.class, new TableKey(tf.getTableId()))
- .child(Flow.class, tf.getKey());
+ .child(Flow.class, tf.key());
modification.delete(LogicalDatastoreType.CONFIGURATION, path1);
- final CheckedFuture<Void, TransactionCommitFailedException> commitFuture = modification.submit();
+ final ListenableFuture<Void> commitFuture = modification.submit();
Futures.addCallback(commitFuture, new FutureCallback<Void>() {
@Override
- public void onSuccess(final Void aVoid) {
+ public void onSuccess(final Void notUsed) {
ci.println("Status of Group Data Loaded Transaction: success.");
}
}
/**
- * @param ci arguments: switchId flowType tableNum
- * <p>
- * <pre>
- * e.g.: addMDFlow openflow:1 f1 42
- * </pre>
+ * Adds a flow.
+ *
+ * @param ci arguments: switchId flowType tableNum, e.g.: addMDFlow openflow:1 f1 42
*/
public void _addMDFlow(final CommandInterpreter ci) {
final NodeBuilder tn = createTestNode(ci.nextArgument());
private void writeFlow(final CommandInterpreter ci, final FlowBuilder flow, final NodeBuilder nodeBuilder) {
final ReadWriteTransaction modification = dataBroker.newReadWriteTransaction();
final InstanceIdentifier<Flow> path1 = InstanceIdentifier.create(Nodes.class)
- .child(Node.class, nodeBuilder.getKey()).augmentation(FlowCapableNode.class)
- .child(Table.class, new TableKey(flow.getTableId())).child(Flow.class, flow.getKey());
- modification.merge(LogicalDatastoreType.CONFIGURATION, nodeBuilderToInstanceId(nodeBuilder), nodeBuilder.build(), true);
+ .child(Node.class, nodeBuilder.key()).augmentation(FlowCapableNode.class)
+ .child(Table.class, new TableKey(flow.getTableId())).child(Flow.class, flow.key());
+ modification.merge(LogicalDatastoreType.CONFIGURATION,
+ nodeBuilderToInstanceId(nodeBuilder), nodeBuilder.build(), true);
modification.merge(LogicalDatastoreType.CONFIGURATION, path1, flow.build(), true);
- final CheckedFuture<Void, TransactionCommitFailedException> commitFuture = modification.submit();
+ final ListenableFuture<Void> commitFuture = modification.submit();
Futures.addCallback(commitFuture, new FutureCallback<Void>() {
@Override
- public void onSuccess(final Void aVoid) {
+ public void onSuccess(final Void notUsed) {
ci.println("Status of Group Data Loaded Transaction: success.");
}
writeFlow(ci, tf, tn);
}
- private static NodeRef createNodeRef(final String string) {
- final NodeKey key = new NodeKey(new NodeId(string));
- final InstanceIdentifier<Node> path = InstanceIdentifier.create(Nodes.class).child(Node.class, key);
-
- return new NodeRef(path);
- }
-
@Override
public String getHelp() {
return "No help";
final String threadCountStr = ci.nextArgument();
final String warmUpStr = ci.nextArgument();
- Collection<String> testResults = null;
- if (testResults == null) {
- testResults = new ArrayList<String>();
- }
-
int numberOfSwtiches = 0;
int numberOfFlows = 0;
int warmupIterations = 0;
}
executor.shutdown();
executor.awaitTermination(1, TimeUnit.SECONDS);
- } catch (final Exception e) {
+ } catch (InterruptedException e) {
ci.println("Exception:" + e.getMessage());
}
}
int numberOfSwitches;
int numberOfFlows;
- int testTime;
CommandInterpreter ci;
- int testFlowsAdded;
int theadNumber;
- Collection<String> testResults = null;
int tableID = 0;
- TestFlowThread(final int numberOfSwtiches, final int numberOfFlows, final CommandInterpreter ci, final int t, final int tableID) {
+ TestFlowThread(final int numberOfSwtiches, final int numberOfFlows, final CommandInterpreter ci,
+ final int threadNumber, final int tableID) {
this.numberOfSwitches = numberOfSwtiches;
this.numberOfFlows = numberOfFlows;
this.ci = ci;
- this.theadNumber = t;
+ this.theadNumber = threadNumber;
this.tableID = tableID;
}
}
}
final long endTime = System.currentTimeMillis();
- final long timeInSeconds = Math.round((endTime - startTime) / 1000);
+ final long timeInSeconds = Math.round((endTime - startTime) / 1000.0F);
if (timeInSeconds > 0) {
- ci.println("Total flows added in Thread:" + this.theadNumber + ": Flows/Sec::" + Math.round(totalNumberOfFlows / timeInSeconds));
+ ci.println("Total flows added in Thread:" + this.theadNumber + ": Flows/Sec::"
+ + Math.round((float)totalNumberOfFlows / timeInSeconds));
} else {
ci.println("Total flows added in Thread:" + this.theadNumber + ": Flows/Sec::" + totalNumberOfFlows);
}
* usage testAllFlows <dp>
* ex: _perfFlowTest 1
*/
+ @SuppressWarnings("checkstyle:IllegalCatch")
public void _testAllFlows(final CommandInterpreter ci) {
String dataPathID = ci.nextArgument();
final int numberOfFlows = 82;
if (dataPathID == null || dataPathID.trim().equals("")) {
dataPathID = "1";
}
- ci.println("* Test All Flows *");
+ ci.println("* Test All Flows *");
ci.println("* dataPathID:::" + dataPathID + "");
final String dataPath = "openflow:" + dataPathID;
final String tableId = "0";
try {
tf = createTestFlow(tn, flowID, tableId);
writeFlow(ci, tf, tn);
- } catch (final Exception e) {
+ } catch (RuntimeException e) {
ci.println("--Test Failed--Issue found while adding flow" + flow);
break;
}