2e3477cef18cf17c14faa167aabb3e81f32eaf46
[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.NotificationListener;
23 import org.opendaylight.controller.sal.binding.api.NotificationService;
24 import org.opendaylight.controller.sal.binding.api.data.DataBrokerService;
25 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Dscp;
26 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv4Prefix;
27 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv6Address;
28 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv6FlowLabel;
29 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv6Prefix;
30 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.PortNumber;
31 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Uri;
32 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev100924.MacAddress;
33 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.VlanCfi;
34 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.ControllerActionCaseBuilder;
35 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.CopyTtlInCaseBuilder;
36 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.CopyTtlOutCaseBuilder;
37 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.DecMplsTtlCaseBuilder;
38 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.DecNwTtlCaseBuilder;
39 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.DropActionCaseBuilder;
40 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.FloodActionCaseBuilder;
41 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.FloodAllActionCaseBuilder;
42 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.GroupActionCaseBuilder;
43 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.HwPathActionCaseBuilder;
44 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.LoopbackActionCaseBuilder;
45 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.OutputActionCaseBuilder;
46 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.PopMplsActionCaseBuilder;
47 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.PopPbbActionCaseBuilder;
48 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.PopVlanActionCaseBuilder;
49 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.PushMplsActionCaseBuilder;
50 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.PushPbbActionCaseBuilder;
51 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.PushVlanActionCaseBuilder;
52 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetDlDstActionCaseBuilder;
53 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetDlSrcActionCaseBuilder;
54 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetDlTypeActionCaseBuilder;
55 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetMplsTtlActionCaseBuilder;
56 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetNextHopActionCaseBuilder;
57 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetNwDstActionCaseBuilder;
58 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetNwSrcActionCaseBuilder;
59 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetNwTosActionCaseBuilder;
60 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetNwTtlActionCaseBuilder;
61 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetQueueActionCaseBuilder;
62 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetTpDstActionCaseBuilder;
63 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetTpSrcActionCaseBuilder;
64 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetVlanCfiActionCaseBuilder;
65 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetVlanIdActionCaseBuilder;
66 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetFieldCaseBuilder;
67 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetVlanPcpActionCaseBuilder;
68 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.StripVlanActionCaseBuilder;
69 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SwPathActionCaseBuilder;
70 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.controller.action._case.ControllerActionBuilder;
71 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.copy.ttl.in._case.CopyTtlInBuilder;
72 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.copy.ttl.out._case.CopyTtlOutBuilder;
73 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.dec.mpls.ttl._case.DecMplsTtlBuilder;
74 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.dec.nw.ttl._case.DecNwTtl;
75 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.dec.nw.ttl._case.DecNwTtlBuilder;
76 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.drop.action._case.DropAction;
77 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.drop.action._case.DropActionBuilder;
78 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.flood.action._case.FloodActionBuilder;
79 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.flood.all.action._case.FloodAllActionBuilder;
80 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.group.action._case.GroupActionBuilder;
81 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.hw.path.action._case.HwPathActionBuilder;
82 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.loopback.action._case.LoopbackActionBuilder;
83 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.output.action._case.OutputActionBuilder;
84 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.pop.mpls.action._case.PopMplsActionBuilder;
85 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.pop.pbb.action._case.PopPbbActionBuilder;
86 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.pop.vlan.action._case.PopVlanActionBuilder;
87 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.push.mpls.action._case.PushMplsActionBuilder;
88 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.push.pbb.action._case.PushPbbActionBuilder;
89 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.push.vlan.action._case.PushVlanActionBuilder;
90 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.dl.dst.action._case.SetDlDstActionBuilder;
91 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.dl.src.action._case.SetDlSrcActionBuilder;
92 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.dl.type.action._case.SetDlTypeActionBuilder;
93 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.field._case.SetFieldBuilder;
94 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.mpls.ttl.action._case.SetMplsTtlActionBuilder;
95 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.next.hop.action._case.SetNextHopActionBuilder;
96 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.nw.dst.action._case.SetNwDstActionBuilder;
97 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.nw.src.action._case.SetNwSrcActionBuilder;
98 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.nw.tos.action._case.SetNwTosActionBuilder;
99 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.nw.ttl.action._case.SetNwTtlActionBuilder;
100 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.queue.action._case.SetQueueActionBuilder;
101 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.tp.dst.action._case.SetTpDstActionBuilder;
102 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.tp.src.action._case.SetTpSrcActionBuilder;
103 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.vlan.cfi.action._case.SetVlanCfiActionBuilder;
104 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.vlan.id.action._case.SetVlanIdActionBuilder;
105 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.vlan.pcp.action._case.SetVlanPcpActionBuilder;
106 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.strip.vlan.action._case.StripVlanActionBuilder;
107 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.sw.path.action._case.SwPathActionBuilder;
108 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action;
109 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionBuilder;
110 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionKey;
111 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.address.address.Ipv4Builder;
112 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.config.rev130819.Flows;
113 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow;
114 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.FlowBuilder;
115 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.FlowKey;
116 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode;
117 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowId;
118 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.FlowAdded;
119 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.FlowRemoved;
120 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.FlowUpdated;
121 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.NodeErrorNotification;
122 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.NodeExperimenterErrorNotification;
123 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.SalFlowListener;
124 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.SwitchFlowRemoved;
125 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.FlowModFlags;
126 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.OutputPortValues;
127 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.InstructionsBuilder;
128 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
129 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.ApplyActionsCaseBuilder;
130 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.GoToTableCaseBuilder;
131 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.MeterCaseBuilder;
132 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.WriteMetadataCaseBuilder;
133 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.apply.actions._case.ApplyActionsBuilder;
134 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.go.to.table._case.GoToTableBuilder;
135 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.meter._case.MeterBuilder;
136 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.write.metadata._case.WriteMetadataBuilder;
137 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.Instruction;
138 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.InstructionBuilder;
139 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.InstructionKey;
140 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
141 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRef;
142 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes;
143 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
144 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeBuilder;
145 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey;
146 import org.opendaylight.yang.gen.v1.urn.opendaylight.l2.types.rev130827.EtherType;
147 import org.opendaylight.yang.gen.v1.urn.opendaylight.l2.types.rev130827.VlanId;
148 import org.opendaylight.yang.gen.v1.urn.opendaylight.l2.types.rev130827.VlanPcp;
149 import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.MeterId;
150 import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.band.type.band.type.ExperimenterBuilder;
151 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.arp.match.fields.ArpSourceHardwareAddressBuilder;
152 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.arp.match.fields.ArpTargetHardwareAddressBuilder;
153 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.ethernet.match.fields.EthernetDestinationBuilder;
154 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.ethernet.match.fields.EthernetSourceBuilder;
155 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.ethernet.match.fields.EthernetTypeBuilder;
156 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.ipv6.match.fields.Ipv6ExtHeaderBuilder;
157 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.ipv6.match.fields.Ipv6LabelBuilder;
158 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.EthernetMatchBuilder;
159 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.Icmpv4MatchBuilder;
160 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.Icmpv6MatchBuilder;
161 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.IpMatchBuilder;
162 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.MetadataBuilder;
163 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.ProtocolMatchFieldsBuilder;
164 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.TunnelBuilder;
165 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.VlanMatchBuilder;
166 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.ArpMatchBuilder;
167 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.Ipv4Match;
168 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.Ipv4MatchBuilder;
169 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.Ipv6MatchBuilder;
170 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._4.match.SctpMatchBuilder;
171 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._4.match.TcpMatchBuilder;
172 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._4.match.UdpMatchBuilder;
173 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.protocol.match.fields.PbbBuilder;
174 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.vlan.match.fields.VlanIdBuilder;
175 import org.opendaylight.yangtools.concepts.Registration;
176 import org.opendaylight.yangtools.yang.binding.DataObject;
177 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
178 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier.InstanceIdentifierBuilder;
179 import org.opendaylight.yangtools.yang.common.RpcResult;
180 import org.osgi.framework.BundleContext;
181 import org.slf4j.Logger;
182 import org.slf4j.LoggerFactory;
183 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.Table;
184 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.TableKey;
185
186 public class OpenflowpluginTestCommandProvider implements CommandProvider {
187
188     private static final Logger LOG = LoggerFactory.getLogger(OpenflowpluginTestCommandProvider.class);
189
190     private DataBrokerService dataBrokerService;
191     private ProviderContext pc;
192     private final BundleContext ctx;
193     private FlowBuilder testFlow;
194     private NodeBuilder testNode;
195     private final String originalFlowName = "Foo";
196     private final String updatedFlowName = "Bar";
197     private FlowEventListener flowEventListener = new FlowEventListener();
198     private static NotificationService notificationService;
199     private Registration<org.opendaylight.yangtools.yang.binding.NotificationListener> listener1Reg;
200
201     public OpenflowpluginTestCommandProvider(BundleContext ctx) {
202         this.ctx = ctx;
203     }
204
205     public void onSessionInitiated(ProviderContext session) {
206         pc = session;
207         notificationService = session.getSALService(NotificationService.class);
208      // For switch events
209         listener1Reg = notificationService.registerNotificationListener(flowEventListener);
210         dataBrokerService = session.getSALService(DataBrokerService.class);
211         ctx.registerService(CommandProvider.class.getName(), this, null);
212         createTestFlow(createTestNode(null), null, null);
213     }
214
215     private NodeBuilder createTestNode(String nodeId) {
216         if (nodeId == null) {
217             nodeId = OpenflowpluginTestActivator.NODE_ID;
218         }
219         NodeRef nodeOne = createNodeRef(nodeId);
220         NodeBuilder builder = new NodeBuilder();
221         builder.setId(new NodeId(nodeId));
222         builder.setKey(new NodeKey(builder.getId()));
223         testNode = builder;
224         return builder;
225     }
226
227     final class FlowEventListener implements SalFlowListener {
228         
229         List<FlowAdded> addedFlows = new ArrayList<>();
230         List<FlowRemoved> removedFlows = new ArrayList<>();
231         List<FlowUpdated> updatedFlows = new ArrayList<>();
232     
233         @Override
234         public void onFlowAdded(FlowAdded notification) {
235             System.out.println("flow to be added.........................."+notification.toString());
236             System.out.println("added flow Xid........................."+notification.getTransactionId().getValue());
237             System.out.println("-----------------------------------------------------------------------------------");
238             addedFlows.add(notification);
239         }
240     
241         @Override
242         public void onFlowRemoved(FlowRemoved notification) {
243             System.out.println("removed flow.........................." + notification.toString());
244             System.out.println("remove flow Xid........................." + notification.getTransactionId().getValue());
245             System.out.println("-----------------------------------------------------------------------------------");
246             removedFlows.add(notification);
247         };
248     
249         @Override
250         public void onFlowUpdated(FlowUpdated notification) {
251             System.out.println("updated flow.........................." + notification.toString());
252             System.out.println("updated flow Xid........................." + notification.getTransactionId().getValue());
253             System.out.println("-----------------------------------------------------------------------------------");
254             updatedFlows.add(notification);
255         }
256
257         @Override
258         public void onNodeErrorNotification(NodeErrorNotification notification) {
259             System.out.println("Error notification  flow Xid........................." + notification.getTransactionId().getValue());
260             System.out.println("-----------------------------------------------------------------------------------");
261         }
262
263         @Override
264         public void onNodeExperimenterErrorNotification(NodeExperimenterErrorNotification notification) {
265             // TODO Auto-generated method stub
266             
267         }
268
269         @Override
270         public void onSwitchFlowRemoved(SwitchFlowRemoved notification) {
271             System.out.println("Switch flow removed flow..........................");
272             // TODO Auto-generated method stub
273             
274         }
275     
276     }
277     
278     private InstanceIdentifier<Node> nodeBuilderToInstanceId(NodeBuilder node) {
279         return InstanceIdentifier.builder(Nodes.class).child(Node.class, node.getKey()).toInstance();
280     }
281
282     private FlowBuilder createTestFlow(NodeBuilder nodeBuilder, String flowTypeArg, String tableId) {
283
284         FlowBuilder flow = new FlowBuilder();
285         long id = 123;
286
287         String flowType = flowTypeArg;
288         if (flowType == null) {
289             flowType = "f1";
290         }
291
292         switch (flowType) {
293         case "f1":
294             id += 1;
295             flow.setMatch(createMatch1().build());
296             flow.setInstructions(createDecNwTtlInstructions().build());
297             break;
298         case "f2":
299             id += 2;
300             flow.setMatch(createMatch2().build());
301             flow.setInstructions(createDropInstructions().build());
302             break;
303         case "f3":
304             id += 3;
305             flow.setMatch(createMatch3().build());
306             flow.setInstructions(createDropInstructions().build());
307             break;
308         case "f4":
309             id += 4;
310             flow.setMatch(createEthernetMatch().build());
311             flow.setInstructions(createDropInstructions().build());
312             break;
313         case "f5":
314             id += 5;
315             flow.setMatch(createMatch1().build());
316             flow.setInstructions(createAppyActionInstruction().build());
317             break;
318         case "f6":
319             id += 6;
320             flow.setMatch(createMatch1().build());
321             flow.setInstructions(createGotoTableInstructions().build());
322             break;
323         case "f7":
324             id += 7;
325             flow.setMatch(createMatch1().build());
326             flow.setInstructions(createMeterInstructions().build());
327             break;
328         case "f8":
329             id += 8;
330             flow.setMatch(createMatch1().build());
331             flow.setInstructions(createAppyActionInstruction1().build());
332             break;
333         case "f9":
334             id += 9;
335             flow.setMatch(createMatch1().build());
336             flow.setInstructions(createAppyActionInstruction2().build());
337             break;
338         case "f10":
339             id += 10;
340             flow.setMatch(createMatch1().build());
341             flow.setInstructions(createAppyActionInstruction3().build());
342             break;
343         case "f11":
344             id += 11;
345             flow.setMatch(createMatch1().build());
346             flow.setInstructions(createAppyActionInstruction4().build());
347             break;
348         case "f12":
349             id += 12;
350             flow.setMatch(createMatch1().build());
351             flow.setInstructions(createAppyActionInstruction5().build());
352             break;
353         case "f13":
354             id += 13;
355             flow.setMatch(createMatch1().build());
356             flow.setInstructions(createAppyActionInstruction6().build());
357             break;
358         case "f14":
359             id += 14;
360             flow.setMatch(createMatch1().build());
361             flow.setInstructions(createAppyActionInstruction7().build());
362             break;
363         case "f15":
364             id += 15;
365             flow.setMatch(createMatch1().build());
366             flow.setInstructions(createAppyActionInstruction8().build());
367             break;
368         case "f16":
369             id += 16;
370             flow.setMatch(createMatch1().build());
371             flow.setInstructions(createAppyActionInstruction9().build());
372             break;
373         case "f17":
374             id += 17;
375             flow.setMatch(createMatch1().build());
376             flow.setInstructions(createAppyActionInstruction10().build());
377             break;
378         case "f18":
379             id += 18;
380             flow.setMatch(createMatch1().build());
381             flow.setInstructions(createAppyActionInstruction11().build());
382             break;
383         case "f19":
384             id += 19;
385             flow.setMatch(createMatch1().build());
386             flow.setInstructions(createAppyActionInstruction12().build());
387             break;
388         case "f20":
389             id += 20;
390             flow.setMatch(createMatch1().build());
391             flow.setInstructions(createAppyActionInstruction13().build());
392             break;
393         case "f21":
394             id += 21;
395             flow.setMatch(createMatch1().build());
396             flow.setInstructions(createAppyActionInstruction14().build());
397             break;
398         case "f22":
399             id += 22;
400             flow.setMatch(createMatch1().build());
401             flow.setInstructions(createAppyActionInstruction15().build());
402             break;
403         case "f23":
404             id += 23;
405             flow.setMatch(createMatch1().build());
406             flow.setInstructions(createAppyActionInstruction16().build());
407             break;
408         case "f24":
409             id += 24;
410             flow.setMatch(createMatch1().build());
411             flow.setInstructions(createAppyActionInstruction17().build());
412             break;
413         case "f25":
414             id += 25;
415             flow.setMatch(createMatch1().build());
416             flow.setInstructions(createAppyActionInstruction18().build());
417             break;
418         case "f26":
419             id += 26;
420             flow.setMatch(createMatch1().build());
421             flow.setInstructions(createAppyActionInstruction19().build());
422             break;
423         case "f27":
424             id += 27;
425             flow.setMatch(createMatch1().build());
426             flow.setInstructions(createMetadataInstructions().build());
427             break;
428         case "f28":
429             id += 28;
430             flow.setMatch(createMatch1().build());
431             flow.setInstructions(createAppyActionInstruction20().build());
432             break;
433         case "f29":
434             id += 29;
435             flow.setMatch(createMatch1().build());
436             flow.setInstructions(createAppyActionInstruction21().build());
437             break;
438         case "f30":
439             id += 30;
440             flow.setMatch(createMatch1().build());
441             flow.setInstructions(createAppyActionInstruction22().build());
442             break;
443         case "f31":
444             id += 31;
445             flow.setMatch(createMatch1().build());
446             flow.setInstructions(createAppyActionInstruction23().build());
447             break;
448         case "f32":
449             id += 32;
450             flow.setMatch(createMatch1().build());
451             flow.setInstructions(createAppyActionInstruction24().build());
452             break;
453         case "f33":
454             id += 33;
455             flow.setMatch(createMatch1().build());
456             flow.setInstructions(createAppyActionInstruction25().build());
457             break;
458         case "f34":
459             id += 34;
460             flow.setMatch(createMatch1().build());
461             flow.setInstructions(createAppyActionInstruction26().build());
462             break;
463         case "f35":
464             id += 35;
465             flow.setMatch(createMatch1().build());
466             flow.setInstructions(createAppyActionInstruction27().build());
467             break;
468         case "f36":
469             id += 36;
470             flow.setMatch(createMatch1().build());
471             flow.setInstructions(createAppyActionInstruction28().build());
472             break;
473         case "f37":
474             id += 37;
475             flow.setMatch(createMatch1().build());
476             flow.setInstructions(createAppyActionInstruction29().build());
477             break;
478         case "f38":
479             id += 38;
480             flow.setMatch(createMatch1().build());
481             flow.setInstructions(createAppyActionInstruction30().build());
482             break;
483         case "f39":
484             id += 39;
485             flow.setMatch(createMatch1().build());
486             flow.setInstructions(createAppyActionInstruction31().build());
487             break;
488         case "f40":
489             id += 40;
490             flow.setMatch(createMatch1().build());
491             flow.setInstructions(createAppyActionInstruction32().build());
492             break;
493         case "f41":
494             id += 41;
495             flow.setMatch(createMatch1().build());
496             flow.setInstructions(createAppyActionInstruction33().build());
497             break;
498         case "f42":
499             id += 42;
500             flow.setMatch(createMatch1().build());
501             flow.setInstructions(createAppyActionInstruction34().build());
502             break;
503         case "f43":
504             id += 43;
505             flow.setMatch(createICMPv6Match().build());
506             flow.setInstructions(createDecNwTtlInstructions().build());
507             break;
508         case "f44":
509             id += 44;
510             flow.setMatch(createInphyportMatch().build());
511             flow.setInstructions(createDropInstructions().build());
512             break;
513         case "f45":
514             id += 45;
515             flow.setMatch(createMetadataMatch().build());
516             flow.setInstructions(createDropInstructions().build());
517             break;
518         case "f46":
519             id += 46;
520             flow.setMatch(createL3IPv6Match().build());
521             flow.setInstructions(createDecNwTtlInstructions().build());
522             break;
523         case "f47":
524             id += 47;
525             flow.setMatch(createL4SCTPMatch().build());
526             flow.setInstructions(createAppyActionInstruction().build());
527             break;
528         case "f48":
529             id += 48;
530             flow.setMatch(createTunnelIDMatch().build());
531             flow.setInstructions(createGotoTableInstructions().build());
532             break;
533         case "f49":
534             id += 49;
535             flow.setMatch(createVlanMatch().build());
536             flow.setInstructions(createMeterInstructions().build());
537             break;
538         case "f50":
539             id += 50;
540             flow.setMatch(createPbbMatch().build());
541             flow.setInstructions(createMeterInstructions().build());
542             break;
543         case "f51":
544             id += 51;
545             flow.setMatch(createVlanMatch().build());
546             flow.setInstructions(createDropInstructions().build());
547             break;
548         case "f52":
549             id += 52;
550             flow.setMatch(createL4TCPMatch().build());
551             flow.setInstructions(createDropInstructions().build());
552             break;
553
554         case "f53":
555             id += 53;
556             flow.setMatch(createL4UDPMatch().build());
557             flow.setInstructions(createDropInstructions().build());
558             break;
559         case "f54":
560             id += 54;
561             flow.setMatch(new MatchBuilder().build());
562             flow.setInstructions(createSentToControllerInstructions().build());
563             break;
564         case "f55":
565             id += 55;
566             flow.setMatch(createToSMatch().build());
567             flow.setInstructions(createDropInstructions().build());
568             break;
569         case "f56":
570             id += 56;
571             flow.setMatch(createToSMatch().build());
572             flow.setInstructions(createOutputInstructions("INPORT", 10).build());
573             break;
574         case "f57":
575             id += 57;
576             flow.setMatch(createToSMatch().build());
577             flow.setInstructions(createOutputInstructions("FLOOD", 20).build());
578             break;
579         case "f58":
580             id += 58;
581             flow.setMatch(createToSMatch().build());
582             flow.setInstructions(createOutputInstructions("ALL", 30).build());
583             break;
584         case "f59":
585             id += 59;
586             flow.setMatch(createToSMatch().build());
587             flow.setInstructions(createOutputInstructions("NORMAL", 40).build());
588             break;
589         case "f60":
590             id += 60;
591             flow.setMatch(createToSMatch().build());
592             flow.setInstructions(createOutputInstructions("LOCAL", 50).build());
593             break;
594         case "f61":
595             id += 61;
596             flow.setMatch(createToSMatch().build());
597             flow.setInstructions(createOutputInstructions("TABLE", 60).build());
598             break;
599         case "f62":
600             id += 62;
601             flow.setMatch(createToSMatch().build());
602             flow.setInstructions(createOutputInstructions("NONE", 70).build());
603             break;
604         case "f63":
605             id += 63;
606             flow.setMatch(createToSMatch().build());
607             flow.setInstructions(createStripVlanInstructions().build());
608             flow.setBarrier(Boolean.TRUE);
609             break;
610         case "f64":
611             id += 64;
612             flow.setMatch(createMatch1().build());
613             flow.setInstructions(createAppyActionInstruction35().build());
614             break;
615         case "f65":
616             id += 65;
617             flow.setMatch(createMatch1().build());
618             flow.setInstructions(createAppyActionInstruction36().build());
619             break;
620         case "f66":
621             id += 66;
622             flow.setMatch(createMatch1().build());
623             flow.setInstructions(createAppyActionInstruction37().build());
624             break;
625         case "f67":
626             id += 67;
627             flow.setMatch(createMatch1().build());
628             flow.setInstructions(createAppyActionInstruction38().build());
629             break;
630         case "f68":
631             id += 68;
632             flow.setMatch(createL4TCPMatch().build());
633             flow.setInstructions(createAppyActionInstruction39().build());
634             break;
635         case "f69":
636             id += 69;
637             flow.setMatch(createL4UDPMatch().build());
638             flow.setInstructions(createAppyActionInstruction40().build());
639             break;
640         case "f70":
641             id += 70;
642             flow.setMatch(createL4SCTPMatch().build());
643             flow.setInstructions(createAppyActionInstruction41().build());
644             break;
645         case "f71":
646             id += 71;
647             flow.setMatch(createICMPv4Match().build());
648             flow.setInstructions(createAppyActionInstruction42().build());
649             break;
650         case "f72":
651             id += 72;
652             flow.setMatch(createArpMatch().build());
653             flow.setInstructions(createAppyActionInstruction43().build());
654             break;
655         case "f73":
656             id += 73;
657             flow.setMatch(createL3IPv6Match().build());
658             flow.setInstructions(createAppyActionInstruction44().build());
659             break;
660         case "f74":
661             id += 74;
662             flow.setMatch(createICMPv6Match().build());
663             flow.setInstructions(createAppyActionInstruction45().build());
664             break;
665         case "f75":
666             id += 75;
667             flow.setMatch(createMplsMatch().build());
668             flow.setInstructions(createAppyActionInstruction46().build());
669             break;
670         case "f76":
671             id += 76;
672             flow.setMatch(createPbbMatch().build());
673             flow.setInstructions(createAppyActionInstruction47().build());
674             break;
675         case "f77":
676             id += 77;
677             flow.setMatch(createTunnelIDMatch().build());
678             flow.setInstructions(createAppyActionInstruction48().build());
679             break;
680         default:
681             LOG.warn("flow type not understood: {}", flowType);
682         }
683
684         FlowKey key = new FlowKey(new FlowId(id));
685         if (null == flow.isBarrier()) {
686             flow.setBarrier(Boolean.FALSE);
687         }
688         // flow.setBufferId(new Long(12));
689         BigInteger value = new BigInteger("10", 10);
690         BigInteger outputPort = new BigInteger("65535", 10);
691         flow.setCookie(value);
692         flow.setCookieMask(value);
693         flow.setHardTimeout(0);
694         flow.setIdleTimeout(0);
695         flow.setInstallHw(false);
696         flow.setStrict(false);
697         flow.setContainerName(null);
698         flow.setFlags(new FlowModFlags(false, false, false, false, false));
699         flow.setId(new FlowId(new Long(12)));
700         flow.setTableId(getTableId(tableId));
701         flow.setOutGroup(new Long(2));
702         // set outport to OFPP_NONE (65535) to disable remove restriction for
703         // flow
704         flow.setOutPort(outputPort);
705
706         flow.setKey(key);
707         flow.setPriority(2);
708         flow.setFlowName(originalFlowName + "X" + flowType);
709         testFlow = flow;
710         return flow;
711     }
712
713     private short getTableId(String tableId) {
714         short table = 2;
715         try {
716             table = Short.parseShort(tableId);
717         } catch (Exception ex) {
718             // ignore exception and continue with default value
719         }
720
721         return table;
722
723     }
724
725     /**
726      * @return
727      */
728     private static InstructionsBuilder createDecNwTtlInstructions() {
729         DecNwTtlBuilder ta = new DecNwTtlBuilder();
730         DecNwTtl decNwTtl = ta.build();
731         ActionBuilder ab = new ActionBuilder();
732         ab.setAction(new DecNwTtlCaseBuilder().setDecNwTtl(decNwTtl).build());
733
734         // Add our drop action to a list
735         List<Action> actionList = new ArrayList<Action>();
736         actionList.add(ab.build());
737
738         // Create an Apply Action
739         ApplyActionsBuilder aab = new ApplyActionsBuilder();
740         aab.setAction(actionList);
741
742         // Wrap our Apply Action in an Instruction
743         InstructionBuilder ib = new InstructionBuilder();
744         ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
745         ib.setKey(new InstructionKey(0));
746         ib.setOrder(0);
747
748         // Put our Instruction in a list of Instructions
749         InstructionsBuilder isb = new InstructionsBuilder();
750         List<Instruction> instructions = new ArrayList<Instruction>();
751         instructions.add(ib.build());
752         isb.setInstruction(instructions);
753         return isb;
754     }
755
756     /**
757      * @return
758      */
759     private static InstructionsBuilder createMeterInstructions() {
760
761         MeterBuilder aab = new MeterBuilder();
762         aab.setMeterId(new MeterId(new Long(1)));
763
764         InstructionBuilder ib = new InstructionBuilder();
765         ib.setInstruction(new MeterCaseBuilder().setMeter(aab.build()).build());
766
767         // Put our Instruction in a list of Instructions
768         InstructionsBuilder isb = new InstructionsBuilder();
769         List<Instruction> instructions = new ArrayList<Instruction>();
770         instructions.add(ib.build());
771         isb.setInstruction(instructions);
772         return isb;
773     }
774
775     private static InstructionsBuilder createMetadataInstructions() {
776
777         WriteMetadataBuilder aab = new WriteMetadataBuilder();
778         aab.setMetadata(new BigInteger("10", 10));
779         aab.setMetadataMask(new BigInteger("12", 10));
780
781         InstructionBuilder ib = new InstructionBuilder();
782         ib.setInstruction(new WriteMetadataCaseBuilder().setWriteMetadata(aab.build()).build());
783
784         // Put our Instruction in a list of Instructions
785         InstructionsBuilder isb = new InstructionsBuilder();
786         List<Instruction> instructions = new ArrayList<Instruction>();
787         instructions.add(ib.build());
788         isb.setInstruction(instructions);
789         return isb;
790     }
791
792     private static InstructionsBuilder createGotoTableInstructions() {
793
794         GoToTableBuilder aab = new GoToTableBuilder();
795         aab.setTableId((short) 2);
796
797         InstructionBuilder ib = new InstructionBuilder();
798         ib.setInstruction(new GoToTableCaseBuilder().setGoToTable(aab.build()).build());
799
800         // Put our Instruction in a list of Instructions
801         InstructionsBuilder isb = new InstructionsBuilder();
802         List<Instruction> instructions = new ArrayList<Instruction>();
803         instructions.add(ib.build());
804         isb.setInstruction(instructions);
805         return isb;
806     }
807
808     private static InstructionsBuilder createDropInstructions() {
809         DropActionBuilder dab = new DropActionBuilder();
810         DropAction dropAction = dab.build();
811         ActionBuilder ab = new ActionBuilder();
812         ab.setAction(new DropActionCaseBuilder().setDropAction(dropAction).build());
813
814         // Add our drop action to a list
815         List<Action> actionList = new ArrayList<Action>();
816         actionList.add(ab.build());
817
818         // Create an Apply Action
819         ApplyActionsBuilder aab = new ApplyActionsBuilder();
820         aab.setAction(actionList);
821
822         // Wrap our Apply Action in an Instruction
823         InstructionBuilder ib = new InstructionBuilder();
824         ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
825
826         // Put our Instruction in a list of Instructions
827         InstructionsBuilder isb = new InstructionsBuilder();
828         List<Instruction> instructions = new ArrayList<Instruction>();
829         instructions.add(ib.build());
830         isb.setInstruction(instructions);
831         return isb;
832     }
833
834     private static InstructionsBuilder createAppyActionInstruction() {
835
836         List<Action> actionList = new ArrayList<Action>();
837         ActionBuilder ab = new ActionBuilder();
838         ControllerActionBuilder controller = new ControllerActionBuilder();
839         controller.setMaxLength(5);
840         ab.setAction(new ControllerActionCaseBuilder().setControllerAction(controller.build()).build());
841         actionList.add(ab.build());
842         // Create an Apply Action
843         ApplyActionsBuilder aab = new ApplyActionsBuilder();
844         aab.setAction(actionList);
845
846         // Wrap our Apply Action in an Instruction
847         InstructionBuilder ib = new InstructionBuilder();
848         ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
849
850         // Put our Instruction in a list of Instructions
851         InstructionsBuilder isb = new InstructionsBuilder();
852         List<Instruction> instructions = new ArrayList<Instruction>();
853         instructions.add(ib.build());
854         isb.setInstruction(instructions);
855         return isb;
856     }
857
858     private static InstructionsBuilder createAppyActionInstruction1() {
859
860         List<Action> actionList = new ArrayList<Action>();
861         ActionBuilder ab = new ActionBuilder();
862
863         OutputActionBuilder output = new OutputActionBuilder();
864         output.setMaxLength(56);
865         Uri value = new Uri("PCEP");
866         output.setOutputNodeConnector(value);
867         ab.setAction(new OutputActionCaseBuilder().setOutputAction(output.build()).build());
868         actionList.add(ab.build());
869         // Create an Apply Action
870         ApplyActionsBuilder aab = new ApplyActionsBuilder();
871         aab.setAction(actionList);
872
873         // Wrap our Apply Action in an Instruction
874         InstructionBuilder ib = new InstructionBuilder();
875         ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
876
877         // Put our Instruction in a list of Instructions
878         InstructionsBuilder isb = new InstructionsBuilder();
879         List<Instruction> instructions = new ArrayList<Instruction>();
880         instructions.add(ib.build());
881         isb.setInstruction(instructions);
882         return isb;
883     }
884
885     private static InstructionsBuilder createSentToControllerInstructions() {
886         List<Action> actionList = new ArrayList<Action>();
887         ActionBuilder ab = new ActionBuilder();
888
889         OutputActionBuilder output = new OutputActionBuilder();
890         output.setMaxLength(56);
891         Uri value = new Uri("CONTROLLER");
892         output.setOutputNodeConnector(value);
893         ab.setAction(new OutputActionCaseBuilder().setOutputAction(output.build()).build());
894         ab.setOrder(0);
895         ab.setKey(new ActionKey(0));
896         actionList.add(ab.build());
897         // Create an Apply Action
898         ApplyActionsBuilder aab = new ApplyActionsBuilder();
899         aab.setAction(actionList);
900
901         // Wrap our Apply Action in an Instruction
902         InstructionBuilder ib = new InstructionBuilder();
903         ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
904         ib.setOrder(0);
905         ib.setKey(new InstructionKey(0));
906
907         // Put our Instruction in a list of Instructions
908         InstructionsBuilder isb = new InstructionsBuilder();
909         List<Instruction> instructions = new ArrayList<Instruction>();
910         instructions.add(ib.build());
911         isb.setInstruction(instructions);
912         return isb;
913     }
914
915     private static InstructionsBuilder createOutputInstructions(String outputType, int outputValue) {
916         List<Action> actionList = new ArrayList<Action>();
917         ActionBuilder ab = new ActionBuilder();
918
919         OutputActionBuilder output = new OutputActionBuilder();
920         output.setMaxLength(outputValue);
921         Uri value = new Uri(outputType);
922         output.setOutputNodeConnector(value);
923         ab.setAction(new OutputActionCaseBuilder().setOutputAction(output.build()).build());
924         ab.setOrder(0);
925         ab.setKey(new ActionKey(0));
926         actionList.add(ab.build());
927         // Create an Apply Action
928         ApplyActionsBuilder aab = new ApplyActionsBuilder();
929         aab.setAction(actionList);
930
931         // Wrap our Apply Action in an Instruction
932         InstructionBuilder ib = new InstructionBuilder();
933         ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
934         ib.setOrder(0);
935         ib.setKey(new InstructionKey(0));
936
937         // Put our Instruction in a list of Instructions
938         InstructionsBuilder isb = new InstructionsBuilder();
939         List<Instruction> instructions = new ArrayList<Instruction>();
940         instructions.add(ib.build());
941         isb.setInstruction(instructions);
942         return isb;
943     }
944
945     private static InstructionsBuilder createStripVlanInstructions() {
946         List<Action> actionList = new ArrayList<Action>();
947         ActionBuilder ab = new ActionBuilder();
948
949         StripVlanActionBuilder stripActionBuilder = new StripVlanActionBuilder();
950         ab.setAction(new StripVlanActionCaseBuilder().setStripVlanAction(stripActionBuilder.build()).build());
951         ab.setOrder(0);
952         ab.setKey(new ActionKey(0));
953         actionList.add(ab.build());
954         // Create an Apply Action
955         ApplyActionsBuilder aab = new ApplyActionsBuilder();
956         aab.setAction(actionList);
957
958         // Wrap our Apply Action in an Instruction
959         InstructionBuilder ib = new InstructionBuilder();
960         ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
961         ib.setOrder(0);
962         ib.setKey(new InstructionKey(0));
963
964         // Put our Instruction in a list of Instructions
965         InstructionsBuilder isb = new InstructionsBuilder();
966         List<Instruction> instructions = new ArrayList<Instruction>();
967         instructions.add(ib.build());
968         isb.setInstruction(instructions);
969         return isb;
970     }
971
972     private static InstructionsBuilder createAppyActionInstruction2() {
973
974         List<Action> actionList = new ArrayList<Action>();
975         ActionBuilder ab = new ActionBuilder();
976
977         PushMplsActionBuilder push = new PushMplsActionBuilder();
978         push.setEthernetType(new Integer(0x8847));
979         ab.setAction(new PushMplsActionCaseBuilder().setPushMplsAction(push.build()).build());
980         actionList.add(ab.build());
981         // Create an Apply Action
982         ApplyActionsBuilder aab = new ApplyActionsBuilder();
983         aab.setAction(actionList);
984
985         // Wrap our Apply Action in an Instruction
986         InstructionBuilder ib = new InstructionBuilder();
987         ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
988
989         // Put our Instruction in a list of Instructions
990         InstructionsBuilder isb = new InstructionsBuilder();
991         List<Instruction> instructions = new ArrayList<Instruction>();
992         instructions.add(ib.build());
993         isb.setInstruction(instructions);
994         return isb;
995     }
996
997     private static InstructionsBuilder createAppyActionInstruction3() {
998
999         List<Action> actionList = new ArrayList<Action>();
1000         ActionBuilder ab = new ActionBuilder();
1001
1002         PushPbbActionBuilder pbb = new PushPbbActionBuilder();
1003         pbb.setEthernetType(new Integer(0x88E7));
1004         ab.setAction(new PushPbbActionCaseBuilder().setPushPbbAction(pbb.build()).build());
1005         actionList.add(ab.build());
1006         // Create an Apply Action
1007         ApplyActionsBuilder aab = new ApplyActionsBuilder();
1008         aab.setAction(actionList);
1009
1010         // Wrap our Apply Action in an Instruction
1011         InstructionBuilder ib = new InstructionBuilder();
1012         ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
1013
1014         // Put our Instruction in a list of Instructions
1015         InstructionsBuilder isb = new InstructionsBuilder();
1016         List<Instruction> instructions = new ArrayList<Instruction>();
1017         instructions.add(ib.build());
1018         isb.setInstruction(instructions);
1019         return isb;
1020     }
1021
1022     private static InstructionsBuilder createAppyActionInstruction4() {
1023
1024         List<Action> actionList = new ArrayList<Action>();
1025         ActionBuilder ab = new ActionBuilder();
1026
1027         PushVlanActionBuilder vlan = new PushVlanActionBuilder();
1028         vlan.setEthernetType(new Integer(0x8100));
1029         ab.setAction(new PushVlanActionCaseBuilder().setPushVlanAction(vlan.build()).build());
1030         actionList.add(ab.build());
1031
1032         // Create an Apply Action
1033         ApplyActionsBuilder aab = new ApplyActionsBuilder();
1034         aab.setAction(actionList);
1035
1036         // Wrap our Apply Action in an Instruction
1037         InstructionBuilder ib = new InstructionBuilder();
1038         ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
1039
1040         // Put our Instruction in a list of Instructions
1041         InstructionsBuilder isb = new InstructionsBuilder();
1042         List<Instruction> instructions = new ArrayList<Instruction>();
1043         instructions.add(ib.build());
1044         isb.setInstruction(instructions);
1045         return isb;
1046     }
1047
1048     private static InstructionsBuilder createAppyActionInstruction5() {
1049
1050         List<Action> actionList = new ArrayList<Action>();
1051         ActionBuilder ab = new ActionBuilder();
1052
1053         SetDlDstActionBuilder setdl = new SetDlDstActionBuilder();
1054         setdl.setAddress(new MacAddress("00:05:b9:7c:81:5f"));
1055         ab.setAction(new SetDlDstActionCaseBuilder().setSetDlDstAction(setdl.build()).build());
1056         actionList.add(ab.build());
1057         // Create an Apply Action
1058         ApplyActionsBuilder aab = new ApplyActionsBuilder();
1059         aab.setAction(actionList);
1060
1061         // Wrap our Apply Action in an Instruction
1062         InstructionBuilder ib = new InstructionBuilder();
1063         ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
1064
1065         // Put our Instruction in a list of Instructions
1066         InstructionsBuilder isb = new InstructionsBuilder();
1067         List<Instruction> instructions = new ArrayList<Instruction>();
1068         instructions.add(ib.build());
1069         isb.setInstruction(instructions);
1070         return isb;
1071     }
1072
1073     private static InstructionsBuilder createAppyActionInstruction6() {
1074
1075         List<Action> actionList = new ArrayList<Action>();
1076         ActionBuilder ab = new ActionBuilder();
1077
1078         SetDlSrcActionBuilder src = new SetDlSrcActionBuilder();
1079         src.setAddress(new MacAddress("00:05:b9:7c:81:5f"));
1080         ab.setAction(new SetDlSrcActionCaseBuilder().setSetDlSrcAction(src.build()).build());
1081         actionList.add(ab.build());
1082
1083         // Create an Apply Action
1084         ApplyActionsBuilder aab = new ApplyActionsBuilder();
1085         aab.setAction(actionList);
1086
1087         // Wrap our Apply Action in an Instruction
1088         InstructionBuilder ib = new InstructionBuilder();
1089         ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
1090
1091         // Put our Instruction in a list of Instructions
1092         InstructionsBuilder isb = new InstructionsBuilder();
1093         List<Instruction> instructions = new ArrayList<Instruction>();
1094         instructions.add(ib.build());
1095         isb.setInstruction(instructions);
1096         return isb;
1097     }
1098
1099     private static InstructionsBuilder createAppyActionInstruction7() {
1100
1101         List<Action> actionList = new ArrayList<Action>();
1102         ActionBuilder ab = new ActionBuilder();
1103
1104         SetVlanIdActionBuilder vl = new SetVlanIdActionBuilder();
1105         VlanId a = new VlanId(4000);
1106         vl.setVlanId(a);
1107         ab.setAction(new SetVlanIdActionCaseBuilder().setSetVlanIdAction(vl.build()).build());
1108         actionList.add(ab.build());
1109         // Create an Apply Action
1110         ApplyActionsBuilder aab = new ApplyActionsBuilder();
1111         aab.setAction(actionList);
1112
1113         // Wrap our Apply Action in an Instruction
1114         InstructionBuilder ib = new InstructionBuilder();
1115         ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
1116
1117         // Put our Instruction in a list of Instructions
1118         InstructionsBuilder isb = new InstructionsBuilder();
1119         List<Instruction> instructions = new ArrayList<Instruction>();
1120         instructions.add(ib.build());
1121         isb.setInstruction(instructions);
1122         return isb;
1123     }
1124
1125     private static InstructionsBuilder createAppyActionInstruction8() {
1126
1127         List<Action> actionList = new ArrayList<Action>();
1128         ActionBuilder ab = new ActionBuilder();
1129
1130         SetVlanPcpActionBuilder pcp = new SetVlanPcpActionBuilder();
1131         VlanPcp pcp1 = new VlanPcp((short) 2);
1132         pcp.setVlanPcp(pcp1);
1133         ab.setAction(new SetVlanPcpActionCaseBuilder().setSetVlanPcpAction(pcp.build()).build());
1134         actionList.add(ab.build());
1135         // Create an Apply Action
1136         ApplyActionsBuilder aab = new ApplyActionsBuilder();
1137         aab.setAction(actionList);
1138
1139         // Wrap our Apply Action in an Instruction
1140         InstructionBuilder ib = new InstructionBuilder();
1141         ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
1142
1143         // Put our Instruction in a list of Instructions
1144         InstructionsBuilder isb = new InstructionsBuilder();
1145         List<Instruction> instructions = new ArrayList<Instruction>();
1146         instructions.add(ib.build());
1147         isb.setInstruction(instructions);
1148         return isb;
1149     }
1150
1151     private static InstructionsBuilder createAppyActionInstruction9() {
1152
1153         List<Action> actionList = new ArrayList<Action>();
1154         ActionBuilder ab = new ActionBuilder();
1155
1156         CopyTtlInBuilder ttlin = new CopyTtlInBuilder();
1157         ab.setAction(new CopyTtlInCaseBuilder().setCopyTtlIn(ttlin.build()).build());
1158         actionList.add(ab.build());
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 createAppyActionInstruction10() {
1176
1177         List<Action> actionList = new ArrayList<Action>();
1178         ActionBuilder ab = new ActionBuilder();
1179
1180         CopyTtlOutBuilder ttlout = new CopyTtlOutBuilder();
1181         ab.setAction(new CopyTtlOutCaseBuilder().setCopyTtlOut(ttlout.build()).build());
1182         actionList.add(ab.build());
1183         // Create an Apply Action
1184         ApplyActionsBuilder aab = new ApplyActionsBuilder();
1185         aab.setAction(actionList);
1186
1187         // Wrap our Apply Action in an Instruction
1188         InstructionBuilder ib = new InstructionBuilder();
1189         ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
1190
1191         // Put our Instruction in a list of Instructions
1192         InstructionsBuilder isb = new InstructionsBuilder();
1193         List<Instruction> instructions = new ArrayList<Instruction>();
1194         instructions.add(ib.build());
1195         isb.setInstruction(instructions);
1196         return isb;
1197     }
1198
1199     private static InstructionsBuilder createAppyActionInstruction11() {
1200
1201         List<Action> actionList = new ArrayList<Action>();
1202         ActionBuilder ab = new ActionBuilder();
1203
1204         DecMplsTtlBuilder mpls = new DecMplsTtlBuilder();
1205         ab.setAction(new DecMplsTtlCaseBuilder().setDecMplsTtl(mpls.build()).build());
1206         actionList.add(ab.build());
1207         // Create an Apply Action
1208         ApplyActionsBuilder aab = new ApplyActionsBuilder();
1209         aab.setAction(actionList);
1210
1211         // Wrap our Apply Action in an Instruction
1212         InstructionBuilder ib = new InstructionBuilder();
1213         ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
1214
1215         // Put our Instruction in a list of Instructions
1216         InstructionsBuilder isb = new InstructionsBuilder();
1217         List<Instruction> instructions = new ArrayList<Instruction>();
1218         instructions.add(ib.build());
1219         isb.setInstruction(instructions);
1220         return isb;
1221     }
1222
1223     private static InstructionsBuilder createAppyActionInstruction12() {
1224
1225         List<Action> actionList = new ArrayList<Action>();
1226         ActionBuilder ab = new ActionBuilder();
1227
1228         DecNwTtlBuilder nwttl = new DecNwTtlBuilder();
1229         ab.setAction(new DecNwTtlCaseBuilder().setDecNwTtl(nwttl.build()).build());
1230         actionList.add(ab.build());
1231
1232         // Create an Apply Action
1233         ApplyActionsBuilder aab = new ApplyActionsBuilder();
1234         aab.setAction(actionList);
1235
1236         // Wrap our Apply Action in an Instruction
1237         InstructionBuilder ib = new InstructionBuilder();
1238         ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
1239
1240         // Put our Instruction in a list of Instructions
1241         InstructionsBuilder isb = new InstructionsBuilder();
1242         List<Instruction> instructions = new ArrayList<Instruction>();
1243         instructions.add(ib.build());
1244         isb.setInstruction(instructions);
1245         return isb;
1246     }
1247
1248     private static InstructionsBuilder createAppyActionInstruction13() {
1249
1250         List<Action> actionList = new ArrayList<Action>();
1251         ActionBuilder ab = new ActionBuilder();
1252
1253         DropActionBuilder drop = new DropActionBuilder();
1254         ab.setAction(new DropActionCaseBuilder().setDropAction(drop.build()).build());
1255         actionList.add(ab.build());
1256
1257         // Create an Apply Action
1258         ApplyActionsBuilder aab = new ApplyActionsBuilder();
1259         aab.setAction(actionList);
1260
1261         // Wrap our Apply Action in an Instruction
1262         InstructionBuilder ib = new InstructionBuilder();
1263         ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
1264
1265         // Put our Instruction in a list of Instructions
1266         InstructionsBuilder isb = new InstructionsBuilder();
1267         List<Instruction> instructions = new ArrayList<Instruction>();
1268         instructions.add(ib.build());
1269         isb.setInstruction(instructions);
1270         return isb;
1271     }
1272
1273     private static InstructionsBuilder createAppyActionInstruction14() {
1274
1275         List<Action> actionList = new ArrayList<Action>();
1276         ActionBuilder ab = new ActionBuilder();
1277
1278         FloodActionBuilder fld = new FloodActionBuilder();
1279         ab.setAction(new FloodActionCaseBuilder().setFloodAction(fld.build()).build());
1280         actionList.add(ab.build());
1281         // Create an Apply Action
1282         ApplyActionsBuilder aab = new ApplyActionsBuilder();
1283         aab.setAction(actionList);
1284
1285         // Wrap our Apply Action in an Instruction
1286         InstructionBuilder ib = new InstructionBuilder();
1287         ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
1288
1289         // Put our Instruction in a list of Instructions
1290         InstructionsBuilder isb = new InstructionsBuilder();
1291         List<Instruction> instructions = new ArrayList<Instruction>();
1292         instructions.add(ib.build());
1293         isb.setInstruction(instructions);
1294         return isb;
1295     }
1296
1297     private static InstructionsBuilder createAppyActionInstruction15() {
1298
1299         List<Action> actionList = new ArrayList<Action>();
1300         ActionBuilder ab = new ActionBuilder();
1301
1302         FloodAllActionBuilder fldall = new FloodAllActionBuilder();
1303         ab.setAction(new FloodAllActionCaseBuilder().setFloodAllAction(fldall.build()).build());
1304         actionList.add(ab.build());
1305         // Create an Apply Action
1306         ApplyActionsBuilder aab = new ApplyActionsBuilder();
1307         aab.setAction(actionList);
1308
1309         // Wrap our Apply Action in an Instruction
1310         InstructionBuilder ib = new InstructionBuilder();
1311         ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
1312
1313         // Put our Instruction in a list of Instructions
1314         InstructionsBuilder isb = new InstructionsBuilder();
1315         List<Instruction> instructions = new ArrayList<Instruction>();
1316         instructions.add(ib.build());
1317         isb.setInstruction(instructions);
1318         return isb;
1319     }
1320
1321     private static InstructionsBuilder createAppyActionInstruction16() {
1322
1323         List<Action> actionList = new ArrayList<Action>();
1324         ActionBuilder ab = new ActionBuilder();
1325
1326         GroupActionBuilder groupActionB = new GroupActionBuilder();
1327         groupActionB.setGroupId(1L);
1328         groupActionB.setGroup("0");
1329         ab.setAction(new GroupActionCaseBuilder().setGroupAction(groupActionB.build()).build());
1330         actionList.add(ab.build());
1331
1332         // Create an Apply Action
1333         ApplyActionsBuilder aab = new ApplyActionsBuilder();
1334         aab.setAction(actionList);
1335
1336         // Wrap our Apply Action in an Instruction
1337         InstructionBuilder ib = new InstructionBuilder();
1338         ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
1339
1340         // Put our Instruction in a list of Instructions
1341         InstructionsBuilder isb = new InstructionsBuilder();
1342         List<Instruction> instructions = new ArrayList<Instruction>();
1343         instructions.add(ib.build());
1344         isb.setInstruction(instructions);
1345         return isb;
1346     }
1347
1348     private static InstructionsBuilder createAppyActionInstruction17() {
1349
1350         List<Action> actionList = new ArrayList<Action>();
1351         ActionBuilder ab = new ActionBuilder();
1352
1353         HwPathActionBuilder hwPathB = new HwPathActionBuilder();
1354         ab.setAction(new HwPathActionCaseBuilder().setHwPathAction(hwPathB.build()).build());
1355         actionList.add(ab.build());
1356         // Create an Apply Action
1357         ApplyActionsBuilder aab = new ApplyActionsBuilder();
1358         aab.setAction(actionList);
1359
1360         // Wrap our Apply Action in an Instruction
1361         InstructionBuilder ib = new InstructionBuilder();
1362         ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
1363
1364         // Put our Instruction in a list of Instructions
1365         InstructionsBuilder isb = new InstructionsBuilder();
1366         List<Instruction> instructions = new ArrayList<Instruction>();
1367         instructions.add(ib.build());
1368         isb.setInstruction(instructions);
1369         return isb;
1370     }
1371
1372     private static InstructionsBuilder createAppyActionInstruction18() {
1373
1374         List<Action> actionList = new ArrayList<Action>();
1375         ActionBuilder ab = new ActionBuilder();
1376
1377         LoopbackActionBuilder loopbackActionBuilder = new LoopbackActionBuilder();
1378         ab.setAction(new LoopbackActionCaseBuilder().setLoopbackAction(loopbackActionBuilder.build()).build());
1379         actionList.add(ab.build());
1380
1381         // Create an Apply Action
1382         ApplyActionsBuilder aab = new ApplyActionsBuilder();
1383         aab.setAction(actionList);
1384
1385         // Wrap our Apply Action in an Instruction
1386         InstructionBuilder ib = new InstructionBuilder();
1387         ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
1388
1389         // Put our Instruction in a list of Instructions
1390         InstructionsBuilder isb = new InstructionsBuilder();
1391         List<Instruction> instructions = new ArrayList<Instruction>();
1392         instructions.add(ib.build());
1393         isb.setInstruction(instructions);
1394         return isb;
1395     }
1396
1397     private static InstructionsBuilder createAppyActionInstruction19() {
1398
1399         List<Action> actionList = new ArrayList<Action>();
1400         ActionBuilder ab = new ActionBuilder();
1401
1402         PopMplsActionBuilder popMplsActionBuilder = new PopMplsActionBuilder();
1403         popMplsActionBuilder.setEthernetType(0XB);
1404         ab.setAction(new PopMplsActionCaseBuilder().setPopMplsAction(popMplsActionBuilder.build()).build());
1405         actionList.add(ab.build());
1406         // Create an Apply Action
1407         ApplyActionsBuilder aab = new ApplyActionsBuilder();
1408         aab.setAction(actionList);
1409
1410         // Wrap our Apply Action in an Instruction
1411         InstructionBuilder ib = new InstructionBuilder();
1412         ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
1413
1414         // Put our Instruction in a list of Instructions
1415         InstructionsBuilder isb = new InstructionsBuilder();
1416         List<Instruction> instructions = new ArrayList<Instruction>();
1417         instructions.add(ib.build());
1418         isb.setInstruction(instructions);
1419         return isb;
1420     }
1421
1422     private static InstructionsBuilder createAppyActionInstruction20() {
1423
1424         List<Action> actionList = new ArrayList<Action>();
1425         ActionBuilder ab = new ActionBuilder();
1426
1427         PopPbbActionBuilder popPbbActionBuilder = new PopPbbActionBuilder();
1428         ab.setAction(new PopPbbActionCaseBuilder().setPopPbbAction(popPbbActionBuilder.build()).build());
1429         actionList.add(ab.build());
1430         // Create an Apply Action
1431         ApplyActionsBuilder aab = new ApplyActionsBuilder();
1432         aab.setAction(actionList);
1433
1434         // Wrap our Apply Action in an Instruction
1435         InstructionBuilder ib = new InstructionBuilder();
1436         ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
1437
1438         // Put our Instruction in a list of Instructions
1439         InstructionsBuilder isb = new InstructionsBuilder();
1440         List<Instruction> instructions = new ArrayList<Instruction>();
1441         instructions.add(ib.build());
1442         isb.setInstruction(instructions);
1443         return isb;
1444     }
1445
1446     private static InstructionsBuilder createAppyActionInstruction21() {
1447
1448         List<Action> actionList = new ArrayList<Action>();
1449         ActionBuilder ab = new ActionBuilder();
1450
1451         PopVlanActionBuilder popVlanActionBuilder = new PopVlanActionBuilder();
1452         ab.setAction(new PopVlanActionCaseBuilder().setPopVlanAction(popVlanActionBuilder.build()).build());
1453         actionList.add(ab.build());
1454
1455         // Create an Apply Action
1456         ApplyActionsBuilder aab = new ApplyActionsBuilder();
1457         aab.setAction(actionList);
1458
1459         // Wrap our Apply Action in an Instruction
1460         InstructionBuilder ib = new InstructionBuilder();
1461         ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
1462
1463         // Put our Instruction in a list of Instructions
1464         InstructionsBuilder isb = new InstructionsBuilder();
1465         List<Instruction> instructions = new ArrayList<Instruction>();
1466         instructions.add(ib.build());
1467         isb.setInstruction(instructions);
1468         return isb;
1469     }
1470
1471     private static InstructionsBuilder createAppyActionInstruction22() {
1472
1473         List<Action> actionList = new ArrayList<Action>();
1474         ActionBuilder ab = new ActionBuilder();
1475
1476         SetDlTypeActionBuilder setDlTypeActionBuilder = new SetDlTypeActionBuilder();
1477         setDlTypeActionBuilder.setDlType(new EtherType(8L));
1478         ab.setAction(new SetDlTypeActionCaseBuilder().setSetDlTypeAction(setDlTypeActionBuilder.build()).build());
1479         actionList.add(ab.build());
1480
1481         // Create an Apply Action
1482         ApplyActionsBuilder aab = new ApplyActionsBuilder();
1483         aab.setAction(actionList);
1484
1485         // Wrap our Apply Action in an Instruction
1486         InstructionBuilder ib = new InstructionBuilder();
1487         ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
1488
1489         // Put our Instruction in a list of Instructions
1490         InstructionsBuilder isb = new InstructionsBuilder();
1491         List<Instruction> instructions = new ArrayList<Instruction>();
1492         instructions.add(ib.build());
1493         isb.setInstruction(instructions);
1494         return isb;
1495     }
1496
1497     private static InstructionsBuilder createAppyActionInstruction23() {
1498
1499         List<Action> actionList = new ArrayList<Action>();
1500         ActionBuilder ab = new ActionBuilder();
1501
1502         SetFieldBuilder setFieldBuilder = new SetFieldBuilder();
1503         setFieldBuilder.setInPort(new Long(2));
1504         actionList.add(ab.build());
1505
1506         // Create an Apply Action
1507         ApplyActionsBuilder aab = new ApplyActionsBuilder();
1508         aab.setAction(actionList);
1509
1510         // Wrap our Apply Action in an Instruction
1511         InstructionBuilder ib = new InstructionBuilder();
1512         ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
1513
1514         // Put our Instruction in a list of Instructions
1515         InstructionsBuilder isb = new InstructionsBuilder();
1516         List<Instruction> instructions = new ArrayList<Instruction>();
1517         instructions.add(ib.build());
1518         isb.setInstruction(instructions);
1519         return isb;
1520     }
1521
1522     private static InstructionsBuilder createAppyActionInstruction24() {
1523
1524         List<Action> actionList = new ArrayList<Action>();
1525         ActionBuilder ab = new ActionBuilder();
1526
1527         SetMplsTtlActionBuilder setMplsTtlActionBuilder = new SetMplsTtlActionBuilder();
1528         setMplsTtlActionBuilder.setMplsTtl((short) 0X1);
1529         ab.setAction(new SetMplsTtlActionCaseBuilder().setSetMplsTtlAction(setMplsTtlActionBuilder.build()).build());
1530         actionList.add(ab.build());
1531
1532         // Create an Apply Action
1533         ApplyActionsBuilder aab = new ApplyActionsBuilder();
1534         aab.setAction(actionList);
1535
1536         // Wrap our Apply Action in an Instruction
1537         InstructionBuilder ib = new InstructionBuilder();
1538         ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
1539
1540         // Put our Instruction in a list of Instructions
1541         InstructionsBuilder isb = new InstructionsBuilder();
1542         List<Instruction> instructions = new ArrayList<Instruction>();
1543         instructions.add(ib.build());
1544         isb.setInstruction(instructions);
1545         return isb;
1546     }
1547
1548     private static InstructionsBuilder createAppyActionInstruction25() {
1549
1550         List<Action> actionList = new ArrayList<Action>();
1551         ActionBuilder ab = new ActionBuilder();
1552
1553         SetNextHopActionBuilder setNextHopActionBuilder = new SetNextHopActionBuilder();
1554         Ipv4Builder ipnext = new Ipv4Builder();
1555         Ipv4Prefix prefix = new Ipv4Prefix("10.0.0.1/24");
1556         ipnext.setIpv4Address(prefix);
1557         setNextHopActionBuilder.setAddress(ipnext.build());
1558         ab.setAction(new SetNextHopActionCaseBuilder().setSetNextHopAction(setNextHopActionBuilder.build()).build());
1559         actionList.add(ab.build());
1560
1561         // Create an Apply Action
1562         ApplyActionsBuilder aab = new ApplyActionsBuilder();
1563         aab.setAction(actionList);
1564
1565         // Wrap our Apply Action in an Instruction
1566         InstructionBuilder ib = new InstructionBuilder();
1567         ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
1568
1569         // Put our Instruction in a list of Instructions
1570         InstructionsBuilder isb = new InstructionsBuilder();
1571         List<Instruction> instructions = new ArrayList<Instruction>();
1572         instructions.add(ib.build());
1573         isb.setInstruction(instructions);
1574         return isb;
1575     }
1576
1577     private static InstructionsBuilder createAppyActionInstruction26() {
1578
1579         List<Action> actionList = new ArrayList<Action>();
1580         ActionBuilder ab = new ActionBuilder();
1581
1582         SetNwDstActionBuilder setNwDstActionBuilder = new SetNwDstActionBuilder();
1583         Ipv4Builder ipdst = new Ipv4Builder();
1584         Ipv4Prefix prefixdst = new Ipv4Prefix("10.0.0.21/24");
1585         ipdst.setIpv4Address(prefixdst);
1586         setNwDstActionBuilder.setAddress(ipdst.build());
1587         ab.setAction(new SetNwDstActionCaseBuilder().setSetNwDstAction(setNwDstActionBuilder.build()).build());
1588         actionList.add(ab.build());
1589
1590         // Create an Apply Action
1591         ApplyActionsBuilder aab = new ApplyActionsBuilder();
1592         aab.setAction(actionList);
1593
1594         // Wrap our Apply Action in an Instruction
1595         InstructionBuilder ib = new InstructionBuilder();
1596         ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
1597
1598         // Put our Instruction in a list of Instructions
1599         InstructionsBuilder isb = new InstructionsBuilder();
1600         List<Instruction> instructions = new ArrayList<Instruction>();
1601         instructions.add(ib.build());
1602         isb.setInstruction(instructions);
1603         return isb;
1604     }
1605
1606     private static InstructionsBuilder createAppyActionInstruction27() {
1607
1608         List<Action> actionList = new ArrayList<Action>();
1609         ActionBuilder ab = new ActionBuilder();
1610
1611         SetNwSrcActionBuilder setNwsrcActionBuilder = new SetNwSrcActionBuilder();
1612         Ipv4Builder ipsrc = new Ipv4Builder();
1613         Ipv4Prefix prefixsrc = new Ipv4Prefix("10.0.23.21/24");
1614         ipsrc.setIpv4Address(prefixsrc);
1615         setNwsrcActionBuilder.setAddress(ipsrc.build());
1616         ab.setAction(new SetNwSrcActionCaseBuilder().setSetNwSrcAction(setNwsrcActionBuilder.build()).build());
1617         actionList.add(ab.build());
1618
1619         // Create an Apply Action
1620         ApplyActionsBuilder aab = new ApplyActionsBuilder();
1621         aab.setAction(actionList);
1622
1623         // Wrap our Apply Action in an Instruction
1624         InstructionBuilder ib = new InstructionBuilder();
1625         ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
1626
1627         // Put our Instruction in a list of Instructions
1628         InstructionsBuilder isb = new InstructionsBuilder();
1629         List<Instruction> instructions = new ArrayList<Instruction>();
1630         instructions.add(ib.build());
1631         isb.setInstruction(instructions);
1632         return isb;
1633     }
1634
1635     private static InstructionsBuilder createAppyActionInstruction28() {
1636
1637         List<Action> actionList = new ArrayList<Action>();
1638         ActionBuilder ab = new ActionBuilder();
1639
1640         SetNwTosActionBuilder setNwTosActionBuilder = new SetNwTosActionBuilder();
1641         setNwTosActionBuilder.setTos(8);
1642         ab.setAction(new SetNwTosActionCaseBuilder().setSetNwTosAction(setNwTosActionBuilder.build()).build());
1643         actionList.add(ab.build());
1644         // Create an Apply Action
1645         ApplyActionsBuilder aab = new ApplyActionsBuilder();
1646         aab.setAction(actionList);
1647
1648         // Wrap our Apply Action in an Instruction
1649         InstructionBuilder ib = new InstructionBuilder();
1650         ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
1651
1652         // Put our Instruction in a list of Instructions
1653         InstructionsBuilder isb = new InstructionsBuilder();
1654         List<Instruction> instructions = new ArrayList<Instruction>();
1655         instructions.add(ib.build());
1656         isb.setInstruction(instructions);
1657         return isb;
1658     }
1659
1660     private static InstructionsBuilder createAppyActionInstruction29() {
1661
1662         List<Action> actionList = new ArrayList<Action>();
1663         ActionBuilder ab = new ActionBuilder();
1664
1665         SetNwTtlActionBuilder setNwTtlActionBuilder = new SetNwTtlActionBuilder();
1666         setNwTtlActionBuilder.setNwTtl((short) 1);
1667         ab.setAction(new SetNwTtlActionCaseBuilder().setSetNwTtlAction(setNwTtlActionBuilder.build()).build());
1668         actionList.add(ab.build());
1669
1670         // Create an Apply Action
1671         ApplyActionsBuilder aab = new ApplyActionsBuilder();
1672         aab.setAction(actionList);
1673
1674         // Wrap our Apply Action in an Instruction
1675         InstructionBuilder ib = new InstructionBuilder();
1676         ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
1677
1678         // Put our Instruction in a list of Instructions
1679         InstructionsBuilder isb = new InstructionsBuilder();
1680         List<Instruction> instructions = new ArrayList<Instruction>();
1681         instructions.add(ib.build());
1682         isb.setInstruction(instructions);
1683         return isb;
1684     }
1685
1686     private static InstructionsBuilder createAppyActionInstruction30() {
1687
1688         List<Action> actionList = new ArrayList<Action>();
1689         ActionBuilder ab = new ActionBuilder();
1690
1691         SetQueueActionBuilder setQueueActionBuilder = new SetQueueActionBuilder();
1692         setQueueActionBuilder.setQueueId(1L);
1693         ab.setAction(new SetQueueActionCaseBuilder().setSetQueueAction(setQueueActionBuilder.build()).build());
1694         actionList.add(ab.build());
1695         // Create an Apply Action
1696         ApplyActionsBuilder aab = new ApplyActionsBuilder();
1697         aab.setAction(actionList);
1698
1699         // Wrap our Apply Action in an Instruction
1700         InstructionBuilder ib = new InstructionBuilder();
1701         ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
1702
1703         // Put our Instruction in a list of Instructions
1704         InstructionsBuilder isb = new InstructionsBuilder();
1705         List<Instruction> instructions = new ArrayList<Instruction>();
1706         instructions.add(ib.build());
1707         isb.setInstruction(instructions);
1708         return isb;
1709     }
1710
1711     private static InstructionsBuilder createAppyActionInstruction31() {
1712
1713         List<Action> actionList = new ArrayList<Action>();
1714         ActionBuilder ab = new ActionBuilder();
1715
1716         SetTpDstActionBuilder setTpDstActionBuilder = new SetTpDstActionBuilder();
1717         setTpDstActionBuilder.setPort(new PortNumber(109));
1718
1719         ab.setAction(new SetTpDstActionCaseBuilder().setSetTpDstAction(setTpDstActionBuilder.build()).build());
1720         actionList.add(ab.build());
1721         // Create an Apply Action
1722         ApplyActionsBuilder aab = new ApplyActionsBuilder();
1723         aab.setAction(actionList);
1724
1725         // Wrap our Apply Action in an Instruction
1726         InstructionBuilder ib = new InstructionBuilder();
1727         ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
1728
1729         // Put our Instruction in a list of Instructions
1730         InstructionsBuilder isb = new InstructionsBuilder();
1731         List<Instruction> instructions = new ArrayList<Instruction>();
1732         instructions.add(ib.build());
1733         isb.setInstruction(instructions);
1734         return isb;
1735     }
1736
1737     private static InstructionsBuilder createAppyActionInstruction32() {
1738
1739         List<Action> actionList = new ArrayList<Action>();
1740         ActionBuilder ab = new ActionBuilder();
1741
1742         SetTpSrcActionBuilder setTpSrcActionBuilder = new SetTpSrcActionBuilder();
1743         setTpSrcActionBuilder.setPort(new PortNumber(109));
1744         ab.setAction(new SetTpSrcActionCaseBuilder().setSetTpSrcAction(setTpSrcActionBuilder.build()).build());
1745         actionList.add(ab.build());
1746
1747         // Create an Apply Action
1748         ApplyActionsBuilder aab = new ApplyActionsBuilder();
1749         aab.setAction(actionList);
1750
1751         // Wrap our Apply Action in an Instruction
1752         InstructionBuilder ib = new InstructionBuilder();
1753         ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
1754
1755         // Put our Instruction in a list of Instructions
1756         InstructionsBuilder isb = new InstructionsBuilder();
1757         List<Instruction> instructions = new ArrayList<Instruction>();
1758         instructions.add(ib.build());
1759         isb.setInstruction(instructions);
1760         return isb;
1761     }
1762
1763     private static InstructionsBuilder createAppyActionInstruction33() {
1764
1765         List<Action> actionList = new ArrayList<Action>();
1766         ActionBuilder ab = new ActionBuilder();
1767
1768         SetVlanCfiActionBuilder setVlanCfiActionBuilder = new SetVlanCfiActionBuilder();
1769         setVlanCfiActionBuilder.setVlanCfi(new VlanCfi(2));
1770         ab.setAction(new SetVlanCfiActionCaseBuilder().setSetVlanCfiAction(setVlanCfiActionBuilder.build()).build());
1771         actionList.add(ab.build());
1772
1773         // Create an Apply Action
1774         ApplyActionsBuilder aab = new ApplyActionsBuilder();
1775         aab.setAction(actionList);
1776
1777         // Wrap our Apply Action in an Instruction
1778         InstructionBuilder ib = new InstructionBuilder();
1779         ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
1780
1781         // Put our Instruction in a list of Instructions
1782         InstructionsBuilder isb = new InstructionsBuilder();
1783         List<Instruction> instructions = new ArrayList<Instruction>();
1784         instructions.add(ib.build());
1785         isb.setInstruction(instructions);
1786         return isb;
1787     }
1788
1789     private static InstructionsBuilder createAppyActionInstruction34() {
1790
1791         List<Action> actionList = new ArrayList<Action>();
1792         ActionBuilder ab = new ActionBuilder();
1793
1794         SwPathActionBuilder swPathAction = new SwPathActionBuilder();
1795         ab.setAction(new SwPathActionCaseBuilder().setSwPathAction(swPathAction.build()).build());
1796         actionList.add(ab.build());
1797
1798         // Create an Apply Action
1799         ApplyActionsBuilder aab = new ApplyActionsBuilder();
1800         aab.setAction(actionList);
1801
1802         // Wrap our Apply Action in an Instruction
1803         InstructionBuilder ib = new InstructionBuilder();
1804         ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
1805
1806         // Put our Instruction in a list of Instructions
1807         InstructionsBuilder isb = new InstructionsBuilder();
1808         List<Instruction> instructions = new ArrayList<Instruction>();
1809         instructions.add(ib.build());
1810         isb.setInstruction(instructions);
1811         return isb;
1812     }
1813
1814     private static InstructionsBuilder createAppyActionInstruction35() {
1815
1816         List<Action> actionList = new ArrayList<Action>();
1817         ActionBuilder ab = new ActionBuilder();
1818         ActionBuilder ab1 = new ActionBuilder();
1819         ActionBuilder ab2 = new ActionBuilder();
1820
1821         SetFieldBuilder setFieldBuilder = new SetFieldBuilder();
1822         SetFieldBuilder setFieldBuilder1 = new SetFieldBuilder();
1823         SetFieldBuilder setFieldBuilder2 = new SetFieldBuilder();
1824
1825         // Ethernet
1826         EthernetMatchBuilder ethernetMatch = new EthernetMatchBuilder();
1827         EthernetSourceBuilder ethSourceBuilder = new EthernetSourceBuilder();
1828         ethSourceBuilder.setAddress(new MacAddress("00:00:00:00:00:01"));
1829         EthernetMatchBuilder ethernetMatch1 = new EthernetMatchBuilder();
1830         EthernetDestinationBuilder ethDestBuilder = new EthernetDestinationBuilder();
1831         ethDestBuilder.setAddress(new MacAddress("00:00:00:00:00:02"));
1832         EthernetMatchBuilder ethernetMatch2 = new EthernetMatchBuilder();
1833         EthernetTypeBuilder ethTypeBuilder = new EthernetTypeBuilder();
1834         ethTypeBuilder.setType(new EtherType(0x86ddL));
1835
1836         ethernetMatch.setEthernetSource(ethSourceBuilder.build());
1837         ethernetMatch1.setEthernetDestination(ethDestBuilder.build());
1838         ethernetMatch2.setEthernetType(ethTypeBuilder.build());
1839         setFieldBuilder.setEthernetMatch(ethernetMatch.build());
1840         setFieldBuilder1.setEthernetMatch(ethernetMatch1.build());
1841         setFieldBuilder2.setEthernetMatch(ethernetMatch2.build());
1842         ab.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder.build()).build());
1843         ab.setKey(new ActionKey(0));
1844         actionList.add(ab.build());
1845
1846         ab1.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder1.build()).build());
1847         ab1.setKey(new ActionKey(1));
1848         actionList.add(ab1.build());
1849
1850         ab2.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder2.build()).build());
1851         ab2.setKey(new ActionKey(2));
1852         actionList.add(ab2.build());
1853
1854         ApplyActionsBuilder aab = new ApplyActionsBuilder();
1855         aab.setAction(actionList);
1856
1857         InstructionBuilder ib = new InstructionBuilder();
1858         ib.setKey(new InstructionKey(0));
1859         ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
1860
1861         // Put our Instruction in a list of Instructions
1862         InstructionsBuilder isb = new InstructionsBuilder();
1863         List<Instruction> instructions = new ArrayList<Instruction>();
1864         instructions.add(ib.build());
1865         isb.setInstruction(instructions);
1866         return isb;
1867     }
1868
1869     private static InstructionsBuilder createAppyActionInstruction36() {
1870
1871         List<Action> actionList = new ArrayList<Action>();
1872         ActionBuilder ab = new ActionBuilder();
1873         ActionBuilder ab1 = new ActionBuilder();
1874
1875         SetFieldBuilder setFieldBuilder = new SetFieldBuilder();
1876         SetFieldBuilder setFieldBuilder1 = new SetFieldBuilder();
1877
1878         // Vlan
1879         VlanMatchBuilder vlanBuilder = new VlanMatchBuilder();
1880         VlanMatchBuilder vlanBuilder1 = new VlanMatchBuilder();
1881         VlanIdBuilder vlanIdBuilder = new VlanIdBuilder();
1882         VlanId vlanId = new VlanId(10);
1883         VlanPcp vpcp = new VlanPcp((short) 3);
1884         vlanBuilder.setVlanPcp(vpcp);
1885         vlanBuilder1.setVlanId(vlanIdBuilder.setVlanId(vlanId).setVlanIdPresent(true).build());
1886         setFieldBuilder.setVlanMatch(vlanBuilder.build());
1887         setFieldBuilder1.setVlanMatch(vlanBuilder1.build());
1888         ab.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder.build()).build());
1889         ab.setKey(new ActionKey(0));
1890         actionList.add(ab.build());
1891         ab1.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder1.build()).build());
1892         ab1.setKey(new ActionKey(1));
1893         actionList.add(ab1.build());
1894
1895         ApplyActionsBuilder aab = new ApplyActionsBuilder();
1896         aab.setAction(actionList);
1897
1898         InstructionBuilder ib = new InstructionBuilder();
1899         ib.setKey(new InstructionKey(0));
1900         ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
1901
1902         // Put our Instruction in a list of Instructions
1903         InstructionsBuilder isb = new InstructionsBuilder();
1904         List<Instruction> instructions = new ArrayList<Instruction>();
1905         instructions.add(ib.build());
1906         isb.setInstruction(instructions);
1907         return isb;
1908     }
1909
1910     private static InstructionsBuilder createAppyActionInstruction37() {
1911
1912         List<Action> actionList = new ArrayList<Action>();
1913         ActionBuilder ab = new ActionBuilder();
1914         ActionBuilder ab1 = new ActionBuilder();
1915         ActionBuilder ab2 = new ActionBuilder();
1916
1917         SetFieldBuilder setFieldBuilder = new SetFieldBuilder();
1918         SetFieldBuilder setFieldBuilder1 = new SetFieldBuilder();
1919         SetFieldBuilder setFieldBuilder2 = new SetFieldBuilder();
1920         // Ip
1921         IpMatchBuilder ipmatch = new IpMatchBuilder();
1922         IpMatchBuilder ipmatch1 = new IpMatchBuilder();
1923         IpMatchBuilder ipmatch2 = new IpMatchBuilder();
1924         Dscp dscp = new Dscp((short) 3);
1925         ipmatch.setIpDscp(dscp);
1926         ipmatch1.setIpEcn((short) 2);
1927         ipmatch2.setIpProtocol((short) 120);
1928         setFieldBuilder.setIpMatch(ipmatch.build());
1929         ab.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder.build()).build());
1930         ab.setKey(new ActionKey(0));
1931         actionList.add(ab.build());
1932
1933         setFieldBuilder1.setIpMatch(ipmatch1.build());
1934         ab1.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder1.build()).build());
1935         ab1.setKey(new ActionKey(1));
1936         actionList.add(ab1.build());
1937
1938         setFieldBuilder2.setIpMatch(ipmatch2.build());
1939         ab2.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder2.build()).build());
1940         ab2.setKey(new ActionKey(2));
1941         actionList.add(ab2.build());
1942
1943         ApplyActionsBuilder aab = new ApplyActionsBuilder();
1944         aab.setAction(actionList);
1945
1946         InstructionBuilder ib = new InstructionBuilder();
1947         ib.setKey(new InstructionKey(0));
1948         ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
1949
1950         // Put our Instruction in a list of Instructions
1951         InstructionsBuilder isb = new InstructionsBuilder();
1952         List<Instruction> instructions = new ArrayList<Instruction>();
1953         instructions.add(ib.build());
1954         isb.setInstruction(instructions);
1955         return isb;
1956     }
1957
1958     private static InstructionsBuilder createAppyActionInstruction38() {
1959
1960         List<Action> actionList = new ArrayList<Action>();
1961         ActionBuilder ab = new ActionBuilder();
1962         ActionBuilder ab1 = new ActionBuilder();
1963
1964         SetFieldBuilder setFieldBuilder = new SetFieldBuilder();
1965         SetFieldBuilder setFieldBuilder1 = new SetFieldBuilder();
1966         // IPv4
1967         Ipv4MatchBuilder ipv4Match = new Ipv4MatchBuilder();
1968         Ipv4MatchBuilder ipv4Match1 = new Ipv4MatchBuilder();
1969         Ipv4Prefix dstip = new Ipv4Prefix("200.71.9.5210");
1970         Ipv4Prefix srcip = new Ipv4Prefix("100.1.1.1");
1971         ipv4Match1.setIpv4Destination(dstip);
1972         ipv4Match.setIpv4Source(srcip);
1973         setFieldBuilder.setLayer3Match(ipv4Match.build());
1974         ab.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder.build()).build());
1975         ab.setKey(new ActionKey(0));
1976         actionList.add(ab.build());
1977
1978         setFieldBuilder1.setLayer3Match(ipv4Match1.build());
1979         ab1.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder1.build()).build());
1980         ab1.setKey(new ActionKey(1));
1981         actionList.add(ab1.build());
1982
1983         ApplyActionsBuilder aab = new ApplyActionsBuilder();
1984         aab.setAction(actionList);
1985
1986         InstructionBuilder ib = new InstructionBuilder();
1987         ib.setKey(new InstructionKey(0));
1988         ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
1989
1990         // Put our Instruction in a list of Instructions
1991         InstructionsBuilder isb = new InstructionsBuilder();
1992         List<Instruction> instructions = new ArrayList<Instruction>();
1993         instructions.add(ib.build());
1994         isb.setInstruction(instructions);
1995         return isb;
1996     }
1997
1998     private static InstructionsBuilder createAppyActionInstruction39() {
1999
2000         List<Action> actionList = new ArrayList<Action>();
2001         ActionBuilder ab = new ActionBuilder();
2002         ActionBuilder ab1 = new ActionBuilder();
2003
2004         SetFieldBuilder setFieldBuilder = new SetFieldBuilder();
2005         SetFieldBuilder setFieldBuilder1 = new SetFieldBuilder();
2006
2007         // Tcp
2008         PortNumber tcpsrcport = new PortNumber(1213);
2009         PortNumber tcpdstport = new PortNumber(646);
2010         TcpMatchBuilder tcpmatch = new TcpMatchBuilder();
2011         TcpMatchBuilder tcpmatch1 = new TcpMatchBuilder();
2012         tcpmatch.setTcpSourcePort(tcpsrcport);
2013         tcpmatch1.setTcpDestinationPort(tcpdstport);
2014         setFieldBuilder.setLayer4Match(tcpmatch.build());
2015         ab.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder.build()).build());
2016         ab.setKey(new ActionKey(0));
2017         actionList.add(ab.build());
2018
2019         setFieldBuilder1.setLayer4Match(tcpmatch1.build());
2020         ab1.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder1.build()).build());
2021         ab1.setKey(new ActionKey(1));
2022         actionList.add(ab.build());
2023
2024         ApplyActionsBuilder aab = new ApplyActionsBuilder();
2025         aab.setAction(actionList);
2026
2027         InstructionBuilder ib = new InstructionBuilder();
2028         ib.setKey(new InstructionKey(0));
2029         ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
2030
2031         // Put our Instruction in a list of Instructions
2032         InstructionsBuilder isb = new InstructionsBuilder();
2033         List<Instruction> instructions = new ArrayList<Instruction>();
2034         instructions.add(ib.build());
2035         isb.setInstruction(instructions);
2036         return isb;
2037     }
2038
2039     private static InstructionsBuilder createAppyActionInstruction40() {
2040
2041         List<Action> actionList = new ArrayList<Action>();
2042         ActionBuilder ab = new ActionBuilder();
2043         ActionBuilder ab1 = new ActionBuilder();
2044
2045         SetFieldBuilder setFieldBuilder = new SetFieldBuilder();
2046         SetFieldBuilder setFieldBuilder1 = new SetFieldBuilder();
2047
2048         // Udp
2049         PortNumber udpsrcport = new PortNumber(1325);
2050         PortNumber udpdstport = new PortNumber(42);
2051         UdpMatchBuilder udpmatch = new UdpMatchBuilder();
2052         UdpMatchBuilder udpmatch1 = new UdpMatchBuilder();
2053         udpmatch.setUdpDestinationPort(udpdstport);
2054         udpmatch1.setUdpSourcePort(udpsrcport);
2055         setFieldBuilder.setLayer4Match(udpmatch.build());
2056         ab.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder.build()).build());
2057         ab.setKey(new ActionKey(0));
2058         actionList.add(ab.build());
2059
2060         setFieldBuilder1.setLayer4Match(udpmatch1.build());
2061         ab1.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder1.build()).build());
2062         ab1.setKey(new ActionKey(1));
2063         actionList.add(ab1.build());
2064
2065         ApplyActionsBuilder aab = new ApplyActionsBuilder();
2066         aab.setAction(actionList);
2067
2068         InstructionBuilder ib = new InstructionBuilder();
2069         ib.setKey(new InstructionKey(0));
2070         ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
2071
2072         // Put our Instruction in a list of Instructions
2073         InstructionsBuilder isb = new InstructionsBuilder();
2074         List<Instruction> instructions = new ArrayList<Instruction>();
2075         instructions.add(ib.build());
2076         isb.setInstruction(instructions);
2077         return isb;
2078     }
2079
2080     private static InstructionsBuilder createAppyActionInstruction41() {
2081
2082         List<Action> actionList = new ArrayList<Action>();
2083         ActionBuilder ab = new ActionBuilder();
2084         ActionBuilder ab1 = new ActionBuilder();
2085
2086         SetFieldBuilder setFieldBuilder = new SetFieldBuilder();
2087         SetFieldBuilder setFieldBuilder1 = new SetFieldBuilder();
2088
2089         // Sctp
2090         SctpMatchBuilder sctpmatch = new SctpMatchBuilder();
2091         SctpMatchBuilder sctpmatch1 = new SctpMatchBuilder();
2092         PortNumber srcport = new PortNumber(1435);
2093         PortNumber dstport = new PortNumber(22);
2094         sctpmatch.setSctpSourcePort(srcport);
2095         sctpmatch1.setSctpDestinationPort(dstport);
2096         setFieldBuilder.setLayer4Match(sctpmatch.build());
2097         ab.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder.build()).build());
2098         ab.setKey(new ActionKey(0));
2099         actionList.add(ab.build());
2100
2101         setFieldBuilder1.setLayer4Match(sctpmatch1.build());
2102         ab1.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder1.build()).build());
2103         ab1.setKey(new ActionKey(1));
2104         actionList.add(ab1.build());
2105
2106         ApplyActionsBuilder aab = new ApplyActionsBuilder();
2107         aab.setAction(actionList);
2108
2109         InstructionBuilder ib = new InstructionBuilder();
2110         ib.setKey(new InstructionKey(0));
2111         ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
2112
2113         // Put our Instruction in a list of Instructions
2114         InstructionsBuilder isb = new InstructionsBuilder();
2115         List<Instruction> instructions = new ArrayList<Instruction>();
2116         instructions.add(ib.build());
2117         isb.setInstruction(instructions);
2118         return isb;
2119     }
2120
2121     private static InstructionsBuilder createAppyActionInstruction42() {
2122
2123         List<Action> actionList = new ArrayList<Action>();
2124         ActionBuilder ab = new ActionBuilder();
2125         ActionBuilder ab1 = new ActionBuilder();
2126         SetFieldBuilder setFieldBuilder = new SetFieldBuilder();
2127         SetFieldBuilder setFieldBuilder1 = new SetFieldBuilder();
2128
2129         // Icmpv4
2130         Icmpv4MatchBuilder icmpv4match = new Icmpv4MatchBuilder();
2131         Icmpv4MatchBuilder icmpv4match1 = new Icmpv4MatchBuilder();
2132         icmpv4match.setIcmpv4Type((short) 8);
2133         icmpv4match1.setIcmpv4Code((short) 0);
2134         setFieldBuilder.setIcmpv4Match(icmpv4match.build());
2135         ab.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder.build()).build());
2136         ab.setKey(new ActionKey(0));
2137         actionList.add(ab.build());
2138
2139         setFieldBuilder1.setIcmpv4Match(icmpv4match1.build());
2140         ab1.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder1.build()).build());
2141         ab1.setKey(new ActionKey(1));
2142         actionList.add(ab1.build());
2143
2144         ApplyActionsBuilder aab = new ApplyActionsBuilder();
2145         aab.setAction(actionList);
2146
2147         InstructionBuilder ib = new InstructionBuilder();
2148         ib.setKey(new InstructionKey(0));
2149         ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
2150
2151         // Put our Instruction in a list of Instructions
2152         InstructionsBuilder isb = new InstructionsBuilder();
2153         List<Instruction> instructions = new ArrayList<Instruction>();
2154         instructions.add(ib.build());
2155         isb.setInstruction(instructions);
2156         return isb;
2157     }
2158
2159     private static InstructionsBuilder createAppyActionInstruction43() {
2160
2161         List<Action> actionList = new ArrayList<Action>();
2162         ActionBuilder ab = new ActionBuilder();
2163         ActionBuilder ab1 = new ActionBuilder();
2164         ActionBuilder ab2 = new ActionBuilder();
2165         ActionBuilder ab3 = new ActionBuilder();
2166         ActionBuilder ab4 = new ActionBuilder();
2167
2168         SetFieldBuilder setFieldBuilder = new SetFieldBuilder();
2169         SetFieldBuilder setFieldBuilder1 = new SetFieldBuilder();
2170         SetFieldBuilder setFieldBuilder2 = new SetFieldBuilder();
2171         SetFieldBuilder setFieldBuilder3 = new SetFieldBuilder();
2172         SetFieldBuilder setFieldBuilder4 = new SetFieldBuilder();
2173
2174         // setting the values of ARP
2175         MacAddress macdest = new MacAddress("ff:ff:ff:ff:ff:ff");
2176         MacAddress macsrc = new MacAddress("00:00:00:00:23:ae");
2177         Ipv4Prefix dstiparp = new Ipv4Prefix("200.71.9.52/10");
2178         Ipv4Prefix srciparp = new Ipv4Prefix("100.1.1.1/8");
2179         // create ARP match action
2180         ArpMatchBuilder arpmatch = new ArpMatchBuilder();
2181         ArpMatchBuilder arpmatch1 = new ArpMatchBuilder();
2182         ArpMatchBuilder arpmatch2 = new ArpMatchBuilder();
2183         ArpMatchBuilder arpmatch3 = new ArpMatchBuilder();
2184         ArpMatchBuilder arpmatch4 = new ArpMatchBuilder();
2185         ArpSourceHardwareAddressBuilder arpsrc = new ArpSourceHardwareAddressBuilder();
2186         arpsrc.setAddress(macsrc);
2187         ArpTargetHardwareAddressBuilder arpdst = new ArpTargetHardwareAddressBuilder();
2188         arpdst.setAddress(macdest);
2189         arpmatch.setArpOp(2);
2190         arpmatch1.setArpSourceHardwareAddress(arpsrc.build());
2191         arpmatch2.setArpTargetHardwareAddress(arpdst.build());
2192         arpmatch3.setArpSourceTransportAddress(srciparp);
2193         arpmatch4.setArpTargetTransportAddress(dstiparp);
2194         setFieldBuilder.setLayer3Match(arpmatch.build());
2195         ab.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder.build()).build());
2196         ab.setKey(new ActionKey(0));
2197         actionList.add(ab.build());
2198
2199         setFieldBuilder1.setLayer3Match(arpmatch1.build());
2200         ab1.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder1.build()).build());
2201         ab1.setKey(new ActionKey(1));
2202         actionList.add(ab1.build());
2203
2204         setFieldBuilder2.setLayer3Match(arpmatch2.build());
2205         ab2.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder2.build()).build());
2206         ab2.setKey(new ActionKey(2));
2207         actionList.add(ab2.build());
2208
2209         setFieldBuilder3.setLayer3Match(arpmatch3.build());
2210         ab3.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder3.build()).build());
2211         ab3.setKey(new ActionKey(3));
2212         actionList.add(ab3.build());
2213
2214         setFieldBuilder4.setLayer3Match(arpmatch4.build());
2215         ab4.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder4.build()).build());
2216         ab4.setKey(new ActionKey(4));
2217         actionList.add(ab4.build());
2218
2219         ApplyActionsBuilder aab = new ApplyActionsBuilder();
2220         aab.setAction(actionList);
2221
2222         InstructionBuilder ib = new InstructionBuilder();
2223         ib.setKey(new InstructionKey(0));
2224         ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
2225
2226         // Put our Instruction in a list of Instructions
2227         InstructionsBuilder isb = new InstructionsBuilder();
2228         List<Instruction> instructions = new ArrayList<Instruction>();
2229         instructions.add(ib.build());
2230         isb.setInstruction(instructions);
2231         return isb;
2232     }
2233
2234     private static InstructionsBuilder createAppyActionInstruction44() {
2235
2236         List<Action> actionList = new ArrayList<Action>();
2237         ActionBuilder ab = new ActionBuilder();
2238         SetFieldBuilder setFieldBuilder = new SetFieldBuilder();
2239         ActionBuilder ab1 = new ActionBuilder();
2240         SetFieldBuilder setFieldBuilder1 = new SetFieldBuilder();
2241
2242         // IPv6
2243         Ipv6MatchBuilder ipv6Builder = new Ipv6MatchBuilder();
2244         Ipv6MatchBuilder ipv6Builder1 = new Ipv6MatchBuilder();
2245         Ipv6Prefix dstip6 = new Ipv6Prefix("2002::2");
2246         Ipv6Prefix srcip6 = new Ipv6Prefix("2001:0:0:0:0:0:0:1");
2247         ipv6Builder1.setIpv6Destination(dstip6);
2248         ipv6Builder.setIpv6Source(srcip6);
2249         setFieldBuilder.setLayer3Match(ipv6Builder.build());
2250         ab.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder.build()).build());
2251         ab.setKey(new ActionKey(0));
2252         actionList.add(ab.build());
2253
2254         setFieldBuilder1.setLayer3Match(ipv6Builder1.build());
2255         ab1.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder1.build()).build());
2256         ab1.setKey(new ActionKey(1));
2257         actionList.add(ab1.build());
2258
2259         ApplyActionsBuilder aab = new ApplyActionsBuilder();
2260         aab.setAction(actionList);
2261
2262         InstructionBuilder ib = new InstructionBuilder();
2263         ib.setKey(new InstructionKey(0));
2264         ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
2265
2266         // Put our Instruction in a list of Instructions
2267         InstructionsBuilder isb = new InstructionsBuilder();
2268         List<Instruction> instructions = new ArrayList<Instruction>();
2269         instructions.add(ib.build());
2270         isb.setInstruction(instructions);
2271         return isb;
2272     }
2273
2274     private static InstructionsBuilder createAppyActionInstruction45() {
2275
2276         List<Action> actionList = new ArrayList<Action>();
2277         ActionBuilder ab = new ActionBuilder();
2278         SetFieldBuilder setFieldBuilder = new SetFieldBuilder();
2279         ActionBuilder ab1 = new ActionBuilder();
2280         SetFieldBuilder setFieldBuilder1 = new SetFieldBuilder();
2281
2282         // Icmpv6
2283         Icmpv6MatchBuilder icmpv6match = new Icmpv6MatchBuilder();
2284         Icmpv6MatchBuilder icmpv6match1 = new Icmpv6MatchBuilder();
2285         icmpv6match.setIcmpv6Type((short) 135);
2286         icmpv6match1.setIcmpv6Code((short) 0);
2287         setFieldBuilder.setIcmpv6Match(icmpv6match.build());
2288         ab.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder.build()).build());
2289         ab.setKey(new ActionKey(0));
2290         actionList.add(ab.build());
2291
2292         setFieldBuilder1.setIcmpv6Match(icmpv6match1.build());
2293         ab1.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder1.build()).build());
2294         ab1.setKey(new ActionKey(1));
2295         actionList.add(ab1.build());
2296
2297         ApplyActionsBuilder aab = new ApplyActionsBuilder();
2298         aab.setAction(actionList);
2299
2300         InstructionBuilder ib = new InstructionBuilder();
2301         ib.setKey(new InstructionKey(0));
2302         ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
2303
2304         // Put our Instruction in a list of Instructions
2305         InstructionsBuilder isb = new InstructionsBuilder();
2306         List<Instruction> instructions = new ArrayList<Instruction>();
2307         instructions.add(ib.build());
2308         isb.setInstruction(instructions);
2309         return isb;
2310     }
2311
2312     private static InstructionsBuilder createAppyActionInstruction46() {
2313
2314         List<Action> actionList = new ArrayList<Action>();
2315         ActionBuilder ab = new ActionBuilder();
2316         SetFieldBuilder setFieldBuilder = new SetFieldBuilder();
2317         ActionBuilder ab1 = new ActionBuilder();
2318         SetFieldBuilder setFieldBuilder1 = new SetFieldBuilder();
2319         ActionBuilder ab2 = new ActionBuilder();
2320         SetFieldBuilder setFieldBuilder2 = new SetFieldBuilder();
2321
2322         // MPLS
2323         ProtocolMatchFieldsBuilder protomatch = new ProtocolMatchFieldsBuilder();
2324         ProtocolMatchFieldsBuilder protomatch1 = new ProtocolMatchFieldsBuilder();
2325         ProtocolMatchFieldsBuilder protomatch2 = new ProtocolMatchFieldsBuilder();
2326         protomatch.setMplsLabel((long) 36008);
2327         protomatch1.setMplsTc((short) 4);
2328         protomatch2.setMplsBos((short) 1);
2329         setFieldBuilder.setProtocolMatchFields(protomatch.build());
2330         ab.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder.build()).build());
2331         ab.setKey(new ActionKey(0));
2332         actionList.add(ab.build());
2333
2334         setFieldBuilder1.setProtocolMatchFields(protomatch1.build());
2335         ab1.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder1.build()).build());
2336         ab1.setKey(new ActionKey(1));
2337         actionList.add(ab1.build());
2338
2339         setFieldBuilder2.setProtocolMatchFields(protomatch2.build());
2340         ab2.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder2.build()).build());
2341         ab2.setKey(new ActionKey(2));
2342         actionList.add(ab2.build());
2343
2344         ApplyActionsBuilder aab = new ApplyActionsBuilder();
2345         aab.setAction(actionList);
2346
2347         InstructionBuilder ib = new InstructionBuilder();
2348         ib.setKey(new InstructionKey(0));
2349         ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
2350
2351         // Put our Instruction in a list of Instructions
2352         InstructionsBuilder isb = new InstructionsBuilder();
2353         List<Instruction> instructions = new ArrayList<Instruction>();
2354         instructions.add(ib.build());
2355         isb.setInstruction(instructions);
2356         return isb;
2357     }
2358
2359     private static InstructionsBuilder createAppyActionInstruction47() {
2360
2361         List<Action> actionList = new ArrayList<Action>();
2362         ActionBuilder ab = new ActionBuilder();
2363         SetFieldBuilder setFieldBuilder = new SetFieldBuilder();
2364         // PBB
2365         ProtocolMatchFieldsBuilder protomatch = new ProtocolMatchFieldsBuilder();
2366         protomatch.setPbb(new PbbBuilder().setPbbIsid(4L).setPbbMask(new byte[] { 0, 1, 0, 0 }).build());
2367         setFieldBuilder.setProtocolMatchFields(protomatch.build());
2368         ab.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder.build()).build());
2369         actionList.add(ab.build());
2370
2371         ApplyActionsBuilder aab = new ApplyActionsBuilder();
2372         aab.setAction(actionList);
2373
2374         InstructionBuilder ib = new InstructionBuilder();
2375         ib.setKey(new InstructionKey(0));
2376         ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
2377
2378         // Put our Instruction in a list of Instructions
2379         InstructionsBuilder isb = new InstructionsBuilder();
2380         List<Instruction> instructions = new ArrayList<Instruction>();
2381         instructions.add(ib.build());
2382         isb.setInstruction(instructions);
2383         return isb;
2384     }
2385
2386     private static InstructionsBuilder createAppyActionInstruction48() {
2387
2388         List<Action> actionList = new ArrayList<Action>();
2389         ActionBuilder ab = new ActionBuilder();
2390         SetFieldBuilder setFieldBuilder = new SetFieldBuilder();
2391         // Tunnel
2392         TunnelBuilder tunnel = new TunnelBuilder();
2393         tunnel.setTunnelId(BigInteger.valueOf(10668));
2394         setFieldBuilder.setTunnel(tunnel.build());
2395         ab.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder.build()).build());
2396         actionList.add(ab.build());
2397
2398         ApplyActionsBuilder aab = new ApplyActionsBuilder();
2399         aab.setAction(actionList);
2400
2401         InstructionBuilder ib = new InstructionBuilder();
2402         ib.setKey(new InstructionKey(0));
2403         ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
2404
2405         // Put our Instruction in a list of Instructions
2406         InstructionsBuilder isb = new InstructionsBuilder();
2407         List<Instruction> instructions = new ArrayList<Instruction>();
2408         instructions.add(ib.build());
2409         isb.setInstruction(instructions);
2410         return isb;
2411     }
2412
2413     /**
2414      * @return
2415      */
2416     private static MatchBuilder createMatch1() {
2417         MatchBuilder match = new MatchBuilder();
2418         Ipv4MatchBuilder ipv4Match = new Ipv4MatchBuilder();
2419         Ipv4Prefix prefix = new Ipv4Prefix("10.0.0.1/24");
2420         ipv4Match.setIpv4Destination(prefix);
2421         Ipv4Match i4m = ipv4Match.build();
2422         match.setLayer3Match(i4m);
2423
2424         EthernetMatchBuilder eth = new EthernetMatchBuilder();
2425         EthernetTypeBuilder ethTypeBuilder = new EthernetTypeBuilder();
2426         ethTypeBuilder.setType(new EtherType(0x0800L));
2427         eth.setEthernetType(ethTypeBuilder.build());
2428         match.setEthernetMatch(eth.build());
2429         return match;
2430     }
2431
2432     /**
2433      * @return
2434      */
2435     private static MatchBuilder createIPv4DstMatch() {
2436         MatchBuilder match = new MatchBuilder();
2437         Ipv4MatchBuilder ipv4Match = new Ipv4MatchBuilder();
2438         Ipv4Prefix prefix = new Ipv4Prefix("10.0.0.1/24");
2439         ipv4Match.setIpv4Destination(prefix);
2440         Ipv4Match i4m = ipv4Match.build();
2441         match.setLayer3Match(i4m);
2442
2443         return match;
2444     }
2445
2446     /**
2447      * @return
2448      */
2449     private static MatchBuilder createIPv4SrcMatch() {
2450         MatchBuilder match = new MatchBuilder();
2451         Ipv4MatchBuilder ipv4Match = new Ipv4MatchBuilder();
2452         Ipv4Prefix prefix = new Ipv4Prefix("10.20.30.40/24");
2453         ipv4Match.setIpv4Source(prefix);
2454         Ipv4Match i4m = ipv4Match.build();
2455         match.setLayer3Match(i4m);
2456
2457         EthernetMatchBuilder eth = new EthernetMatchBuilder();
2458         EthernetTypeBuilder ethTypeBuilder = new EthernetTypeBuilder();
2459         ethTypeBuilder.setType(new EtherType(0x0800L));
2460         eth.setEthernetType(ethTypeBuilder.build());
2461         match.setEthernetMatch(eth.build());
2462         return match;
2463     }
2464
2465     /**
2466      * @return
2467      */
2468     private static MatchBuilder createMatch2() {
2469         MatchBuilder match = new MatchBuilder();
2470         Ipv4MatchBuilder ipv4Match = new Ipv4MatchBuilder();
2471         Ipv4Prefix prefix = new Ipv4Prefix("10.0.0.1");
2472         ipv4Match.setIpv4Source(prefix);
2473         Ipv4Match i4m = ipv4Match.build();
2474         match.setLayer3Match(i4m);
2475
2476         EthernetMatchBuilder eth = new EthernetMatchBuilder();
2477         EthernetTypeBuilder ethTypeBuilder = new EthernetTypeBuilder();
2478         ethTypeBuilder.setType(new EtherType(0x0800L));
2479         eth.setEthernetType(ethTypeBuilder.build());
2480         match.setEthernetMatch(eth.build());
2481         return match;
2482     }
2483
2484     /**
2485      * @return
2486      */
2487     private static MatchBuilder createMatch3() {
2488         MatchBuilder match = new MatchBuilder();
2489         EthernetMatchBuilder ethernetMatch = new EthernetMatchBuilder();
2490         EthernetSourceBuilder ethSourceBuilder = new EthernetSourceBuilder();
2491         ethSourceBuilder.setAddress(new MacAddress("00:00:00:00:00:01"));
2492         ethernetMatch.setEthernetSource(ethSourceBuilder.build());
2493         match.setEthernetMatch(ethernetMatch.build());
2494
2495         return match;
2496     }
2497
2498     private static MatchBuilder createInphyportMatch() {
2499         MatchBuilder match = new MatchBuilder();
2500         match.setInPort(202L);
2501         match.setInPhyPort(10122L);
2502         return match;
2503     }
2504
2505     private static MatchBuilder createEthernetMatch() {
2506         MatchBuilder match = new MatchBuilder();
2507
2508         byte[] mask1 = new byte[] { (byte) -1, (byte) -1, 0, 0, 0, 0 };
2509         byte[] mask2 = new byte[] { (byte) -1, (byte) -1, (byte) -1, 0, 0, 0 };
2510
2511         EthernetMatchBuilder ethmatch = new EthernetMatchBuilder(); // ethernettype
2512                                                                     // match
2513         EthernetTypeBuilder ethtype = new EthernetTypeBuilder();
2514         EtherType type = new EtherType(0x0800L);
2515         ethmatch.setEthernetType(ethtype.setType(type).build());
2516
2517         EthernetDestinationBuilder ethdest = new EthernetDestinationBuilder(); // ethernet
2518                                                                                // macaddress
2519                                                                                // match
2520         MacAddress macdest = new MacAddress("ff:ff:ff:ff:ff:ff");
2521         ethdest.setAddress(macdest);
2522         ethdest.setMask(mask1);
2523
2524         ethmatch.setEthernetDestination(ethdest.build());
2525
2526         EthernetSourceBuilder ethsrc = new EthernetSourceBuilder();
2527         MacAddress macsrc = new MacAddress("00:00:00:00:23:ae");
2528         ethsrc.setAddress(macsrc);
2529         ethsrc.setMask(mask2);
2530
2531         ethmatch.setEthernetSource(ethsrc.build());
2532         match.setEthernetMatch(ethmatch.build());
2533         return match;
2534
2535     }
2536
2537     /**
2538      * @return
2539      */
2540
2541     private static MatchBuilder createVlanMatch() {
2542         MatchBuilder match = new MatchBuilder();
2543         VlanMatchBuilder vlanBuilder = new VlanMatchBuilder(); // vlan match
2544         VlanIdBuilder vlanIdBuilder = new VlanIdBuilder();
2545         VlanId vlanId = new VlanId(10);
2546         VlanPcp vpcp = new VlanPcp((short) 3);
2547         vlanBuilder.setVlanPcp(vpcp);
2548         vlanIdBuilder.setVlanId(vlanId);
2549         vlanIdBuilder.setVlanIdPresent(true);
2550         vlanBuilder.setVlanId(vlanIdBuilder.build());
2551         match.setVlanMatch(vlanBuilder.build());
2552         return match;
2553     }
2554
2555     /**
2556      * @return
2557      */
2558     private static MatchBuilder createArpMatch() {
2559         MatchBuilder match = new MatchBuilder();
2560
2561         EthernetMatchBuilder ethmatch = new EthernetMatchBuilder();
2562         MacAddress macdest = new MacAddress("ff:ff:ff:ff:ff:ff");
2563         MacAddress macsrc = new MacAddress("00:00:00:00:23:ae");
2564
2565         byte[] mask = new byte[] { (byte) -1, (byte) -1, 0, 0, 0, 0 };
2566         byte[] mask2 = new byte[] { (byte) -1, (byte) -1, (byte) -1, 0, 0, 0 };
2567
2568         EthernetTypeBuilder ethtype = new EthernetTypeBuilder();
2569         EtherType type = new EtherType(0x0806L);
2570         ethmatch.setEthernetType(ethtype.setType(type).build());
2571
2572         Ipv4Prefix dstip = new Ipv4Prefix("200.71.9.52/10"); // ipv4 match
2573         Ipv4Prefix srcip = new Ipv4Prefix("100.1.1.1/8");
2574
2575         ArpMatchBuilder arpmatch = new ArpMatchBuilder(); // arp match
2576         ArpSourceHardwareAddressBuilder arpsrc = new ArpSourceHardwareAddressBuilder();
2577         arpsrc.setAddress(macsrc);
2578         arpsrc.setMask(mask);
2579         ArpTargetHardwareAddressBuilder arpdst = new ArpTargetHardwareAddressBuilder();
2580         arpdst.setAddress(macdest);
2581         arpdst.setMask(mask2);
2582         arpmatch.setArpOp(2);
2583         arpmatch.setArpSourceHardwareAddress(arpsrc.build());
2584         arpmatch.setArpTargetHardwareAddress(arpdst.build());
2585         arpmatch.setArpSourceTransportAddress(srcip);
2586         arpmatch.setArpTargetTransportAddress(dstip);
2587
2588         match.setEthernetMatch(ethmatch.build());
2589         match.setLayer3Match(arpmatch.build());
2590
2591         return match;
2592     }
2593
2594     /**
2595      * @return
2596      */
2597     private static MatchBuilder createIPMatch() {
2598         MatchBuilder match = new MatchBuilder();
2599         EthernetMatchBuilder ethmatch = new EthernetMatchBuilder();
2600         EthernetTypeBuilder ethtype = new EthernetTypeBuilder();
2601         EtherType type = new EtherType(0x0800L);
2602         ethmatch.setEthernetType(ethtype.setType(type).build());
2603         match.setEthernetMatch(ethmatch.build());
2604
2605         IpMatchBuilder ipmatch = new IpMatchBuilder(); // ipv4 version
2606         ipmatch.setIpProtocol((short) 1);
2607         Dscp dscp = new Dscp((short) 3);
2608         ipmatch.setIpDscp(dscp);
2609         ipmatch.setIpEcn((short) 2);
2610         match.setIpMatch(ipmatch.build());
2611         return match;
2612     }
2613
2614     /**
2615      * @return
2616      */
2617     private static MatchBuilder createL3IPv4Match() {
2618         MatchBuilder match = new MatchBuilder();
2619
2620         EthernetMatchBuilder eth = new EthernetMatchBuilder();
2621         EthernetTypeBuilder ethTypeBuilder = new EthernetTypeBuilder();
2622         ethTypeBuilder.setType(new EtherType(0x0800L));
2623         eth.setEthernetType(ethTypeBuilder.build());
2624         match.setEthernetMatch(eth.build());
2625
2626         Ipv4MatchBuilder ipv4Match = new Ipv4MatchBuilder();
2627         Ipv4Prefix dstip = new Ipv4Prefix("200.71.9.52/10"); // ipv4 match
2628         Ipv4Prefix srcip = new Ipv4Prefix("100.1.1.1/8");
2629         Ipv4MatchBuilder ipv4match = new Ipv4MatchBuilder();
2630         ipv4match.setIpv4Destination(dstip);
2631         ipv4match.setIpv4Source(srcip);
2632         match.setLayer3Match(ipv4match.build());
2633
2634         return match;
2635
2636     }
2637
2638     /**
2639      * @return
2640      */
2641     private static MatchBuilder createL3IPv6Match() {
2642         MatchBuilder match = new MatchBuilder();
2643
2644         EthernetMatchBuilder eth = new EthernetMatchBuilder();
2645         EthernetTypeBuilder ethTypeBuilder = new EthernetTypeBuilder();
2646         ethTypeBuilder.setType(new EtherType(0x86ddL));
2647         eth.setEthernetType(ethTypeBuilder.build());
2648         match.setEthernetMatch(eth.build());
2649
2650         Ipv6Prefix dstip6 = new Ipv6Prefix("2002::2/64");
2651         Ipv6Prefix srcip6 = new Ipv6Prefix("2001:0:0:0:0:0:0:1/56");
2652         Ipv6Address ndtarget = new Ipv6Address("2001:db8:0:1:fd97:f9f0:a810:782e");
2653         MacAddress ndsll = new MacAddress("c2:00:54:f5:00:00");
2654         MacAddress ndtll = new MacAddress("00:0c:29:0e:4c:67");
2655         Ipv6ExtHeaderBuilder nextheader = new Ipv6ExtHeaderBuilder();
2656         nextheader.setIpv6Exthdr(58);
2657         Ipv6LabelBuilder ipv6label = new Ipv6LabelBuilder();
2658         Ipv6FlowLabel label = new Ipv6FlowLabel(10028L);
2659         ipv6label.setIpv6Flabel(label);
2660         ipv6label.setFlabelMask(new byte[] { 0, 1, -1, -1 });
2661
2662         Icmpv6MatchBuilder icmpv6match = new Icmpv6MatchBuilder(); // icmpv6
2663                                                                    // match
2664         icmpv6match.setIcmpv6Type((short) 135);
2665         icmpv6match.setIcmpv6Code((short) 0);
2666         match.setIcmpv6Match(icmpv6match.build());
2667
2668         Ipv6MatchBuilder ipv6match = new Ipv6MatchBuilder();
2669         // ipv6match.setIpv6Source(srcip6);
2670         // ipv6match.setIpv6Destination(dstip6);
2671         // ipv6match.setIpv6ExtHeader(nextheader.build());
2672         ipv6match.setIpv6NdSll(ndsll);
2673         ipv6match.setIpv6NdTll(ndtll);
2674         // ipv6match.setIpv6NdTarget(ndtarget);
2675         ipv6match.setIpv6Label(ipv6label.build());
2676
2677         match.setLayer3Match(ipv6match.build());
2678
2679         return match;
2680     }
2681
2682     /**
2683      * @return
2684      */
2685
2686     private static MatchBuilder createICMPv4Match() {
2687         MatchBuilder match = new MatchBuilder();
2688         EthernetMatchBuilder eth = new EthernetMatchBuilder();
2689         EthernetTypeBuilder ethTypeBuilder = new EthernetTypeBuilder();
2690         ethTypeBuilder.setType(new EtherType(0x0800L));
2691         eth.setEthernetType(ethTypeBuilder.build());
2692         match.setEthernetMatch(eth.build());
2693
2694         IpMatchBuilder ipmatch = new IpMatchBuilder(); // ipv4 version
2695         ipmatch.setIpProtocol((short) 1);
2696         match.setIpMatch(ipmatch.build());
2697
2698         Icmpv4MatchBuilder icmpv4match = new Icmpv4MatchBuilder(); // icmpv4
2699                                                                    // match
2700         icmpv4match.setIcmpv4Type((short) 8);
2701         icmpv4match.setIcmpv4Code((short) 0);
2702         match.setIcmpv4Match(icmpv4match.build());
2703         return match;
2704     }
2705
2706     /**
2707      * @return
2708      */
2709     private static MatchBuilder createICMPv6Match() {
2710
2711         MatchBuilder match = new MatchBuilder();
2712         EthernetMatchBuilder eth = new EthernetMatchBuilder();
2713         EthernetTypeBuilder ethTypeBuilder = new EthernetTypeBuilder();
2714         ethTypeBuilder.setType(new EtherType(0x86ddL));
2715         eth.setEthernetType(ethTypeBuilder.build());
2716         match.setEthernetMatch(eth.build());
2717
2718         IpMatchBuilder ipmatch = new IpMatchBuilder(); // ipv4 version
2719         ipmatch.setIpProtocol((short) 58);
2720         match.setIpMatch(ipmatch.build());
2721
2722         Icmpv6MatchBuilder icmpv6match = new Icmpv6MatchBuilder(); // icmpv6
2723                                                                    // match
2724         icmpv6match.setIcmpv6Type((short) 135);
2725         icmpv6match.setIcmpv6Code((short) 1);
2726         match.setIcmpv6Match(icmpv6match.build());
2727
2728         return match;
2729     }
2730
2731     /**
2732      * @return
2733      */
2734     private static MatchBuilder createToSMatch() {
2735         MatchBuilder match = new MatchBuilder();
2736         EthernetMatchBuilder ethmatch = new EthernetMatchBuilder();
2737         EthernetTypeBuilder ethtype = new EthernetTypeBuilder();
2738         EtherType type = new EtherType(0x0800L);
2739         ethmatch.setEthernetType(ethtype.setType(type).build());
2740         match.setEthernetMatch(ethmatch.build());
2741
2742         IpMatchBuilder ipmatch = new IpMatchBuilder(); // ipv4 version
2743         ipmatch.setIpProtocol((short) 6);
2744         Dscp dscp = new Dscp((short) 8);
2745         ipmatch.setIpDscp(dscp);
2746         match.setIpMatch(ipmatch.build());
2747         return match;
2748     }
2749
2750     /**
2751      * @return
2752      */
2753
2754     private static MatchBuilder createL4TCPMatch() {
2755         MatchBuilder match = new MatchBuilder();
2756
2757         EthernetMatchBuilder eth = new EthernetMatchBuilder();
2758         EthernetTypeBuilder ethTypeBuilder = new EthernetTypeBuilder();
2759         ethTypeBuilder.setType(new EtherType(0x0800L));
2760         eth.setEthernetType(ethTypeBuilder.build());
2761         match.setEthernetMatch(eth.build());
2762
2763         IpMatchBuilder ipmatch = new IpMatchBuilder(); // ipv4 version
2764         ipmatch.setIpProtocol((short) 6);
2765         match.setIpMatch(ipmatch.build());
2766
2767         PortNumber srcport = new PortNumber(1213);
2768         PortNumber dstport = new PortNumber(646);
2769         TcpMatchBuilder tcpmatch = new TcpMatchBuilder(); // tcp match
2770         tcpmatch.setTcpSourcePort(srcport);
2771         tcpmatch.setTcpDestinationPort(dstport);
2772         match.setLayer4Match(tcpmatch.build());
2773
2774         return match;
2775     }
2776
2777     /**
2778      * @return
2779      */
2780     private static MatchBuilder createL4UDPMatch() {
2781         MatchBuilder match = new MatchBuilder();
2782
2783         EthernetMatchBuilder eth = new EthernetMatchBuilder();
2784         EthernetTypeBuilder ethTypeBuilder = new EthernetTypeBuilder();
2785         ethTypeBuilder.setType(new EtherType(0x0800L));
2786         eth.setEthernetType(ethTypeBuilder.build());
2787         match.setEthernetMatch(eth.build());
2788
2789         IpMatchBuilder ipmatch = new IpMatchBuilder(); // ipv4 version
2790         ipmatch.setIpProtocol((short) 17);
2791         match.setIpMatch(ipmatch.build());
2792
2793         PortNumber srcport = new PortNumber(1325);
2794         PortNumber dstport = new PortNumber(42);
2795         UdpMatchBuilder udpmatch = new UdpMatchBuilder(); // udp match
2796         udpmatch.setUdpDestinationPort(dstport);
2797         udpmatch.setUdpSourcePort(srcport);
2798         match.setLayer4Match(udpmatch.build());
2799
2800         return match;
2801     }
2802
2803     /**
2804      * @return
2805      */
2806     private static MatchBuilder createL4SCTPMatch() {
2807         MatchBuilder match = new MatchBuilder();
2808
2809         EthernetMatchBuilder eth = new EthernetMatchBuilder();
2810         EthernetTypeBuilder ethTypeBuilder = new EthernetTypeBuilder();
2811         ethTypeBuilder.setType(new EtherType(0x0800L));
2812         eth.setEthernetType(ethTypeBuilder.build());
2813         match.setEthernetMatch(eth.build());
2814
2815         IpMatchBuilder ipmatch = new IpMatchBuilder(); // ipv4 version
2816         ipmatch.setIpProtocol((short) 132);
2817         match.setIpMatch(ipmatch.build());
2818
2819         SctpMatchBuilder sctpmatch = new SctpMatchBuilder();
2820         PortNumber srcport = new PortNumber(1435);
2821         PortNumber dstport = new PortNumber(22);
2822         sctpmatch.setSctpSourcePort(srcport);
2823         sctpmatch.setSctpDestinationPort(dstport);
2824         match.setLayer4Match(sctpmatch.build());
2825
2826         return match;
2827     }
2828
2829     /**
2830      * @return
2831      */
2832     private static MatchBuilder createMetadataMatch() {
2833         MatchBuilder match = new MatchBuilder();
2834         byte[] metamask = new byte[] { (byte) -1, (byte) -1, (byte) -1, 0, 0, 0, (byte) 1, (byte) 1 };
2835         MetadataBuilder metadata = new MetadataBuilder(); // metadata match
2836         metadata.setMetadata(BigInteger.valueOf(500L));
2837         metadata.setMetadataMask(metamask);
2838         match.setMetadata(metadata.build());
2839
2840         return match;
2841     }
2842
2843     /**
2844      * @return
2845      */
2846     private static MatchBuilder createMplsMatch() {
2847         MatchBuilder match = new MatchBuilder();
2848
2849         EthernetMatchBuilder eth = new EthernetMatchBuilder();
2850         EthernetTypeBuilder ethTypeBuilder = new EthernetTypeBuilder();
2851         ethTypeBuilder.setType(new EtherType(0x8847L));
2852         eth.setEthernetType(ethTypeBuilder.build());
2853         match.setEthernetMatch(eth.build());
2854
2855         ProtocolMatchFieldsBuilder protomatch = new ProtocolMatchFieldsBuilder(); // mpls
2856         // match
2857         protomatch.setMplsLabel((long) 36008);
2858         protomatch.setMplsTc((short) 4);
2859         protomatch.setMplsBos((short) 1);
2860         match.setProtocolMatchFields(protomatch.build());
2861
2862         return match;
2863
2864     }
2865
2866     /**
2867      * @return
2868      */
2869     private static MatchBuilder createPbbMatch() {
2870         MatchBuilder match = new MatchBuilder();
2871
2872         EthernetMatchBuilder eth = new EthernetMatchBuilder();
2873         EthernetTypeBuilder ethTypeBuilder = new EthernetTypeBuilder();
2874         ethTypeBuilder.setType(new EtherType(0x88E7L));
2875         eth.setEthernetType(ethTypeBuilder.build());
2876         match.setEthernetMatch(eth.build());
2877
2878         ProtocolMatchFieldsBuilder protomatch = new ProtocolMatchFieldsBuilder(); // mpls
2879         // match
2880         protomatch.setPbb(new PbbBuilder().setPbbIsid(4L).setPbbMask(new byte[] { 0, 1, 0, 0 }).build());
2881         match.setProtocolMatchFields(protomatch.build());
2882
2883         return match;
2884
2885     }
2886
2887     /**
2888      * @return
2889      */
2890     private static MatchBuilder createTunnelIDMatch() {
2891         MatchBuilder match = new MatchBuilder();
2892         TunnelBuilder tunnel = new TunnelBuilder(); // tunnel id match
2893         tunnel.setTunnelId(BigInteger.valueOf(10668));
2894         byte[] mask = new byte[] { (byte) -1, (byte) -1, (byte) -1, 0, 0, 0, (byte) 1, (byte) 1 };
2895         tunnel.setTunnelMask(mask);
2896         match.setTunnel(tunnel.build());
2897
2898         return match;
2899     }
2900
2901     public void _removeMDFlow(CommandInterpreter ci) {
2902         DataModification<InstanceIdentifier<?>, DataObject> modification = dataBrokerService.beginTransaction();
2903         NodeBuilder tn = createTestNode(ci.nextArgument());
2904         FlowBuilder tf = createTestFlow(tn, ci.nextArgument(), ci.nextArgument());
2905         InstanceIdentifier<Flow> path1 = InstanceIdentifier.builder(Nodes.class).child(Node.class, tn.getKey())
2906                 .augmentation(FlowCapableNode.class).child(Table.class, new TableKey(tf.getTableId()))
2907                 .child(Flow.class, tf.getKey()).build();
2908         modification.removeOperationalData(nodeBuilderToInstanceId(tn));
2909         modification.removeOperationalData(path1);
2910         modification.removeConfigurationData(nodeBuilderToInstanceId(tn));
2911         modification.removeConfigurationData(path1);
2912         Future<RpcResult<TransactionStatus>> commitFuture = modification.commit();
2913         try {
2914             RpcResult<TransactionStatus> result = commitFuture.get();
2915             TransactionStatus status = result.getResult();
2916             ci.println("Status of Flow Data Loaded Transaction: " + status);
2917
2918         } catch (InterruptedException e) {
2919             LOG.error(e.getMessage(), e);
2920         } catch (ExecutionException e) {
2921             LOG.error(e.getMessage(), e);
2922         }
2923     }
2924
2925     public void _addMDFlow(CommandInterpreter ci) {
2926         NodeBuilder tn = createTestNode(ci.nextArgument());
2927         FlowBuilder tf = createTestFlow(tn, ci.nextArgument(), ci.nextArgument());
2928         writeFlow(ci, tf, tn);
2929     }
2930
2931     private void writeFlow(CommandInterpreter ci, FlowBuilder flow, NodeBuilder nodeBuilder) {
2932         DataModification<InstanceIdentifier<?>, DataObject> modification = dataBrokerService.beginTransaction();
2933         InstanceIdentifier<Flow> path1 = InstanceIdentifier.builder(Nodes.class)
2934                 .child(Node.class, nodeBuilder.getKey()).augmentation(FlowCapableNode.class)
2935                 .child(Table.class, new TableKey(flow.getTableId())).child(Flow.class, flow.getKey()).build();
2936         modification.putOperationalData(nodeBuilderToInstanceId(nodeBuilder), nodeBuilder.build());
2937         modification.putOperationalData(path1, flow.build());
2938         modification.putConfigurationData(nodeBuilderToInstanceId(nodeBuilder), nodeBuilder.build());
2939         modification.putConfigurationData(path1, flow.build());
2940         Future<RpcResult<TransactionStatus>> commitFuture = modification.commit();
2941         try {
2942             RpcResult<TransactionStatus> result = commitFuture.get();
2943             TransactionStatus status = result.getResult();
2944             ci.println("Status of Flow Data Loaded Transaction: " + status);
2945
2946         } catch (InterruptedException e) {
2947             LOG.error(e.getMessage(), e);
2948         } catch (ExecutionException e) {
2949             LOG.error(e.getMessage(), e);
2950         }
2951     }
2952
2953     public void _modifyMDFlow(CommandInterpreter ci) {
2954         NodeBuilder tn = createTestNode(ci.nextArgument());
2955         FlowBuilder tf = createTestFlow(tn, ci.nextArgument(), ci.nextArgument());
2956         tf.setFlowName(updatedFlowName);
2957         writeFlow(ci, tf, tn);
2958         tf.setFlowName(originalFlowName);
2959         writeFlow(ci, tf, tn);
2960     }
2961
2962     private static NodeRef createNodeRef(String string) {
2963         NodeKey key = new NodeKey(new NodeId(string));
2964         InstanceIdentifier<Node> path = InstanceIdentifier.builder().node(Nodes.class).node(Node.class, key)
2965                 .toInstance();
2966
2967         return new NodeRef(path);
2968     }
2969
2970     @Override
2971     public String getHelp() {
2972         return "No help";
2973     }
2974 }