Fixed changes caused by modification of flow-types and action-types.
[openflowplugin.git] / test-provider / src / main / java / org / opendaylight / openflowplugin / test / OpenflowpluginTestCommandProvider.java
1 /*
2  * Copyright (c) 2013 Ericsson , Inc. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8
9 package org.opendaylight.openflowplugin.test;
10
11 import java.math.BigInteger;
12 import java.util.ArrayList;
13 import java.util.List;
14 import java.util.concurrent.ExecutionException;
15 import java.util.concurrent.Future;
16
17 import org.eclipse.osgi.framework.console.CommandInterpreter;
18 import org.eclipse.osgi.framework.console.CommandProvider;
19 import org.opendaylight.controller.md.sal.common.api.TransactionStatus;
20 import org.opendaylight.controller.md.sal.common.api.data.DataModification;
21 import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;
22 import org.opendaylight.controller.sal.binding.api.data.DataBrokerService;
23 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Dscp;
24 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv4Prefix;
25 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv6Address;
26 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv6FlowLabel;
27 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv6Prefix;
28 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.PortNumber;
29 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Uri;
30 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev100924.MacAddress;
31 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.VlanCfi;
32 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.ControllerActionCaseBuilder;
33 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.CopyTtlInCaseBuilder;
34 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.CopyTtlOutCaseBuilder;
35 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.DecMplsTtlCaseBuilder;
36 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.DecNwTtlCaseBuilder;
37 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.DropActionCaseBuilder;
38 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.FloodActionCaseBuilder;
39 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.FloodAllActionCaseBuilder;
40 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.GroupActionCaseBuilder;
41 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.HwPathActionCaseBuilder;
42 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.LoopbackActionCaseBuilder;
43 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.OutputActionCaseBuilder;
44 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.PopMplsActionCaseBuilder;
45 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.PopPbbActionCaseBuilder;
46 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.PopVlanActionCaseBuilder;
47 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.PushMplsActionCaseBuilder;
48 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.PushPbbActionCaseBuilder;
49 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.PushVlanActionCaseBuilder;
50 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetDlDstActionCaseBuilder;
51 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetDlSrcActionCaseBuilder;
52 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetDlTypeActionCaseBuilder;
53 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetMplsTtlActionCaseBuilder;
54 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetNextHopActionCaseBuilder;
55 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetNwDstActionCaseBuilder;
56 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetNwSrcActionCaseBuilder;
57 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetNwTosActionCaseBuilder;
58 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetNwTtlActionCaseBuilder;
59 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetQueueActionCaseBuilder;
60 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetTpDstActionCaseBuilder;
61 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetTpSrcActionCaseBuilder;
62 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetVlanCfiActionCaseBuilder;
63 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetVlanIdActionCaseBuilder;
64 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetVlanPcpActionCaseBuilder;
65 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SwPathActionCaseBuilder;
66 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.controller.action._case.ControllerActionBuilder;
67 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.copy.ttl.in._case.CopyTtlInBuilder;
68 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.copy.ttl.out._case.CopyTtlOutBuilder;
69 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.dec.mpls.ttl._case.DecMplsTtlBuilder;
70 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.dec.nw.ttl._case.DecNwTtl;
71 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.dec.nw.ttl._case.DecNwTtlBuilder;
72 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.drop.action._case.DropAction;
73 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.drop.action._case.DropActionBuilder;
74 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.flood.action._case.FloodActionBuilder;
75 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.flood.all.action._case.FloodAllActionBuilder;
76 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.group.action._case.GroupActionBuilder;
77 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.hw.path.action._case.HwPathActionBuilder;
78 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.loopback.action._case.LoopbackActionBuilder;
79 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.output.action._case.OutputActionBuilder;
80 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.pop.mpls.action._case.PopMplsActionBuilder;
81 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.pop.pbb.action._case.PopPbbActionBuilder;
82 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.pop.vlan.action._case.PopVlanActionBuilder;
83 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.push.mpls.action._case.PushMplsActionBuilder;
84 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.push.pbb.action._case.PushPbbActionBuilder;
85 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.push.vlan.action._case.PushVlanActionBuilder;
86 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.dl.dst.action._case.SetDlDstActionBuilder;
87 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.dl.src.action._case.SetDlSrcActionBuilder;
88 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.dl.type.action._case.SetDlTypeActionBuilder;
89 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.field._case.SetFieldBuilder;
90 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.mpls.ttl.action._case.SetMplsTtlActionBuilder;
91 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.next.hop.action._case.SetNextHopActionBuilder;
92 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.nw.dst.action._case.SetNwDstActionBuilder;
93 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.nw.src.action._case.SetNwSrcActionBuilder;
94 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.nw.tos.action._case.SetNwTosActionBuilder;
95 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.nw.ttl.action._case.SetNwTtlActionBuilder;
96 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.queue.action._case.SetQueueActionBuilder;
97 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.tp.dst.action._case.SetTpDstActionBuilder;
98 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.tp.src.action._case.SetTpSrcActionBuilder;
99 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.vlan.cfi.action._case.SetVlanCfiActionBuilder;
100 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.vlan.id.action._case.SetVlanIdActionBuilder;
101 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.vlan.pcp.action._case.SetVlanPcpActionBuilder;
102 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.sw.path.action._case.SwPathActionBuilder;
103 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action;
104 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionBuilder;
105 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.address.address.Ipv4Builder;
106 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.config.rev130819.Flows;
107 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow;
108 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.FlowBuilder;
109 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.FlowKey;
110 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode;
111 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowId;
112 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.FlowModFlags;
113 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.InstructionsBuilder;
114 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
115 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.ApplyActionsCaseBuilder;
116 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.GoToTableCaseBuilder;
117 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.MeterCaseBuilder;
118 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.WriteMetadataCaseBuilder;
119 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.apply.actions._case.ApplyActionsBuilder;
120 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.go.to.table._case.GoToTableBuilder;
121 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.meter._case.MeterBuilder;
122 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.write.metadata._case.WriteMetadataBuilder;
123 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.Instruction;
124 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.InstructionBuilder;
125 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
126 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRef;
127 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes;
128 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
129 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeBuilder;
130 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey;
131 import org.opendaylight.yang.gen.v1.urn.opendaylight.l2.types.rev130827.EtherType;
132 import org.opendaylight.yang.gen.v1.urn.opendaylight.l2.types.rev130827.VlanId;
133 import org.opendaylight.yang.gen.v1.urn.opendaylight.l2.types.rev130827.VlanPcp;
134 import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.MeterId;
135 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.arp.match.fields.ArpSourceHardwareAddressBuilder;
136 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.arp.match.fields.ArpTargetHardwareAddressBuilder;
137 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.ethernet.match.fields.EthernetDestinationBuilder;
138 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.ethernet.match.fields.EthernetSourceBuilder;
139 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.ethernet.match.fields.EthernetTypeBuilder;
140 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.ipv6.match.fields.Ipv6ExtHeaderBuilder;
141 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.ipv6.match.fields.Ipv6LabelBuilder;
142 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.EthernetMatchBuilder;
143 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.Icmpv4MatchBuilder;
144 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.Icmpv6MatchBuilder;
145 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.IpMatchBuilder;
146 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.MetadataBuilder;
147 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.ProtocolMatchFieldsBuilder;
148 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.TunnelBuilder;
149 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.VlanMatchBuilder;
150 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.ArpMatchBuilder;
151 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.Ipv4Match;
152 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.Ipv4MatchBuilder;
153 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.Ipv6MatchBuilder;
154 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._4.match.SctpMatchBuilder;
155 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._4.match.TcpMatchBuilder;
156 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._4.match.UdpMatchBuilder;
157 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.vlan.match.fields.VlanIdBuilder;
158 import org.opendaylight.yangtools.yang.binding.DataObject;
159 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
160 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier.InstanceIdentifierBuilder;
161 import org.opendaylight.yangtools.yang.common.RpcResult;
162 import org.osgi.framework.BundleContext;
163 import org.slf4j.Logger;
164 import org.slf4j.LoggerFactory;
165 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.Table;
166 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.TableKey;
167
168 public class OpenflowpluginTestCommandProvider implements CommandProvider {
169
170     private static final Logger LOG = LoggerFactory.getLogger(OpenflowpluginTestCommandProvider.class);
171
172     private DataBrokerService dataBrokerService;
173     private ProviderContext pc;
174     private final BundleContext ctx;
175     private FlowBuilder testFlow;
176     private NodeBuilder testNode;
177     private final String originalFlowName = "Foo";
178     private final String updatedFlowName = "Bar";
179
180     public OpenflowpluginTestCommandProvider(BundleContext ctx) {
181         this.ctx = ctx;
182     }
183
184     public void onSessionInitiated(ProviderContext session) {
185         pc = session;
186         dataBrokerService = session.getSALService(DataBrokerService.class);
187         ctx.registerService(CommandProvider.class.getName(), this, null);
188         createTestFlow(createTestNode(null), null);
189     }
190
191     private NodeBuilder createTestNode(String nodeId) {
192         if (nodeId == null) {
193             nodeId = OpenflowpluginTestActivator.NODE_ID;
194         }
195         NodeRef nodeOne = createNodeRef(nodeId);
196         NodeBuilder builder = new NodeBuilder();
197         builder.setId(new NodeId(nodeId));
198         builder.setKey(new NodeKey(builder.getId()));
199         testNode = builder;
200         return builder;
201     }
202
203     private InstanceIdentifier<Node> nodeBuilderToInstanceId(NodeBuilder node) {
204         return InstanceIdentifier.builder(Nodes.class).child(Node.class, node.getKey()).toInstance();
205     }
206
207     private FlowBuilder createTestFlow(NodeBuilder nodeBuilder, String flowTypeArg) {
208
209         FlowBuilder flow = new FlowBuilder();
210         long id = 123;
211
212         String flowType = flowTypeArg;
213         if (flowType == null) {
214             flowType = "f1";
215         }
216
217         switch (flowType) {
218         case "f1":
219             id += 1;
220             flow.setMatch(createMatch1().build());
221             flow.setInstructions(createDecNwTtlInstructions().build());
222             break;
223         case "f2":
224             id += 2;
225             flow.setMatch(createMatch2().build());
226             flow.setInstructions(createDropInstructions().build());
227             break;
228         case "f3":
229             id += 3;
230             flow.setMatch(createMatch3().build());
231             flow.setInstructions(createDropInstructions().build());
232             break;
233         case "f4":
234             id += 4;
235             flow.setMatch(createEthernetMatch().build());
236             flow.setInstructions(createDropInstructions().build());
237             break;
238         case "f5":
239             id += 5;
240             flow.setMatch(createMatch1().build());
241             flow.setInstructions(createAppyActionInstruction().build());
242             break;
243         case "f6":
244             id += 6;
245             flow.setMatch(createMatch1().build());
246             flow.setInstructions(createGotoTableInstructions().build());
247             break;
248         case "f7":
249             id += 7;
250             flow.setMatch(createMatch1().build());
251             flow.setInstructions(createMeterInstructions().build());
252             break;
253         case "f8":
254             id += 8;
255             flow.setMatch(createMatch1().build());
256             flow.setInstructions(createAppyActionInstruction1().build());
257             break;
258         case "f9":
259             id += 9;
260             flow.setMatch(createMatch1().build());
261             flow.setInstructions(createAppyActionInstruction2().build());
262             break;
263         case "f10":
264             id += 10;
265             flow.setMatch(createMatch1().build());
266             flow.setInstructions(createAppyActionInstruction3().build());
267             break;
268         case "f11":
269             id += 11;
270             flow.setMatch(createMatch1().build());
271             flow.setInstructions(createAppyActionInstruction4().build());
272             break;
273         case "f12":
274             id += 12;
275             flow.setMatch(createMatch1().build());
276             flow.setInstructions(createAppyActionInstruction5().build());
277             break;
278         case "f13":
279             id += 13;
280             flow.setMatch(createMatch1().build());
281             flow.setInstructions(createAppyActionInstruction6().build());
282             break;
283         case "f14":
284             id += 14;
285             flow.setMatch(createMatch1().build());
286             flow.setInstructions(createAppyActionInstruction7().build());
287             break;
288         case "f15":
289             id += 15;
290             flow.setMatch(createMatch1().build());
291             flow.setInstructions(createAppyActionInstruction8().build());
292             break;
293         case "f16":
294             id += 16;
295             flow.setMatch(createMatch1().build());
296             flow.setInstructions(createAppyActionInstruction9().build());
297             break;
298         case "f17":
299             id += 17;
300             flow.setMatch(createMatch1().build());
301             flow.setInstructions(createAppyActionInstruction10().build());
302             break;
303         case "f18":
304             id += 18;
305             flow.setMatch(createMatch1().build());
306             flow.setInstructions(createAppyActionInstruction11().build());
307             break;
308         case "f19":
309             id += 19;
310             flow.setMatch(createMatch1().build());
311             flow.setInstructions(createAppyActionInstruction12().build());
312             break;
313         case "f20":
314             id += 20;
315             flow.setMatch(createMatch1().build());
316             flow.setInstructions(createAppyActionInstruction13().build());
317             break;
318         case "f21":
319             id += 21;
320             flow.setMatch(createMatch1().build());
321             flow.setInstructions(createAppyActionInstruction14().build());
322             break;
323         case "f22":
324             id += 22;
325             flow.setMatch(createMatch1().build());
326             flow.setInstructions(createAppyActionInstruction15().build());
327             break;
328         case "f23":
329             id += 23;
330             flow.setMatch(createMatch1().build());
331             flow.setInstructions(createAppyActionInstruction16().build());
332             break;
333         case "f24":
334             id += 24;
335             flow.setMatch(createMatch1().build());
336             flow.setInstructions(createAppyActionInstruction17().build());
337             break;
338         case "f25":
339             id += 25;
340             flow.setMatch(createMatch1().build());
341             flow.setInstructions(createAppyActionInstruction18().build());
342             break;
343         case "f26":
344             id += 26;
345             flow.setMatch(createMatch1().build());
346             flow.setInstructions(createAppyActionInstruction19().build());
347             break;
348         case "f27":
349             id += 27;
350             flow.setMatch(createMatch1().build());
351             flow.setInstructions(createMetadataInstructions().build());
352             break;
353         case "f28":
354             id += 28;
355             flow.setMatch(createMatch1().build());
356             flow.setInstructions(createAppyActionInstruction20().build());
357             break;
358         case "f29":
359             id += 29;
360             flow.setMatch(createMatch1().build());
361             flow.setInstructions(createAppyActionInstruction21().build());
362             break;
363         case "f30":
364             id += 30;
365             flow.setMatch(createMatch1().build());
366             flow.setInstructions(createAppyActionInstruction22().build());
367             break;
368         case "f31":
369             id += 31;
370             flow.setMatch(createMatch1().build());
371             flow.setInstructions(createAppyActionInstruction23().build());
372             break;
373         case "f32":
374             id += 32;
375             flow.setMatch(createMatch1().build());
376             flow.setInstructions(createAppyActionInstruction24().build());
377             break;
378         case "f33":
379             id += 33;
380             flow.setMatch(createMatch1().build());
381             flow.setInstructions(createAppyActionInstruction25().build());
382             break;
383         case "f34":
384             id += 34;
385             flow.setMatch(createMatch1().build());
386             flow.setInstructions(createAppyActionInstruction26().build());
387             break;
388         case "f35":
389             id += 35;
390             flow.setMatch(createMatch1().build());
391             flow.setInstructions(createAppyActionInstruction27().build());
392             break;
393         case "f36":
394             id += 36;
395             flow.setMatch(createMatch1().build());
396             flow.setInstructions(createAppyActionInstruction28().build());
397             break;
398         case "f37":
399             id += 37;
400             flow.setMatch(createMatch1().build());
401             flow.setInstructions(createAppyActionInstruction29().build());
402             break;
403         case "f38":
404             id += 38;
405             flow.setMatch(createMatch1().build());
406             flow.setInstructions(createAppyActionInstruction30().build());
407             break;
408         case "f39":
409             id += 39;
410             flow.setMatch(createMatch1().build());
411             flow.setInstructions(createAppyActionInstruction31().build());
412             break;
413         case "f40":
414             id += 40;
415             flow.setMatch(createMatch1().build());
416             flow.setInstructions(createAppyActionInstruction32().build());
417             break;
418         case "f41":
419             id += 41;
420             flow.setMatch(createMatch1().build());
421             flow.setInstructions(createAppyActionInstruction33().build());
422             break;
423         case "f42":
424             id += 42;
425             flow.setMatch(createMatch1().build());
426             flow.setInstructions(createAppyActionInstruction34().build());
427             break;
428         case "f43":
429             id += 43;
430             flow.setMatch(createICMPv6Match().build());
431             flow.setInstructions(createDecNwTtlInstructions().build());
432             break;
433         case "f44":
434             id += 44;
435             flow.setMatch(createInphyportMatch().build());
436             flow.setInstructions(createDropInstructions().build());
437             break;
438         case "f45":
439             id += 45;
440             flow.setMatch(createMetadataMatch().build());
441             flow.setInstructions(createDropInstructions().build());
442             break;
443         case "f46":
444             id += 46;
445             flow.setMatch(createL3IPv6Match().build());
446             flow.setInstructions(createDecNwTtlInstructions().build());
447             break;
448         case "f47":
449             id += 47;
450             flow.setMatch(createL4SCTPMatch().build());
451             flow.setInstructions(createAppyActionInstruction().build());
452             break;
453         case "f48":
454             id += 48;
455             flow.setMatch(createTunnelIDMatch().build());
456             flow.setInstructions(createGotoTableInstructions().build());
457             break;
458         case "49":
459             id += 49;
460             flow.setMatch(createVlanMatch().build());
461             flow.setInstructions(createMeterInstructions().build());
462             break;
463
464         default:
465             LOG.warn("flow type not understood: {}", flowType);
466         }
467
468         FlowKey key = new FlowKey(new FlowId(id));
469         flow.setBarrier(false);
470         // flow.setBufferId(new Long(12));
471         BigInteger value = new BigInteger("10", 10);
472         flow.setCookie(value);
473         flow.setCookieMask(value);
474         flow.setHardTimeout(12);
475         flow.setIdleTimeout(34);
476         flow.setInstallHw(false);
477         flow.setStrict(false);
478         flow.setContainerName(null);
479         flow.setFlags(new FlowModFlags(false, false, false, false, false));
480         flow.setId(new FlowId(new Long(12)));
481         flow.setTableId((short) 2);
482         flow.setOutGroup(new Long(2));
483         flow.setOutPort(value);
484
485         flow.setKey(key);
486         flow.setPriority(2);
487         flow.setFlowName(originalFlowName + "X" + flowType);
488         testFlow = flow;
489         return flow;
490     }
491
492     /**
493      * @return
494      */
495     private static InstructionsBuilder createDecNwTtlInstructions() {
496         DecNwTtlBuilder ta = new DecNwTtlBuilder();
497         DecNwTtl decNwTtl = ta.build();
498         ActionBuilder ab = new ActionBuilder();
499         ab.setAction(new DecNwTtlCaseBuilder().setDecNwTtl(decNwTtl).build());
500
501         // Add our drop action to a list
502         List<Action> actionList = new ArrayList<Action>();
503         actionList.add(ab.build());
504
505         // Create an Apply Action
506         ApplyActionsBuilder aab = new ApplyActionsBuilder();
507         aab.setAction(actionList);
508
509         // Wrap our Apply Action in an Instruction
510         InstructionBuilder ib = new InstructionBuilder();
511         ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
512
513         // Put our Instruction in a list of Instructions
514         InstructionsBuilder isb = new InstructionsBuilder();
515         List<Instruction> instructions = new ArrayList<Instruction>();
516         instructions.add(ib.build());
517         isb.setInstruction(instructions);
518         return isb;
519     }
520
521     /**
522      * @return
523      */
524     private static InstructionsBuilder createMeterInstructions() {
525
526         MeterBuilder aab = new MeterBuilder();
527         aab.setMeterId(new MeterId(new Long(1)));
528
529         InstructionBuilder ib = new InstructionBuilder();
530         ib.setInstruction(new MeterCaseBuilder().setMeter(aab.build()).build());
531
532         // Put our Instruction in a list of Instructions
533         InstructionsBuilder isb = new InstructionsBuilder();
534         List<Instruction> instructions = new ArrayList<Instruction>();
535         instructions.add(ib.build());
536         isb.setInstruction(instructions);
537         return isb;
538     }
539
540     private static InstructionsBuilder createMetadataInstructions() {
541
542         WriteMetadataBuilder aab = new WriteMetadataBuilder();
543         aab.setMetadata(new BigInteger("10", 10));
544         aab.setMetadataMask(new BigInteger("12", 10));
545
546         InstructionBuilder ib = new InstructionBuilder();
547         ib.setInstruction(new WriteMetadataCaseBuilder().setWriteMetadata(aab.build()).build());
548
549         // Put our Instruction in a list of Instructions
550         InstructionsBuilder isb = new InstructionsBuilder();
551         List<Instruction> instructions = new ArrayList<Instruction>();
552         instructions.add(ib.build());
553         isb.setInstruction(instructions);
554         return isb;
555     }
556
557     private static InstructionsBuilder createGotoTableInstructions() {
558
559         GoToTableBuilder aab = new GoToTableBuilder();
560         aab.setTableId((short) 2);
561
562         InstructionBuilder ib = new InstructionBuilder();
563         ib.setInstruction(new GoToTableCaseBuilder().setGoToTable(aab.build()).build());
564
565         // Put our Instruction in a list of Instructions
566         InstructionsBuilder isb = new InstructionsBuilder();
567         List<Instruction> instructions = new ArrayList<Instruction>();
568         instructions.add(ib.build());
569         isb.setInstruction(instructions);
570         return isb;
571     }
572
573     private static InstructionsBuilder createDropInstructions() {
574         DropActionBuilder dab = new DropActionBuilder();
575         DropAction dropAction = dab.build();
576         ActionBuilder ab = new ActionBuilder();
577         ab.setAction(new DropActionCaseBuilder().setDropAction(dropAction).build());
578
579         // Add our drop action to a list
580         List<Action> actionList = new ArrayList<Action>();
581         actionList.add(ab.build());
582
583         // Create an Apply Action
584         ApplyActionsBuilder aab = new ApplyActionsBuilder();
585         aab.setAction(actionList);
586
587         // Wrap our Apply Action in an Instruction
588         InstructionBuilder ib = new InstructionBuilder();
589         ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
590
591         // Put our Instruction in a list of Instructions
592         InstructionsBuilder isb = new InstructionsBuilder();
593         List<Instruction> instructions = new ArrayList<Instruction>();
594         instructions.add(ib.build());
595         isb.setInstruction(instructions);
596         return isb;
597     }
598
599     private static InstructionsBuilder createAppyActionInstruction() {
600
601         List<Action> actionList = new ArrayList<Action>();
602         ActionBuilder ab = new ActionBuilder();
603         ControllerActionBuilder controller = new ControllerActionBuilder();
604         controller.setMaxLength(5);
605         ab.setAction(new ControllerActionCaseBuilder().setControllerAction(controller.build()).build());
606         actionList.add(ab.build());
607         // Create an Apply Action
608         ApplyActionsBuilder aab = new ApplyActionsBuilder();
609         aab.setAction(actionList);
610
611         // Wrap our Apply Action in an Instruction
612         InstructionBuilder ib = new InstructionBuilder();
613         ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
614
615         // Put our Instruction in a list of Instructions
616         InstructionsBuilder isb = new InstructionsBuilder();
617         List<Instruction> instructions = new ArrayList<Instruction>();
618         instructions.add(ib.build());
619         isb.setInstruction(instructions);
620         return isb;
621     }
622
623     private static InstructionsBuilder createAppyActionInstruction1() {
624
625         List<Action> actionList = new ArrayList<Action>();
626         ActionBuilder ab = new ActionBuilder();
627
628         OutputActionBuilder output = new OutputActionBuilder();
629         output.setMaxLength(56);
630         Uri value = new Uri("PCEP");
631         output.setOutputNodeConnector(value);
632         ab.setAction(new OutputActionCaseBuilder().setOutputAction(output.build()).build());
633         actionList.add(ab.build());
634         // Create an Apply Action
635         ApplyActionsBuilder aab = new ApplyActionsBuilder();
636         aab.setAction(actionList);
637
638         // Wrap our Apply Action in an Instruction
639         InstructionBuilder ib = new InstructionBuilder();
640         ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
641
642         // Put our Instruction in a list of Instructions
643         InstructionsBuilder isb = new InstructionsBuilder();
644         List<Instruction> instructions = new ArrayList<Instruction>();
645         instructions.add(ib.build());
646         isb.setInstruction(instructions);
647         return isb;
648     }
649
650     private static InstructionsBuilder createAppyActionInstruction2() {
651
652         List<Action> actionList = new ArrayList<Action>();
653         ActionBuilder ab = new ActionBuilder();
654
655         PushMplsActionBuilder push = new PushMplsActionBuilder();
656         push.setEthernetType(new Integer(0x8847));
657         ab.setAction(new PushMplsActionCaseBuilder().setPushMplsAction(push.build()).build());
658         actionList.add(ab.build());
659         // Create an Apply Action
660         ApplyActionsBuilder aab = new ApplyActionsBuilder();
661         aab.setAction(actionList);
662
663         // Wrap our Apply Action in an Instruction
664         InstructionBuilder ib = new InstructionBuilder();
665         ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
666
667         // Put our Instruction in a list of Instructions
668         InstructionsBuilder isb = new InstructionsBuilder();
669         List<Instruction> instructions = new ArrayList<Instruction>();
670         instructions.add(ib.build());
671         isb.setInstruction(instructions);
672         return isb;
673     }
674
675     private static InstructionsBuilder createAppyActionInstruction3() {
676
677         List<Action> actionList = new ArrayList<Action>();
678         ActionBuilder ab = new ActionBuilder();
679
680         PushPbbActionBuilder pbb = new PushPbbActionBuilder();
681         pbb.setEthernetType(new Integer(0x88E7));
682         ab.setAction(new PushPbbActionCaseBuilder().setPushPbbAction(pbb.build()).build());
683         actionList.add(ab.build());
684         // Create an Apply Action
685         ApplyActionsBuilder aab = new ApplyActionsBuilder();
686         aab.setAction(actionList);
687
688         // Wrap our Apply Action in an Instruction
689         InstructionBuilder ib = new InstructionBuilder();
690         ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
691
692         // Put our Instruction in a list of Instructions
693         InstructionsBuilder isb = new InstructionsBuilder();
694         List<Instruction> instructions = new ArrayList<Instruction>();
695         instructions.add(ib.build());
696         isb.setInstruction(instructions);
697         return isb;
698     }
699
700     private static InstructionsBuilder createAppyActionInstruction4() {
701
702         List<Action> actionList = new ArrayList<Action>();
703         ActionBuilder ab = new ActionBuilder();
704
705         PushVlanActionBuilder vlan = new PushVlanActionBuilder();
706         vlan.setEthernetType(new Integer(0x8100));
707         ab.setAction(new PushVlanActionCaseBuilder().setPushVlanAction(vlan.build()).build());
708         actionList.add(ab.build());
709
710         // Create an Apply Action
711         ApplyActionsBuilder aab = new ApplyActionsBuilder();
712         aab.setAction(actionList);
713
714         // Wrap our Apply Action in an Instruction
715         InstructionBuilder ib = new InstructionBuilder();
716         ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
717
718         // Put our Instruction in a list of Instructions
719         InstructionsBuilder isb = new InstructionsBuilder();
720         List<Instruction> instructions = new ArrayList<Instruction>();
721         instructions.add(ib.build());
722         isb.setInstruction(instructions);
723         return isb;
724     }
725
726     private static InstructionsBuilder createAppyActionInstruction5() {
727
728         List<Action> actionList = new ArrayList<Action>();
729         ActionBuilder ab = new ActionBuilder();
730
731         SetDlDstActionBuilder setdl = new SetDlDstActionBuilder();
732         setdl.setAddress(new MacAddress("00:05:b9:7c:81:5f"));
733         ab.setAction(new SetDlDstActionCaseBuilder().setSetDlDstAction(setdl.build()).build());
734         actionList.add(ab.build());
735         // Create an Apply Action
736         ApplyActionsBuilder aab = new ApplyActionsBuilder();
737         aab.setAction(actionList);
738
739         // Wrap our Apply Action in an Instruction
740         InstructionBuilder ib = new InstructionBuilder();
741         ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
742
743         // Put our Instruction in a list of Instructions
744         InstructionsBuilder isb = new InstructionsBuilder();
745         List<Instruction> instructions = new ArrayList<Instruction>();
746         instructions.add(ib.build());
747         isb.setInstruction(instructions);
748         return isb;
749     }
750
751     private static InstructionsBuilder createAppyActionInstruction6() {
752
753         List<Action> actionList = new ArrayList<Action>();
754         ActionBuilder ab = new ActionBuilder();
755
756         SetDlSrcActionBuilder src = new SetDlSrcActionBuilder();
757         src.setAddress(new MacAddress("00:05:b9:7c:81:5f"));
758         ab.setAction(new SetDlSrcActionCaseBuilder().setSetDlSrcAction(src.build()).build());
759         actionList.add(ab.build());
760
761         // Create an Apply Action
762         ApplyActionsBuilder aab = new ApplyActionsBuilder();
763         aab.setAction(actionList);
764
765         // Wrap our Apply Action in an Instruction
766         InstructionBuilder ib = new InstructionBuilder();
767         ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
768
769         // Put our Instruction in a list of Instructions
770         InstructionsBuilder isb = new InstructionsBuilder();
771         List<Instruction> instructions = new ArrayList<Instruction>();
772         instructions.add(ib.build());
773         isb.setInstruction(instructions);
774         return isb;
775     }
776
777     private static InstructionsBuilder createAppyActionInstruction7() {
778
779         List<Action> actionList = new ArrayList<Action>();
780         ActionBuilder ab = new ActionBuilder();
781
782         SetVlanIdActionBuilder vl = new SetVlanIdActionBuilder();
783         VlanId a = new VlanId(4000);
784         vl.setVlanId(a);
785         ab.setAction(new SetVlanIdActionCaseBuilder().setSetVlanIdAction(vl.build()).build());
786         actionList.add(ab.build());
787         // Create an Apply Action
788         ApplyActionsBuilder aab = new ApplyActionsBuilder();
789         aab.setAction(actionList);
790
791         // Wrap our Apply Action in an Instruction
792         InstructionBuilder ib = new InstructionBuilder();
793         ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
794
795         // Put our Instruction in a list of Instructions
796         InstructionsBuilder isb = new InstructionsBuilder();
797         List<Instruction> instructions = new ArrayList<Instruction>();
798         instructions.add(ib.build());
799         isb.setInstruction(instructions);
800         return isb;
801     }
802
803     private static InstructionsBuilder createAppyActionInstruction8() {
804
805         List<Action> actionList = new ArrayList<Action>();
806         ActionBuilder ab = new ActionBuilder();
807
808         SetVlanPcpActionBuilder pcp = new SetVlanPcpActionBuilder();
809         VlanPcp pcp1 = new VlanPcp((short) 2);
810         pcp.setVlanPcp(pcp1);
811         ab.setAction(new SetVlanPcpActionCaseBuilder().setSetVlanPcpAction(pcp.build()).build());
812         actionList.add(ab.build());
813         // Create an Apply Action
814         ApplyActionsBuilder aab = new ApplyActionsBuilder();
815         aab.setAction(actionList);
816
817         // Wrap our Apply Action in an Instruction
818         InstructionBuilder ib = new InstructionBuilder();
819         ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
820
821         // Put our Instruction in a list of Instructions
822         InstructionsBuilder isb = new InstructionsBuilder();
823         List<Instruction> instructions = new ArrayList<Instruction>();
824         instructions.add(ib.build());
825         isb.setInstruction(instructions);
826         return isb;
827     }
828
829     private static InstructionsBuilder createAppyActionInstruction9() {
830
831         List<Action> actionList = new ArrayList<Action>();
832         ActionBuilder ab = new ActionBuilder();
833
834         CopyTtlInBuilder ttlin = new CopyTtlInBuilder();
835         ab.setAction(new  CopyTtlInCaseBuilder().setCopyTtlIn(ttlin.build()).build());
836         actionList.add(ab.build());
837         // Create an Apply Action
838         ApplyActionsBuilder aab = new ApplyActionsBuilder();
839         aab.setAction(actionList);
840
841         // Wrap our Apply Action in an Instruction
842         InstructionBuilder ib = new InstructionBuilder();
843         ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
844
845         // Put our Instruction in a list of Instructions
846         InstructionsBuilder isb = new InstructionsBuilder();
847         List<Instruction> instructions = new ArrayList<Instruction>();
848         instructions.add(ib.build());
849         isb.setInstruction(instructions);
850         return isb;
851     }
852
853     private static InstructionsBuilder createAppyActionInstruction10() {
854
855         List<Action> actionList = new ArrayList<Action>();
856         ActionBuilder ab = new ActionBuilder();
857
858         CopyTtlOutBuilder ttlout = new CopyTtlOutBuilder();
859         ab.setAction(new CopyTtlOutCaseBuilder().setCopyTtlOut(ttlout.build()).build());
860         actionList.add(ab.build());
861         // Create an Apply Action
862         ApplyActionsBuilder aab = new ApplyActionsBuilder();
863         aab.setAction(actionList);
864
865         // Wrap our Apply Action in an Instruction
866         InstructionBuilder ib = new InstructionBuilder();
867         ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
868
869         // Put our Instruction in a list of Instructions
870         InstructionsBuilder isb = new InstructionsBuilder();
871         List<Instruction> instructions = new ArrayList<Instruction>();
872         instructions.add(ib.build());
873         isb.setInstruction(instructions);
874         return isb;
875     }
876
877     private static InstructionsBuilder createAppyActionInstruction11() {
878
879         List<Action> actionList = new ArrayList<Action>();
880         ActionBuilder ab = new ActionBuilder();
881
882         DecMplsTtlBuilder mpls = new DecMplsTtlBuilder();
883         ab.setAction(new DecMplsTtlCaseBuilder().setDecMplsTtl(mpls.build()).build());
884         actionList.add(ab.build());
885         // Create an Apply Action
886         ApplyActionsBuilder aab = new ApplyActionsBuilder();
887         aab.setAction(actionList);
888
889         // Wrap our Apply Action in an Instruction
890         InstructionBuilder ib = new InstructionBuilder();
891         ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
892
893         // Put our Instruction in a list of Instructions
894         InstructionsBuilder isb = new InstructionsBuilder();
895         List<Instruction> instructions = new ArrayList<Instruction>();
896         instructions.add(ib.build());
897         isb.setInstruction(instructions);
898         return isb;
899     }
900
901     private static InstructionsBuilder createAppyActionInstruction12() {
902
903         List<Action> actionList = new ArrayList<Action>();
904         ActionBuilder ab = new ActionBuilder();
905
906         DecNwTtlBuilder nwttl = new DecNwTtlBuilder();
907         ab.setAction(new DecNwTtlCaseBuilder().setDecNwTtl(nwttl.build()).build());
908         actionList.add(ab.build());
909
910         // Create an Apply Action
911         ApplyActionsBuilder aab = new ApplyActionsBuilder();
912         aab.setAction(actionList);
913
914         // Wrap our Apply Action in an Instruction
915         InstructionBuilder ib = new InstructionBuilder();
916         ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
917
918         // Put our Instruction in a list of Instructions
919         InstructionsBuilder isb = new InstructionsBuilder();
920         List<Instruction> instructions = new ArrayList<Instruction>();
921         instructions.add(ib.build());
922         isb.setInstruction(instructions);
923         return isb;
924     }
925
926     private static InstructionsBuilder createAppyActionInstruction13() {
927
928         List<Action> actionList = new ArrayList<Action>();
929         ActionBuilder ab = new ActionBuilder();
930
931         DropActionBuilder drop = new DropActionBuilder();
932         ab.setAction(new DropActionCaseBuilder().setDropAction(drop.build()).build());
933         actionList.add(ab.build());
934
935         // Create an Apply Action
936         ApplyActionsBuilder aab = new ApplyActionsBuilder();
937         aab.setAction(actionList);
938
939         // Wrap our Apply Action in an Instruction
940         InstructionBuilder ib = new InstructionBuilder();
941         ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
942
943         // Put our Instruction in a list of Instructions
944         InstructionsBuilder isb = new InstructionsBuilder();
945         List<Instruction> instructions = new ArrayList<Instruction>();
946         instructions.add(ib.build());
947         isb.setInstruction(instructions);
948         return isb;
949     }
950
951     private static InstructionsBuilder createAppyActionInstruction14() {
952
953         List<Action> actionList = new ArrayList<Action>();
954         ActionBuilder ab = new ActionBuilder();
955
956         FloodActionBuilder fld = new FloodActionBuilder();
957         ab.setAction(new FloodActionCaseBuilder().setFloodAction(fld.build()).build());
958         actionList.add(ab.build());
959         // Create an Apply Action
960         ApplyActionsBuilder aab = new ApplyActionsBuilder();
961         aab.setAction(actionList);
962
963         // Wrap our Apply Action in an Instruction
964         InstructionBuilder ib = new InstructionBuilder();
965         ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
966
967         // Put our Instruction in a list of Instructions
968         InstructionsBuilder isb = new InstructionsBuilder();
969         List<Instruction> instructions = new ArrayList<Instruction>();
970         instructions.add(ib.build());
971         isb.setInstruction(instructions);
972         return isb;
973     }
974
975     private static InstructionsBuilder createAppyActionInstruction15() {
976
977         List<Action> actionList = new ArrayList<Action>();
978         ActionBuilder ab = new ActionBuilder();
979
980         FloodAllActionBuilder fldall = new FloodAllActionBuilder();
981         ab.setAction(new FloodAllActionCaseBuilder().setFloodAllAction(fldall.build()).build());
982         actionList.add(ab.build());
983         // Create an Apply Action
984         ApplyActionsBuilder aab = new ApplyActionsBuilder();
985         aab.setAction(actionList);
986
987         // Wrap our Apply Action in an Instruction
988         InstructionBuilder ib = new InstructionBuilder();
989         ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
990
991         // Put our Instruction in a list of Instructions
992         InstructionsBuilder isb = new InstructionsBuilder();
993         List<Instruction> instructions = new ArrayList<Instruction>();
994         instructions.add(ib.build());
995         isb.setInstruction(instructions);
996         return isb;
997     }
998
999     private static InstructionsBuilder createAppyActionInstruction16() {
1000
1001         List<Action> actionList = new ArrayList<Action>();
1002         ActionBuilder ab = new ActionBuilder();
1003
1004         GroupActionBuilder groupActionB = new GroupActionBuilder();
1005         groupActionB.setGroupId(1L);
1006         groupActionB.setGroup("0");
1007         ab.setAction(new GroupActionCaseBuilder().setGroupAction(groupActionB.build()).build());
1008         actionList.add(ab.build());
1009
1010         // Create an Apply Action
1011         ApplyActionsBuilder aab = new ApplyActionsBuilder();
1012         aab.setAction(actionList);
1013
1014         // Wrap our Apply Action in an Instruction
1015         InstructionBuilder ib = new InstructionBuilder();
1016         ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
1017
1018         // Put our Instruction in a list of Instructions
1019         InstructionsBuilder isb = new InstructionsBuilder();
1020         List<Instruction> instructions = new ArrayList<Instruction>();
1021         instructions.add(ib.build());
1022         isb.setInstruction(instructions);
1023         return isb;
1024     }
1025
1026     private static InstructionsBuilder createAppyActionInstruction17() {
1027
1028         List<Action> actionList = new ArrayList<Action>();
1029         ActionBuilder ab = new ActionBuilder();
1030
1031         HwPathActionBuilder hwPathB = new HwPathActionBuilder();
1032         ab.setAction(new HwPathActionCaseBuilder().setHwPathAction(hwPathB.build()).build());
1033         actionList.add(ab.build());
1034         // Create an Apply Action
1035         ApplyActionsBuilder aab = new ApplyActionsBuilder();
1036         aab.setAction(actionList);
1037
1038         // Wrap our Apply Action in an Instruction
1039         InstructionBuilder ib = new InstructionBuilder();
1040         ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
1041
1042         // Put our Instruction in a list of Instructions
1043         InstructionsBuilder isb = new InstructionsBuilder();
1044         List<Instruction> instructions = new ArrayList<Instruction>();
1045         instructions.add(ib.build());
1046         isb.setInstruction(instructions);
1047         return isb;
1048     }
1049
1050     private static InstructionsBuilder createAppyActionInstruction18() {
1051
1052         List<Action> actionList = new ArrayList<Action>();
1053         ActionBuilder ab = new ActionBuilder();
1054
1055         LoopbackActionBuilder loopbackActionBuilder = new LoopbackActionBuilder();
1056         ab.setAction(new LoopbackActionCaseBuilder().setLoopbackAction(loopbackActionBuilder.build()).build());
1057         actionList.add(ab.build());
1058
1059         // Create an Apply Action
1060         ApplyActionsBuilder aab = new ApplyActionsBuilder();
1061         aab.setAction(actionList);
1062
1063         // Wrap our Apply Action in an Instruction
1064         InstructionBuilder ib = new InstructionBuilder();
1065         ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
1066
1067         // Put our Instruction in a list of Instructions
1068         InstructionsBuilder isb = new InstructionsBuilder();
1069         List<Instruction> instructions = new ArrayList<Instruction>();
1070         instructions.add(ib.build());
1071         isb.setInstruction(instructions);
1072         return isb;
1073     }
1074
1075     private static InstructionsBuilder createAppyActionInstruction19() {
1076
1077         List<Action> actionList = new ArrayList<Action>();
1078         ActionBuilder ab = new ActionBuilder();
1079
1080         PopMplsActionBuilder popMplsActionBuilder = new PopMplsActionBuilder();
1081         popMplsActionBuilder.setEthernetType(0XB);
1082         ab.setAction(new PopMplsActionCaseBuilder().setPopMplsAction(popMplsActionBuilder.build()).build());
1083         actionList.add(ab.build());
1084         // Create an Apply Action
1085         ApplyActionsBuilder aab = new ApplyActionsBuilder();
1086         aab.setAction(actionList);
1087
1088         // Wrap our Apply Action in an Instruction
1089         InstructionBuilder ib = new InstructionBuilder();
1090         ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
1091
1092         // Put our Instruction in a list of Instructions
1093         InstructionsBuilder isb = new InstructionsBuilder();
1094         List<Instruction> instructions = new ArrayList<Instruction>();
1095         instructions.add(ib.build());
1096         isb.setInstruction(instructions);
1097         return isb;
1098     }
1099
1100     private static InstructionsBuilder createAppyActionInstruction20() {
1101
1102         List<Action> actionList = new ArrayList<Action>();
1103         ActionBuilder ab = new ActionBuilder();
1104
1105         PopPbbActionBuilder popPbbActionBuilder = new PopPbbActionBuilder();
1106         ab.setAction(new PopPbbActionCaseBuilder().setPopPbbAction(popPbbActionBuilder.build()).build());
1107         actionList.add(ab.build());
1108         // Create an Apply Action
1109         ApplyActionsBuilder aab = new ApplyActionsBuilder();
1110         aab.setAction(actionList);
1111
1112         // Wrap our Apply Action in an Instruction
1113         InstructionBuilder ib = new InstructionBuilder();
1114         ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
1115
1116         // Put our Instruction in a list of Instructions
1117         InstructionsBuilder isb = new InstructionsBuilder();
1118         List<Instruction> instructions = new ArrayList<Instruction>();
1119         instructions.add(ib.build());
1120         isb.setInstruction(instructions);
1121         return isb;
1122     }
1123
1124     private static InstructionsBuilder createAppyActionInstruction21() {
1125
1126         List<Action> actionList = new ArrayList<Action>();
1127         ActionBuilder ab = new ActionBuilder();
1128
1129         PopVlanActionBuilder popVlanActionBuilder = new PopVlanActionBuilder();
1130         ab.setAction(new PopVlanActionCaseBuilder().setPopVlanAction(popVlanActionBuilder.build()).build());
1131         actionList.add(ab.build());
1132
1133         // Create an Apply Action
1134         ApplyActionsBuilder aab = new ApplyActionsBuilder();
1135         aab.setAction(actionList);
1136
1137         // Wrap our Apply Action in an Instruction
1138         InstructionBuilder ib = new InstructionBuilder();
1139         ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
1140
1141         // Put our Instruction in a list of Instructions
1142         InstructionsBuilder isb = new InstructionsBuilder();
1143         List<Instruction> instructions = new ArrayList<Instruction>();
1144         instructions.add(ib.build());
1145         isb.setInstruction(instructions);
1146         return isb;
1147     }
1148
1149     private static InstructionsBuilder createAppyActionInstruction22() {
1150
1151         List<Action> actionList = new ArrayList<Action>();
1152         ActionBuilder ab = new ActionBuilder();
1153
1154         SetDlTypeActionBuilder setDlTypeActionBuilder = new SetDlTypeActionBuilder();
1155         setDlTypeActionBuilder.setDlType(new EtherType(8L));
1156         ab.setAction(new SetDlTypeActionCaseBuilder().setSetDlTypeAction(setDlTypeActionBuilder.build()).build());
1157         actionList.add(ab.build());
1158
1159         // Create an Apply Action
1160         ApplyActionsBuilder aab = new ApplyActionsBuilder();
1161         aab.setAction(actionList);
1162
1163         // Wrap our Apply Action in an Instruction
1164         InstructionBuilder ib = new InstructionBuilder();
1165         ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
1166
1167         // Put our Instruction in a list of Instructions
1168         InstructionsBuilder isb = new InstructionsBuilder();
1169         List<Instruction> instructions = new ArrayList<Instruction>();
1170         instructions.add(ib.build());
1171         isb.setInstruction(instructions);
1172         return isb;
1173     }
1174
1175     private static InstructionsBuilder createAppyActionInstruction23() {
1176
1177         List<Action> actionList = new ArrayList<Action>();
1178         ActionBuilder ab = new ActionBuilder();
1179
1180         SetFieldBuilder setFieldBuilder = new SetFieldBuilder();
1181         setFieldBuilder.setInPort(new Long(2));
1182         actionList.add(ab.build());
1183
1184         // Create an Apply Action
1185         ApplyActionsBuilder aab = new ApplyActionsBuilder();
1186         aab.setAction(actionList);
1187
1188         // Wrap our Apply Action in an Instruction
1189         InstructionBuilder ib = new InstructionBuilder();
1190         ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
1191
1192         // Put our Instruction in a list of Instructions
1193         InstructionsBuilder isb = new InstructionsBuilder();
1194         List<Instruction> instructions = new ArrayList<Instruction>();
1195         instructions.add(ib.build());
1196         isb.setInstruction(instructions);
1197         return isb;
1198     }
1199
1200     private static InstructionsBuilder createAppyActionInstruction24() {
1201
1202         List<Action> actionList = new ArrayList<Action>();
1203         ActionBuilder ab = new ActionBuilder();
1204
1205         SetMplsTtlActionBuilder setMplsTtlActionBuilder = new SetMplsTtlActionBuilder();
1206         setMplsTtlActionBuilder.setMplsTtl((short) 0X1);
1207         ab.setAction(new SetMplsTtlActionCaseBuilder().setSetMplsTtlAction(setMplsTtlActionBuilder.build()).build());
1208         actionList.add(ab.build());
1209
1210         // Create an Apply Action
1211         ApplyActionsBuilder aab = new ApplyActionsBuilder();
1212         aab.setAction(actionList);
1213
1214         // Wrap our Apply Action in an Instruction
1215         InstructionBuilder ib = new InstructionBuilder();
1216         ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
1217
1218         // Put our Instruction in a list of Instructions
1219         InstructionsBuilder isb = new InstructionsBuilder();
1220         List<Instruction> instructions = new ArrayList<Instruction>();
1221         instructions.add(ib.build());
1222         isb.setInstruction(instructions);
1223         return isb;
1224     }
1225
1226     private static InstructionsBuilder createAppyActionInstruction25() {
1227
1228         List<Action> actionList = new ArrayList<Action>();
1229         ActionBuilder ab = new ActionBuilder();
1230
1231         SetNextHopActionBuilder setNextHopActionBuilder = new SetNextHopActionBuilder();
1232         Ipv4Builder ipnext = new Ipv4Builder();
1233         Ipv4Prefix prefix = new Ipv4Prefix("10.0.0.1/24");
1234         ipnext.setIpv4Address(prefix);
1235         setNextHopActionBuilder.setAddress(ipnext.build());
1236         ab.setAction(new SetNextHopActionCaseBuilder().setSetNextHopAction(setNextHopActionBuilder.build()).build());
1237         actionList.add(ab.build());
1238
1239         // Create an Apply Action
1240         ApplyActionsBuilder aab = new ApplyActionsBuilder();
1241         aab.setAction(actionList);
1242
1243         // Wrap our Apply Action in an Instruction
1244         InstructionBuilder ib = new InstructionBuilder();
1245         ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
1246
1247         // Put our Instruction in a list of Instructions
1248         InstructionsBuilder isb = new InstructionsBuilder();
1249         List<Instruction> instructions = new ArrayList<Instruction>();
1250         instructions.add(ib.build());
1251         isb.setInstruction(instructions);
1252         return isb;
1253     }
1254
1255     private static InstructionsBuilder createAppyActionInstruction26() {
1256
1257         List<Action> actionList = new ArrayList<Action>();
1258         ActionBuilder ab = new ActionBuilder();
1259
1260         SetNwDstActionBuilder setNwDstActionBuilder = new SetNwDstActionBuilder();
1261         Ipv4Builder ipdst = new Ipv4Builder();
1262         Ipv4Prefix prefixdst = new Ipv4Prefix("10.0.0.21/24");
1263         ipdst.setIpv4Address(prefixdst);
1264         setNwDstActionBuilder.setAddress(ipdst.build());
1265         ab.setAction(new SetNwDstActionCaseBuilder().setSetNwDstAction(setNwDstActionBuilder.build()).build());
1266         actionList.add(ab.build());
1267
1268         // Create an Apply Action
1269         ApplyActionsBuilder aab = new ApplyActionsBuilder();
1270         aab.setAction(actionList);
1271
1272         // Wrap our Apply Action in an Instruction
1273         InstructionBuilder ib = new InstructionBuilder();
1274         ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
1275
1276         // Put our Instruction in a list of Instructions
1277         InstructionsBuilder isb = new InstructionsBuilder();
1278         List<Instruction> instructions = new ArrayList<Instruction>();
1279         instructions.add(ib.build());
1280         isb.setInstruction(instructions);
1281         return isb;
1282     }
1283
1284     private static InstructionsBuilder createAppyActionInstruction27() {
1285
1286         List<Action> actionList = new ArrayList<Action>();
1287         ActionBuilder ab = new ActionBuilder();
1288
1289         SetNwSrcActionBuilder setNwsrcActionBuilder = new SetNwSrcActionBuilder();
1290         Ipv4Builder ipsrc = new Ipv4Builder();
1291         Ipv4Prefix prefixsrc = new Ipv4Prefix("10.0.23.21/24");
1292         ipsrc.setIpv4Address(prefixsrc);
1293         setNwsrcActionBuilder.setAddress(ipsrc.build());
1294         ab.setAction(new SetNwSrcActionCaseBuilder().setSetNwSrcAction(setNwsrcActionBuilder.build()).build());
1295         actionList.add(ab.build());
1296
1297         // Create an Apply Action
1298         ApplyActionsBuilder aab = new ApplyActionsBuilder();
1299         aab.setAction(actionList);
1300
1301         // Wrap our Apply Action in an Instruction
1302         InstructionBuilder ib = new InstructionBuilder();
1303         ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
1304
1305         // Put our Instruction in a list of Instructions
1306         InstructionsBuilder isb = new InstructionsBuilder();
1307         List<Instruction> instructions = new ArrayList<Instruction>();
1308         instructions.add(ib.build());
1309         isb.setInstruction(instructions);
1310         return isb;
1311     }
1312
1313     private static InstructionsBuilder createAppyActionInstruction28() {
1314
1315         List<Action> actionList = new ArrayList<Action>();
1316         ActionBuilder ab = new ActionBuilder();
1317
1318         SetNwTosActionBuilder setNwTosActionBuilder = new SetNwTosActionBuilder();
1319         setNwTosActionBuilder.setTos(1);
1320         ab.setAction(new SetNwTosActionCaseBuilder().setSetNwTosAction(setNwTosActionBuilder.build()).build());
1321         actionList.add(ab.build());
1322         // Create an Apply Action
1323         ApplyActionsBuilder aab = new ApplyActionsBuilder();
1324         aab.setAction(actionList);
1325
1326         // Wrap our Apply Action in an Instruction
1327         InstructionBuilder ib = new InstructionBuilder();
1328         ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
1329
1330         // Put our Instruction in a list of Instructions
1331         InstructionsBuilder isb = new InstructionsBuilder();
1332         List<Instruction> instructions = new ArrayList<Instruction>();
1333         instructions.add(ib.build());
1334         isb.setInstruction(instructions);
1335         return isb;
1336     }
1337
1338     private static InstructionsBuilder createAppyActionInstruction29() {
1339
1340         List<Action> actionList = new ArrayList<Action>();
1341         ActionBuilder ab = new ActionBuilder();
1342
1343         SetNwTtlActionBuilder setNwTtlActionBuilder = new SetNwTtlActionBuilder();
1344         setNwTtlActionBuilder.setNwTtl((short) 1);
1345         ab.setAction(new SetNwTtlActionCaseBuilder().setSetNwTtlAction(setNwTtlActionBuilder.build()).build());
1346         actionList.add(ab.build());
1347
1348         // Create an Apply Action
1349         ApplyActionsBuilder aab = new ApplyActionsBuilder();
1350         aab.setAction(actionList);
1351
1352         // Wrap our Apply Action in an Instruction
1353         InstructionBuilder ib = new InstructionBuilder();
1354         ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
1355
1356         // Put our Instruction in a list of Instructions
1357         InstructionsBuilder isb = new InstructionsBuilder();
1358         List<Instruction> instructions = new ArrayList<Instruction>();
1359         instructions.add(ib.build());
1360         isb.setInstruction(instructions);
1361         return isb;
1362     }
1363
1364     private static InstructionsBuilder createAppyActionInstruction30() {
1365
1366         List<Action> actionList = new ArrayList<Action>();
1367         ActionBuilder ab = new ActionBuilder();
1368
1369         SetQueueActionBuilder setQueueActionBuilder = new SetQueueActionBuilder();
1370         setQueueActionBuilder.setQueueId(1L);
1371         ab.setAction(new  SetQueueActionCaseBuilder().setSetQueueAction(setQueueActionBuilder.build()).build());
1372         actionList.add(ab.build());
1373         // Create an Apply Action
1374         ApplyActionsBuilder aab = new ApplyActionsBuilder();
1375         aab.setAction(actionList);
1376
1377         // Wrap our Apply Action in an Instruction
1378         InstructionBuilder ib = new InstructionBuilder();
1379         ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
1380
1381         // Put our Instruction in a list of Instructions
1382         InstructionsBuilder isb = new InstructionsBuilder();
1383         List<Instruction> instructions = new ArrayList<Instruction>();
1384         instructions.add(ib.build());
1385         isb.setInstruction(instructions);
1386         return isb;
1387     }
1388
1389     private static InstructionsBuilder createAppyActionInstruction31() {
1390
1391         List<Action> actionList = new ArrayList<Action>();
1392         ActionBuilder ab = new ActionBuilder();
1393
1394         SetTpDstActionBuilder setTpDstActionBuilder = new SetTpDstActionBuilder();
1395         setTpDstActionBuilder.setPort(new PortNumber(109));
1396
1397         ab.setAction(new SetTpDstActionCaseBuilder().setSetTpDstAction(setTpDstActionBuilder.build()).build());
1398         actionList.add(ab.build());
1399         // Create an Apply Action
1400         ApplyActionsBuilder aab = new ApplyActionsBuilder();
1401         aab.setAction(actionList);
1402
1403         // Wrap our Apply Action in an Instruction
1404         InstructionBuilder ib = new InstructionBuilder();
1405         ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
1406
1407         // Put our Instruction in a list of Instructions
1408         InstructionsBuilder isb = new InstructionsBuilder();
1409         List<Instruction> instructions = new ArrayList<Instruction>();
1410         instructions.add(ib.build());
1411         isb.setInstruction(instructions);
1412         return isb;
1413     }
1414
1415     private static InstructionsBuilder createAppyActionInstruction32() {
1416
1417         List<Action> actionList = new ArrayList<Action>();
1418         ActionBuilder ab = new ActionBuilder();
1419
1420         SetTpSrcActionBuilder setTpSrcActionBuilder = new SetTpSrcActionBuilder();
1421         setTpSrcActionBuilder.setPort(new PortNumber(109));
1422         ab.setAction(new SetTpSrcActionCaseBuilder().setSetTpSrcAction(setTpSrcActionBuilder.build()).build());
1423         actionList.add(ab.build());
1424
1425         // Create an Apply Action
1426         ApplyActionsBuilder aab = new ApplyActionsBuilder();
1427         aab.setAction(actionList);
1428
1429         // Wrap our Apply Action in an Instruction
1430         InstructionBuilder ib = new InstructionBuilder();
1431         ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
1432
1433         // Put our Instruction in a list of Instructions
1434         InstructionsBuilder isb = new InstructionsBuilder();
1435         List<Instruction> instructions = new ArrayList<Instruction>();
1436         instructions.add(ib.build());
1437         isb.setInstruction(instructions);
1438         return isb;
1439     }
1440
1441     private static InstructionsBuilder createAppyActionInstruction33() {
1442
1443         List<Action> actionList = new ArrayList<Action>();
1444         ActionBuilder ab = new ActionBuilder();
1445
1446         SetVlanCfiActionBuilder setVlanCfiActionBuilder = new SetVlanCfiActionBuilder();
1447         setVlanCfiActionBuilder.setVlanCfi(new VlanCfi(2));
1448         ab.setAction(new SetVlanCfiActionCaseBuilder().setSetVlanCfiAction(setVlanCfiActionBuilder.build()).build());
1449         actionList.add(ab.build());
1450
1451         // Create an Apply Action
1452         ApplyActionsBuilder aab = new ApplyActionsBuilder();
1453         aab.setAction(actionList);
1454
1455         // Wrap our Apply Action in an Instruction
1456         InstructionBuilder ib = new InstructionBuilder();
1457         ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
1458
1459         // Put our Instruction in a list of Instructions
1460         InstructionsBuilder isb = new InstructionsBuilder();
1461         List<Instruction> instructions = new ArrayList<Instruction>();
1462         instructions.add(ib.build());
1463         isb.setInstruction(instructions);
1464         return isb;
1465     }
1466
1467     private static InstructionsBuilder createAppyActionInstruction34() {
1468
1469         List<Action> actionList = new ArrayList<Action>();
1470         ActionBuilder ab = new ActionBuilder();
1471
1472         SwPathActionBuilder swPathAction = new SwPathActionBuilder();
1473         ab.setAction(new SwPathActionCaseBuilder().setSwPathAction(swPathAction.build()).build());
1474         actionList.add(ab.build());
1475
1476         // Create an Apply Action
1477         ApplyActionsBuilder aab = new ApplyActionsBuilder();
1478         aab.setAction(actionList);
1479
1480         // Wrap our Apply Action in an Instruction
1481         InstructionBuilder ib = new InstructionBuilder();
1482         ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
1483
1484         // Put our Instruction in a list of Instructions
1485         InstructionsBuilder isb = new InstructionsBuilder();
1486         List<Instruction> instructions = new ArrayList<Instruction>();
1487         instructions.add(ib.build());
1488         isb.setInstruction(instructions);
1489         return isb;
1490     }
1491
1492     /**
1493      * @return
1494      */
1495     private static MatchBuilder createMatch1() {
1496         MatchBuilder match = new MatchBuilder();
1497         Ipv4MatchBuilder ipv4Match = new Ipv4MatchBuilder();
1498         Ipv4Prefix prefix = new Ipv4Prefix("10.0.0.1/24");
1499         ipv4Match.setIpv4Destination(prefix);
1500         Ipv4Match i4m = ipv4Match.build();
1501         match.setLayer3Match(i4m);
1502
1503         EthernetMatchBuilder eth = new EthernetMatchBuilder();
1504         EthernetTypeBuilder ethTypeBuilder = new EthernetTypeBuilder();
1505         ethTypeBuilder.setType(new EtherType(0x0800L));
1506         eth.setEthernetType(ethTypeBuilder.build());
1507         match.setEthernetMatch(eth.build());
1508         return match;
1509     }
1510
1511     /**
1512      * @return
1513      */
1514     private static MatchBuilder createMatch2() {
1515         MatchBuilder match = new MatchBuilder();
1516         Ipv4MatchBuilder ipv4Match = new Ipv4MatchBuilder();
1517         Ipv4Prefix prefix = new Ipv4Prefix("10.0.0.1");
1518         ipv4Match.setIpv4Source(prefix);
1519         Ipv4Match i4m = ipv4Match.build();
1520         match.setLayer3Match(i4m);
1521
1522         EthernetMatchBuilder eth = new EthernetMatchBuilder();
1523         EthernetTypeBuilder ethTypeBuilder = new EthernetTypeBuilder();
1524         ethTypeBuilder.setType(new EtherType(0x0800L));
1525         eth.setEthernetType(ethTypeBuilder.build());
1526         match.setEthernetMatch(eth.build());
1527         return match;
1528     }
1529
1530     /**
1531      * @return
1532      */
1533     private static MatchBuilder createMatch3() {
1534         MatchBuilder match = new MatchBuilder();
1535         EthernetMatchBuilder ethernetMatch = new EthernetMatchBuilder();
1536         EthernetSourceBuilder ethSourceBuilder = new EthernetSourceBuilder();
1537         ethSourceBuilder.setAddress(new MacAddress("00:00:00:00:00:01"));
1538         ethernetMatch.setEthernetSource(ethSourceBuilder.build());
1539         match.setEthernetMatch(ethernetMatch.build());
1540
1541         return match;
1542     }
1543
1544     private static MatchBuilder createInphyportMatch() {
1545         MatchBuilder match = new MatchBuilder();
1546         match.setInPort(202L);
1547         match.setInPhyPort(10122L);
1548         return match;
1549     }
1550
1551     private static MatchBuilder createEthernetMatch() {
1552         MatchBuilder match = new MatchBuilder();
1553
1554         byte[] mask1 = new byte[] { (byte) -1, (byte) -1, 0, 0, 0, 0 };
1555         byte[] mask2 = new byte[] { (byte) -1, (byte) -1, (byte) -1, 0, 0, 0 };
1556
1557         EthernetMatchBuilder ethmatch = new EthernetMatchBuilder(); // ethernettype
1558                                                                     // match
1559         EthernetTypeBuilder ethtype = new EthernetTypeBuilder();
1560         EtherType type = new EtherType(0x0800L);
1561         ethmatch.setEthernetType(ethtype.setType(type).build());
1562
1563         EthernetDestinationBuilder ethdest = new EthernetDestinationBuilder(); // ethernet
1564                                                                                // macaddress
1565                                                                                // match
1566         MacAddress macdest = new MacAddress("ff:ff:ff:ff:ff:ff");
1567         ethdest.setAddress(macdest);
1568         ethdest.setMask(mask1);
1569
1570         ethmatch.setEthernetDestination(ethdest.build());
1571
1572         EthernetSourceBuilder ethsrc = new EthernetSourceBuilder();
1573         MacAddress macsrc = new MacAddress("00:00:00:00:23:ae");
1574         ethsrc.setAddress(macsrc);
1575         ethsrc.setMask(mask2);
1576
1577         ethmatch.setEthernetSource(ethsrc.build());
1578         match.setEthernetMatch(ethmatch.build());
1579         return match;
1580
1581     }
1582
1583     /**
1584      * @return
1585      */
1586
1587     private static MatchBuilder createVlanMatch() {
1588         MatchBuilder match = new MatchBuilder();
1589         VlanMatchBuilder vlanBuilder = new VlanMatchBuilder(); // vlan match
1590         VlanIdBuilder vlanIdBuilder = new VlanIdBuilder();
1591         VlanId vlanId = new VlanId(10);
1592         VlanPcp vpcp = new VlanPcp((short) 3);
1593         vlanBuilder.setVlanPcp(vpcp);
1594         vlanBuilder.setVlanId(vlanIdBuilder.setVlanId(vlanId).build());
1595         match.setVlanMatch(vlanBuilder.build());
1596         return match;
1597     }
1598
1599     /**
1600      * @return
1601      */
1602     private static MatchBuilder createArpMatch() {
1603         MatchBuilder match = new MatchBuilder();
1604
1605         EthernetMatchBuilder ethmatch = new EthernetMatchBuilder();
1606         MacAddress macdest = new MacAddress("ff:ff:ff:ff:ff:ff");
1607         MacAddress macsrc = new MacAddress("00:00:00:00:23:ae");
1608
1609         byte[] mask = new byte[] { (byte) -1, (byte) -1, 0, 0, 0, 0 };
1610         byte[] mask2 = new byte[] { (byte) -1, (byte) -1, (byte) -1, 0, 0, 0 };
1611
1612         EthernetTypeBuilder ethtype = new EthernetTypeBuilder();
1613         EtherType type = new EtherType(0x0806L);
1614         ethmatch.setEthernetType(ethtype.setType(type).build());
1615
1616         Ipv4Prefix dstip = new Ipv4Prefix("200.71.9.52/10"); // ipv4 match
1617         Ipv4Prefix srcip = new Ipv4Prefix("100.1.1.1/8");
1618
1619         ArpMatchBuilder arpmatch = new ArpMatchBuilder(); // arp match
1620         ArpSourceHardwareAddressBuilder arpsrc = new ArpSourceHardwareAddressBuilder();
1621         arpsrc.setAddress(macsrc);
1622         arpsrc.setMask(mask);
1623         ArpTargetHardwareAddressBuilder arpdst = new ArpTargetHardwareAddressBuilder();
1624         arpdst.setAddress(macdest);
1625         arpdst.setMask(mask2);
1626         arpmatch.setArpOp(2);
1627         arpmatch.setArpSourceHardwareAddress(arpsrc.build());
1628         arpmatch.setArpTargetHardwareAddress(arpdst.build());
1629         arpmatch.setArpSourceTransportAddress(srcip);
1630         arpmatch.setArpTargetTransportAddress(dstip);
1631
1632         match.setEthernetMatch(ethmatch.build());
1633         match.setLayer3Match(arpmatch.build());
1634
1635         return match;
1636     }
1637
1638     /**
1639      * @return
1640      */
1641     private static MatchBuilder createIPMatch() {
1642         MatchBuilder match = new MatchBuilder();
1643         EthernetMatchBuilder ethmatch = new EthernetMatchBuilder();
1644         EthernetTypeBuilder ethtype = new EthernetTypeBuilder();
1645         EtherType type = new EtherType(0x0800L);
1646         ethmatch.setEthernetType(ethtype.setType(type).build());
1647         match.setEthernetMatch(ethmatch.build());
1648
1649         IpMatchBuilder ipmatch = new IpMatchBuilder(); // ipv4 version
1650         ipmatch.setIpProtocol((short) 1);
1651         Dscp dscp = new Dscp((short) 3);
1652         ipmatch.setIpDscp(dscp);
1653         ipmatch.setIpEcn((short) 2);
1654         match.setIpMatch(ipmatch.build());
1655         return match;
1656     }
1657
1658     /**
1659      * @return
1660      */
1661     private static MatchBuilder createL3IPv4Match() {
1662         MatchBuilder match = new MatchBuilder();
1663
1664         EthernetMatchBuilder eth = new EthernetMatchBuilder();
1665         EthernetTypeBuilder ethTypeBuilder = new EthernetTypeBuilder();
1666         ethTypeBuilder.setType(new EtherType(0x0800L));
1667         eth.setEthernetType(ethTypeBuilder.build());
1668         match.setEthernetMatch(eth.build());
1669
1670         Ipv4MatchBuilder ipv4Match = new Ipv4MatchBuilder();
1671         Ipv4Prefix dstip = new Ipv4Prefix("200.71.9.52/10"); // ipv4 match
1672         Ipv4Prefix srcip = new Ipv4Prefix("100.1.1.1/8");
1673         Ipv4MatchBuilder ipv4match = new Ipv4MatchBuilder();
1674         ipv4match.setIpv4Destination(dstip);
1675         ipv4match.setIpv4Source(srcip);
1676         match.setLayer3Match(ipv4match.build());
1677
1678         return match;
1679
1680     }
1681
1682     /**
1683      * @return
1684      */
1685     private static MatchBuilder createL3IPv6Match() {
1686         MatchBuilder match = new MatchBuilder();
1687
1688         EthernetMatchBuilder eth = new EthernetMatchBuilder();
1689         EthernetTypeBuilder ethTypeBuilder = new EthernetTypeBuilder();
1690         ethTypeBuilder.setType(new EtherType(0x86ddL));
1691         eth.setEthernetType(ethTypeBuilder.build());
1692         match.setEthernetMatch(eth.build());
1693
1694         Ipv6Prefix dstip6 = new Ipv6Prefix("2002::2/64");
1695         Ipv6Prefix srcip6 = new Ipv6Prefix("2001:0:0:0:0:0:0:1/56");
1696         Ipv6Address ndtarget = new Ipv6Address("2001:db8:0:1:fd97:f9f0:a810:782e");
1697         MacAddress ndsll = new MacAddress("c2:00:54:f5:00:00");
1698         MacAddress ndtll = new MacAddress("00:0c:29:0e:4c:67");
1699         Ipv6ExtHeaderBuilder nextheader = new Ipv6ExtHeaderBuilder();
1700         nextheader.setIpv6Exthdr(58);
1701         Ipv6LabelBuilder ipv6label = new Ipv6LabelBuilder();
1702         Ipv6FlowLabel label = new Ipv6FlowLabel(10028L);
1703         ipv6label.setIpv6Flabel(label);
1704
1705         Icmpv6MatchBuilder icmpv6match = new Icmpv6MatchBuilder(); // icmpv6
1706                                                                    // match
1707         icmpv6match.setIcmpv6Type((short) 135);
1708         icmpv6match.setIcmpv6Code((short) 0);
1709         match.setIcmpv6Match(icmpv6match.build());
1710
1711         Ipv6MatchBuilder ipv6match = new Ipv6MatchBuilder();
1712         // ipv6match.setIpv6Source(srcip6);
1713         // ipv6match.setIpv6Destination(dstip6);
1714         // ipv6match.setIpv6ExtHeader(nextheader.build());
1715         ipv6match.setIpv6NdSll(ndsll);
1716         ipv6match.setIpv6NdTll(ndtll);
1717         // ipv6match.setIpv6NdTarget(ndtarget);
1718         ipv6match.setIpv6Label(ipv6label.build());
1719
1720         match.setLayer3Match(ipv6match.build());
1721
1722         return match;
1723     }
1724
1725     /**
1726      * @return
1727      */
1728
1729     private static MatchBuilder createICMPv4Match() {
1730         MatchBuilder match = new MatchBuilder();
1731         EthernetMatchBuilder eth = new EthernetMatchBuilder();
1732         EthernetTypeBuilder ethTypeBuilder = new EthernetTypeBuilder();
1733         ethTypeBuilder.setType(new EtherType(0x0800L));
1734         eth.setEthernetType(ethTypeBuilder.build());
1735         match.setEthernetMatch(eth.build());
1736
1737         IpMatchBuilder ipmatch = new IpMatchBuilder(); // ipv4 version
1738         ipmatch.setIpProtocol((short) 1);
1739         match.setIpMatch(ipmatch.build());
1740
1741         Icmpv4MatchBuilder icmpv4match = new Icmpv4MatchBuilder(); // icmpv4
1742                                                                    // match
1743         icmpv4match.setIcmpv4Type((short) 8);
1744         icmpv4match.setIcmpv4Code((short) 0);
1745         match.setIcmpv4Match(icmpv4match.build());
1746         return match;
1747     }
1748
1749     /**
1750      * @return
1751      */
1752     private static MatchBuilder createICMPv6Match() {
1753
1754         MatchBuilder match = new MatchBuilder();
1755         EthernetMatchBuilder eth = new EthernetMatchBuilder();
1756         EthernetTypeBuilder ethTypeBuilder = new EthernetTypeBuilder();
1757         ethTypeBuilder.setType(new EtherType(0x86ddL));
1758         eth.setEthernetType(ethTypeBuilder.build());
1759         match.setEthernetMatch(eth.build());
1760
1761         IpMatchBuilder ipmatch = new IpMatchBuilder(); // ipv4 version
1762         ipmatch.setIpProtocol((short) 58);
1763         match.setIpMatch(ipmatch.build());
1764
1765         Icmpv6MatchBuilder icmpv6match = new Icmpv6MatchBuilder(); // icmpv6
1766                                                                    // match
1767         icmpv6match.setIcmpv6Type((short) 135);
1768         icmpv6match.setIcmpv6Code((short) 1);
1769         match.setIcmpv6Match(icmpv6match.build());
1770
1771         return match;
1772     }
1773
1774     /**
1775      * @return
1776      */
1777
1778     private static MatchBuilder createL4TCPMatch() {
1779         MatchBuilder match = new MatchBuilder();
1780
1781         EthernetMatchBuilder eth = new EthernetMatchBuilder();
1782         EthernetTypeBuilder ethTypeBuilder = new EthernetTypeBuilder();
1783         ethTypeBuilder.setType(new EtherType(0x0800L));
1784         eth.setEthernetType(ethTypeBuilder.build());
1785         match.setEthernetMatch(eth.build());
1786
1787         IpMatchBuilder ipmatch = new IpMatchBuilder(); // ipv4 version
1788         ipmatch.setIpProtocol((short) 6);
1789         match.setIpMatch(ipmatch.build());
1790
1791         PortNumber srcport = new PortNumber(1213);
1792         PortNumber dstport = new PortNumber(646);
1793         TcpMatchBuilder tcpmatch = new TcpMatchBuilder(); // tcp match
1794         tcpmatch.setTcpSourcePort(srcport);
1795         tcpmatch.setTcpDestinationPort(dstport);
1796         match.setLayer4Match(tcpmatch.build());
1797
1798         return match;
1799     }
1800
1801     /**
1802      * @return
1803      */
1804     private static MatchBuilder createL4UDPMatch() {
1805         MatchBuilder match = new MatchBuilder();
1806
1807         EthernetMatchBuilder eth = new EthernetMatchBuilder();
1808         EthernetTypeBuilder ethTypeBuilder = new EthernetTypeBuilder();
1809         ethTypeBuilder.setType(new EtherType(0x0800L));
1810         eth.setEthernetType(ethTypeBuilder.build());
1811         match.setEthernetMatch(eth.build());
1812
1813         IpMatchBuilder ipmatch = new IpMatchBuilder(); // ipv4 version
1814         ipmatch.setIpProtocol((short) 17);
1815         match.setIpMatch(ipmatch.build());
1816
1817         PortNumber srcport = new PortNumber(1325);
1818         PortNumber dstport = new PortNumber(42);
1819         UdpMatchBuilder udpmatch = new UdpMatchBuilder(); // udp match
1820         udpmatch.setUdpDestinationPort(dstport);
1821         udpmatch.setUdpSourcePort(srcport);
1822         match.setLayer4Match(udpmatch.build());
1823
1824         return match;
1825     }
1826
1827     /**
1828      * @return
1829      */
1830     private static MatchBuilder createL4SCTPMatch() {
1831         MatchBuilder match = new MatchBuilder();
1832
1833         EthernetMatchBuilder eth = new EthernetMatchBuilder();
1834         EthernetTypeBuilder ethTypeBuilder = new EthernetTypeBuilder();
1835         ethTypeBuilder.setType(new EtherType(0x0800L));
1836         eth.setEthernetType(ethTypeBuilder.build());
1837         match.setEthernetMatch(eth.build());
1838
1839         IpMatchBuilder ipmatch = new IpMatchBuilder(); // ipv4 version
1840         ipmatch.setIpProtocol((short) 132);
1841         match.setIpMatch(ipmatch.build());
1842
1843         SctpMatchBuilder sctpmatch = new SctpMatchBuilder();
1844         PortNumber srcport = new PortNumber(1435);
1845         PortNumber dstport = new PortNumber(22);
1846         sctpmatch.setSctpSourcePort(srcport);
1847         sctpmatch.setSctpDestinationPort(dstport);
1848         match.setLayer4Match(sctpmatch.build());
1849
1850         return match;
1851     }
1852
1853     /**
1854      * @return
1855      */
1856     private static MatchBuilder createMetadataMatch() {
1857         MatchBuilder match = new MatchBuilder();
1858         byte[] metamask = new byte[] { (byte) -1, (byte) -1, (byte) -1, 0, 0, 0, (byte) 1, (byte) 1 };
1859         MetadataBuilder metadata = new MetadataBuilder(); // metadata match
1860         metadata.setMetadata(BigInteger.valueOf(500L));
1861         metadata.setMetadataMask(metamask);
1862         match.setMetadata(metadata.build());
1863
1864         return match;
1865     }
1866
1867     /**
1868      * @return
1869      */
1870     private static MatchBuilder createMplsMatch() {
1871         MatchBuilder match = new MatchBuilder();
1872
1873         EthernetMatchBuilder eth = new EthernetMatchBuilder();
1874         EthernetTypeBuilder ethTypeBuilder = new EthernetTypeBuilder();
1875         ethTypeBuilder.setType(new EtherType(0x8847L));
1876         eth.setEthernetType(ethTypeBuilder.build());
1877         match.setEthernetMatch(eth.build());
1878
1879         ProtocolMatchFieldsBuilder protomatch = new ProtocolMatchFieldsBuilder(); // mpls
1880         // match
1881         protomatch.setMplsLabel((long) 36008);
1882         protomatch.setMplsTc((short) 4);
1883         protomatch.setMplsBos((short) 1);
1884         match.setProtocolMatchFields(protomatch.build());
1885
1886         return match;
1887
1888     }
1889
1890     /**
1891      * @return
1892      */
1893     private static MatchBuilder createTunnelIDMatch() {
1894         MatchBuilder match = new MatchBuilder();
1895         TunnelBuilder tunnel = new TunnelBuilder(); // tunnel id match
1896         tunnel.setTunnelId(BigInteger.valueOf(10668));
1897         byte[] mask = new byte[] { (byte) -1, (byte) -1, (byte) -1, 0, 0, 0, (byte) 1, (byte) 1 };
1898         tunnel.setTunnelMask(mask);
1899         match.setTunnel(tunnel.build());
1900
1901         return match;
1902     }
1903
1904     public void _removeMDFlow(CommandInterpreter ci) {
1905         DataModification<InstanceIdentifier<?>, DataObject> modification = dataBrokerService.beginTransaction();
1906         NodeBuilder tn = createTestNode(ci.nextArgument());
1907         FlowBuilder tf = createTestFlow(tn, ci.nextArgument());
1908         InstanceIdentifier<Flow> path1 = InstanceIdentifier.builder(Nodes.class)
1909                 .child(Node.class, tn.getKey()).augmentation(FlowCapableNode.class)
1910                 .child(Table.class, new TableKey(tf.getTableId())).child(Flow.class, tf.getKey())
1911                 .build();
1912         modification.removeOperationalData(nodeBuilderToInstanceId(tn));
1913         modification.removeOperationalData(path1);
1914         modification.removeConfigurationData(nodeBuilderToInstanceId(tn));
1915         modification.removeConfigurationData(path1);
1916         Future<RpcResult<TransactionStatus>> commitFuture = modification.commit();
1917         try {
1918             RpcResult<TransactionStatus> result = commitFuture.get();
1919             TransactionStatus status = result.getResult();
1920             ci.println("Status of Flow Data Loaded Transaction: " + status);
1921
1922         } catch (InterruptedException e) {
1923             // TODO Auto-generated catch block
1924             e.printStackTrace();
1925         } catch (ExecutionException e) {
1926             // TODO Auto-generated catch block
1927             e.printStackTrace();
1928         }
1929     }
1930
1931     public void _addMDFlow(CommandInterpreter ci) {
1932         NodeBuilder tn = createTestNode(ci.nextArgument());
1933         FlowBuilder tf = createTestFlow(tn, ci.nextArgument());
1934         writeFlow(ci, tf, tn);
1935     }
1936
1937     private void writeFlow(CommandInterpreter ci, FlowBuilder flow, NodeBuilder nodeBuilder) {
1938         DataModification<InstanceIdentifier<?>, DataObject> modification = dataBrokerService.beginTransaction();
1939         InstanceIdentifier<Flow> path1 = InstanceIdentifier.builder(Nodes.class)
1940                 .child(Node.class, nodeBuilder.getKey()).augmentation(FlowCapableNode.class)
1941                 .child(Table.class, new TableKey(flow.getTableId())).child(Flow.class, flow.getKey())
1942                 .build();
1943         modification.putOperationalData(nodeBuilderToInstanceId(nodeBuilder), nodeBuilder.build());
1944         modification.putOperationalData(path1, flow.build());
1945         modification.putConfigurationData(nodeBuilderToInstanceId(nodeBuilder), nodeBuilder.build());
1946         modification.putConfigurationData(path1, flow.build());
1947         Future<RpcResult<TransactionStatus>> commitFuture = modification.commit();
1948         try {
1949             RpcResult<TransactionStatus> result = commitFuture.get();
1950             TransactionStatus status = result.getResult();
1951             ci.println("Status of Flow Data Loaded Transaction: " + status);
1952
1953         } catch (InterruptedException e) {
1954             // TODO Auto-generated catch block
1955             e.printStackTrace();
1956         } catch (ExecutionException e) {
1957             // TODO Auto-generated catch block
1958             e.printStackTrace();
1959         }
1960     }
1961
1962     public void _modifyMDFlow(CommandInterpreter ci) {
1963         NodeBuilder tn = createTestNode(ci.nextArgument());
1964         FlowBuilder tf = createTestFlow(tn, ci.nextArgument());
1965         tf.setFlowName(updatedFlowName);
1966         writeFlow(ci, tf, tn);
1967         tf.setFlowName(originalFlowName);
1968         writeFlow(ci, tf, tn);
1969     }
1970
1971     private static NodeRef createNodeRef(String string) {
1972         NodeKey key = new NodeKey(new NodeId(string));
1973         InstanceIdentifier<Node> path = InstanceIdentifier.builder().node(Nodes.class).node(Node.class, key)
1974                 .toInstance();
1975
1976         return new NodeRef(path);
1977     }
1978
1979     @Override
1980     public String getHelp() {
1981         return "No help";
1982     }
1983 }