Merge "Add test for generated code checking list of dependencies."
[controller.git] / opendaylight / md-sal / compatibility / sal-compatibility / src / main / java / org / opendaylight / controller / sal / compatibility / MDFlowMapping.xtend
1 package org.opendaylight.controller.sal.compatibility;
2
3 import com.google.common.net.InetAddresses
4 import java.math.BigInteger
5 import java.net.Inet4Address
6 import java.net.Inet6Address
7 import java.util.ArrayList
8 import org.opendaylight.controller.sal.action.Controller
9 import org.opendaylight.controller.sal.action.Drop
10 import org.opendaylight.controller.sal.action.Flood
11 import org.opendaylight.controller.sal.action.FloodAll
12 import org.opendaylight.controller.sal.action.HwPath
13 import org.opendaylight.controller.sal.action.Loopback
14 import org.opendaylight.controller.sal.action.Output
15 import org.opendaylight.controller.sal.action.PopVlan
16 import org.opendaylight.controller.sal.action.PushVlan
17 import org.opendaylight.controller.sal.action.SetDlDst
18 import org.opendaylight.controller.sal.action.SetDlSrc
19 import org.opendaylight.controller.sal.action.SetDlType
20 import org.opendaylight.controller.sal.action.SetNextHop
21 import org.opendaylight.controller.sal.action.SetNwDst
22 import org.opendaylight.controller.sal.action.SetNwSrc
23 import org.opendaylight.controller.sal.action.SetNwTos
24 import org.opendaylight.controller.sal.action.SetTpDst
25 import org.opendaylight.controller.sal.action.SetTpSrc
26 import org.opendaylight.controller.sal.action.SetVlanCfi
27 import org.opendaylight.controller.sal.action.SetVlanId
28 import org.opendaylight.controller.sal.action.SetVlanPcp
29 import org.opendaylight.controller.sal.action.SwPath
30 import org.opendaylight.controller.sal.core.Node
31 import org.opendaylight.controller.sal.core.NodeConnector
32 import org.opendaylight.controller.sal.flowprogrammer.Flow
33 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv4Prefix
34 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv6Prefix
35 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.PortNumber
36 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Uri
37 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev100924.MacAddress
38 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.AddFlowInputBuilder
39 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.FlowAddedBuilder
40 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.RemoveFlowInputBuilder
41 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.UpdateFlowInputBuilder
42 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.VlanCfi
43 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.address.Address
44 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.address.address.Ipv4Builder
45 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.address.address.Ipv6Builder
46 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action;
47 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionBuilder;
48 import org.opendaylight.yang.gen.v1.urn.opendaylight.l2.types.rev130827.EtherType
49 import org.opendaylight.yang.gen.v1.urn.opendaylight.l2.types.rev130827.VlanId
50 import org.opendaylight.yang.gen.v1.urn.opendaylight.l2.types.rev130827.VlanPcp
51
52 import static extension org.opendaylight.controller.sal.compatibility.FromSalConversionsUtils.*
53 import static extension org.opendaylight.controller.sal.compatibility.NodeMapping.*
54 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.flow.update.OriginalFlowBuilder
55 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.flow.update.UpdatedFlowBuilder
56 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.Instructions
57 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.InstructionsBuilder
58 import java.util.Collections
59 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.Instruction
60 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.InstructionBuilder
61 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.controller.action._case.ControllerActionBuilder
62 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.drop.action._case.DropActionBuilder
63 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.flood.action._case.FloodActionBuilder
64 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.flood.all.action._case.FloodAllActionBuilder
65 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.hw.path.action._case.HwPathActionBuilder
66 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.loopback.action._case.LoopbackActionBuilder
67 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.output.action._case.OutputActionBuilder
68 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.push.vlan.action._case.PushVlanActionBuilder
69 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.dl.dst.action._case.SetDlDstActionBuilder
70 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.dl.src.action._case.SetDlSrcActionBuilder
71 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.dl.type.action._case.SetDlTypeActionBuilder
72 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.next.hop.action._case.SetNextHopActionBuilder
73 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.nw.dst.action._case.SetNwDstActionBuilder
74 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.nw.src.action._case.SetNwSrcActionBuilder
75 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.nw.tos.action._case.SetNwTosActionBuilder
76 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.tp.dst.action._case.SetTpDstActionBuilder
77 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.tp.src.action._case.SetTpSrcActionBuilder
78 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.vlan.cfi.action._case.SetVlanCfiActionBuilder
79 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.vlan.id.action._case.SetVlanIdActionBuilder
80 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.vlan.pcp.action._case.SetVlanPcpActionBuilder
81 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.sw.path.action._case.SwPathActionBuilder
82 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetTpSrcActionCaseBuilder
83 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetTpDstActionCaseBuilder
84 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetNwTosActionCaseBuilder
85 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetNwSrcActionCaseBuilder
86 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetNwDstActionCaseBuilder
87 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetNextHopActionCaseBuilder
88 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetDlTypeActionCaseBuilder
89 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetDlDstActionCaseBuilder
90 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.ControllerActionCaseBuilder
91 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.DropActionCaseBuilder
92 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.FloodActionCaseBuilder
93 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.FloodAllActionCaseBuilder
94 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.HwPathActionCaseBuilder
95 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.LoopbackActionCaseBuilder
96 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.PopVlanActionCaseBuilder
97 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.OutputActionCaseBuilder
98 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.PushVlanActionCaseBuilder
99 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetDlSrcActionCaseBuilder
100 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetVlanCfiActionCaseBuilder
101 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetVlanIdActionCaseBuilder
102 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetVlanPcpActionCaseBuilder
103 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SwPathActionCaseBuilder
104 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.apply.actions._case.ApplyActionsBuilder
105 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.ApplyActionsCaseBuilder
106 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId
107 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.FlowBuilder
108 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowId
109
110 public class MDFlowMapping {
111
112     private new() {
113         throw new UnsupportedOperationException()
114     }
115
116     public static def flowAdded(Flow sourceFlow) {
117         if (sourceFlow == null)
118             throw new IllegalArgumentException();
119         val it = new FlowAddedBuilder();
120
121         hardTimeout = sourceFlow.hardTimeout as int
122         idleTimeout = sourceFlow.idleTimeout as int
123         cookie = BigInteger.valueOf(sourceFlow.id)
124         priority = sourceFlow.priority as int
125
126         val sourceActions = sourceFlow.actions;
127         val targetActions = new ArrayList<Action>();
128         for (sourceAction : sourceActions) {
129             targetActions.add(sourceAction.toAction());
130         }
131         instructions = targetActions.toApplyInstruction();
132         match = sourceFlow.match.toMatch();
133         tableId = new Integer(0).shortValue
134         return it.build();
135
136     }
137     
138     public static def toMDFlow(Flow sourceFlow) {
139        if (sourceFlow == null)
140             throw new IllegalArgumentException();
141        val it = new FlowBuilder();
142        hardTimeout = sourceFlow.hardTimeout as int
143        idleTimeout = sourceFlow.idleTimeout as int
144        cookie = BigInteger.valueOf(sourceFlow.id)
145        priority = sourceFlow.priority as int
146        id = new FlowId(sourceFlow.id)
147     
148        val sourceActions = sourceFlow.actions;
149        val targetActions = new ArrayList<Action>();
150        for (sourceAction : sourceActions) {
151            targetActions.add(sourceAction.toAction());
152        }
153        instructions = targetActions.toApplyInstruction();
154        match = sourceFlow.match.toMatch();
155        tableId = new Integer(0).shortValue
156        return it.build();
157     }
158     
159     public static def Instructions toApplyInstruction(ArrayList<Action> actions) {
160         val it = new InstructionsBuilder;
161         val applyActions = new InstructionBuilder;
162         applyActions.instruction = new ApplyActionsCaseBuilder().setApplyActions(new ApplyActionsBuilder().setAction(actions).build()).build()
163         applyActions.setOrder(new Integer(0))
164         instruction = Collections.<Instruction>singletonList(applyActions.build)
165         return it.build;
166     }
167
168     public static def removeFlowInput(Node sourceNode, Flow sourceFlow) {
169         val source = flowAdded(sourceFlow);
170         val it = new RemoveFlowInputBuilder(source as org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.Flow);
171         node = sourceNode.toNodeRef()
172         return it.build();
173     }
174
175     public static def addFlowInput(Node sourceNode, Flow sourceFlow) {
176         val source = flowAdded(sourceFlow);
177         val it = new AddFlowInputBuilder(source as org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.Flow);
178         it.setNode(sourceNode.toNodeRef)
179         return it.build();
180     }
181
182     public static def updateFlowInput(Node sourceNode, Flow oldFlow, Flow newFlow) {
183         val it = new UpdateFlowInputBuilder();
184         val sourceOld = flowAdded(newFlow);
185
186         val original = new OriginalFlowBuilder(sourceOld as org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.Flow);
187         val sourceNew = flowAdded(newFlow);
188         val updated = new UpdatedFlowBuilder(sourceNew as org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.Flow);
189         originalFlow = original.build()
190         updatedFlow = updated.build();
191         node = sourceNode.toNodeRef()
192         return it.build();
193     }
194
195     public static dispatch def toAction(Controller sourceAction) {
196         val actionBuilder = new ActionBuilder();
197         actionBuilder.action = new ControllerActionCaseBuilder().setControllerAction(new ControllerActionBuilder().build()).build();
198         return actionBuilder.build();
199     }
200
201     public static dispatch def toAction(Drop sourceAction) {
202         val actionBuilder = new ActionBuilder();
203         actionBuilder.action = new DropActionCaseBuilder().setDropAction(new DropActionBuilder().build()).build();
204         return actionBuilder.build();
205     }
206
207     public static dispatch def toAction(Flood sourceAction) {
208         val actionBuilder = new ActionBuilder();
209         actionBuilder.action = new FloodActionCaseBuilder().setFloodAction(new FloodActionBuilder().build).build();
210         return actionBuilder.build();
211     }
212
213     public static dispatch def toAction(FloodAll sourceAction) {
214         val actionBuilder = new ActionBuilder();
215         actionBuilder.action = new FloodAllActionCaseBuilder().setFloodAllAction(new FloodAllActionBuilder().build()).build();
216         return actionBuilder.build();
217     }
218
219     public static dispatch def toAction(HwPath sourceAction) {
220         val actionBuilder = new ActionBuilder();
221         actionBuilder.action = new HwPathActionCaseBuilder().setHwPathAction(new HwPathActionBuilder().build()).build();
222         return actionBuilder.build();
223     }
224
225     public static dispatch def toAction(Loopback sourceAction) {
226         val actionBuilder = new ActionBuilder();
227         actionBuilder.action = new LoopbackActionCaseBuilder().setLoopbackAction(new LoopbackActionBuilder().build()).build();
228         return actionBuilder.build();
229     }
230
231     public static dispatch def toAction(Output sourceAction) {
232         val actionBuilder = new ActionBuilder();
233         val it = new OutputActionBuilder();
234         outputNodeConnector = sourceAction.port.toUri;
235         actionBuilder.action = new OutputActionCaseBuilder().setOutputAction(it.build()).build();
236         return actionBuilder.build();
237
238     }
239
240     public static dispatch def toAction(PopVlan sourceAction) {
241         val actionBuilder = new ActionBuilder();
242         actionBuilder.action = new PopVlanActionCaseBuilder().build();
243         return actionBuilder.build();
244     }
245
246     public static dispatch def toAction(PushVlan sourceAction) {
247         val actionBuilder = new ActionBuilder();
248         val it = new PushVlanActionBuilder();
249         cfi = new VlanCfi(sourceAction.cfi);
250         vlanId = new VlanId(sourceAction.vlanId);
251         pcp = sourceAction.pcp;
252         tag = sourceAction.tag;
253         actionBuilder.action = new PushVlanActionCaseBuilder().setPushVlanAction(it.build()).build();
254         return actionBuilder.build();
255     }
256
257     public static dispatch def toAction(SetDlDst sourceAction) {
258         val actionBuilder = new ActionBuilder();
259         val it = new SetDlDstActionBuilder();
260         address = sourceAction.dlAddress.toMacAddress();
261         actionBuilder.action = new SetDlDstActionCaseBuilder().setSetDlDstAction(it.build()).build;
262         return actionBuilder.build();
263     }
264
265     public static dispatch def toAction(SetDlSrc sourceAction) {
266         val actionBuilder = new ActionBuilder();
267         val it = new SetDlSrcActionBuilder();
268         address = sourceAction.dlAddress.toMacAddress;
269         actionBuilder.action = new SetDlSrcActionCaseBuilder().setSetDlSrcAction(it.build()).build;
270         return actionBuilder.build();
271     }
272
273     public static dispatch def toAction(SetDlType sourceAction) {
274         val actionBuilder = new ActionBuilder();
275         val it = new SetDlTypeActionBuilder();
276         dlType = new EtherType(sourceAction.dlType as long);
277         actionBuilder.action = new SetDlTypeActionCaseBuilder().setSetDlTypeAction(it.build()).build();
278         return actionBuilder.build();
279     }
280
281     public static dispatch def toAction(SetNextHop sourceAction) {
282         val actionBuilder = new ActionBuilder();
283         val it = new SetNextHopActionBuilder();
284         val inetAddress = sourceAction.address;
285         address = inetAddress.toInetAddress;
286         actionBuilder.action = new SetNextHopActionCaseBuilder().setSetNextHopAction(it.build).build();
287         return actionBuilder.build();
288     }
289
290     public static dispatch def toAction(SetNwDst sourceAction) {
291         val actionBuilder = new ActionBuilder();
292         val it = new SetNwDstActionBuilder();
293         val inetAddress = sourceAction.address;
294         address = inetAddress.toInetAddress;
295         actionBuilder.action = new SetNwDstActionCaseBuilder().setSetNwDstAction(it.build()).build();
296         return actionBuilder.build();
297     }
298
299     public static dispatch def toAction(SetNwSrc sourceAction) {
300         val actionBuilder = new ActionBuilder();
301         val it = new SetNwSrcActionBuilder();
302         val inetAddress = sourceAction.address;
303         address = inetAddress.toInetAddress;
304         actionBuilder.action = new SetNwSrcActionCaseBuilder().setSetNwSrcAction(it.build()).build();
305         return actionBuilder.build();
306     }
307
308     public static dispatch def toAction(SetNwTos sourceAction) {
309         val actionBuilder = new ActionBuilder();
310         val it = new SetNwTosActionBuilder();
311         tos = sourceAction.nwTos;
312         actionBuilder.action = new SetNwTosActionCaseBuilder().setSetNwTosAction(it.build).build;
313         return actionBuilder.build();
314     }
315
316     public static dispatch def toAction(SetTpDst sourceAction) {
317         val actionBuilder = new ActionBuilder();
318         val it = new SetTpDstActionBuilder();
319         port = new PortNumber(sourceAction.port);
320         actionBuilder.action = new SetTpDstActionCaseBuilder().setSetTpDstAction(it.build()).build();
321         return actionBuilder.build();
322     }
323
324     public static dispatch def toAction(SetTpSrc sourceAction) {
325         val actionBuilder = new ActionBuilder();
326         val it = new SetTpSrcActionBuilder();
327         port = new PortNumber(sourceAction.port);
328         actionBuilder.action = new SetTpSrcActionCaseBuilder().setSetTpSrcAction(it.build()).build();
329         return actionBuilder.build();
330     }
331
332     public static dispatch def toAction(SetVlanCfi sourceAction) {
333         val actionBuilder = new ActionBuilder();
334         val it = new SetVlanCfiActionBuilder();
335         vlanCfi = new VlanCfi(sourceAction.cfi);
336         actionBuilder.action = new SetVlanCfiActionCaseBuilder().setSetVlanCfiAction(it.build()).build();
337         return actionBuilder.build();
338     }
339
340     public static dispatch def toAction(SetVlanId sourceAction) {
341         val actionBuilder = new ActionBuilder();
342
343         val it = new SetVlanIdActionBuilder();
344         vlanId = new VlanId(sourceAction.vlanId);
345         actionBuilder.action = new SetVlanIdActionCaseBuilder().setSetVlanIdAction(it.build()).build();
346         return actionBuilder.build();
347     }
348
349     public static dispatch def toAction(SetVlanPcp sourceAction) {
350         val actionBuilder = new ActionBuilder();
351         val it = new SetVlanPcpActionBuilder();
352         vlanPcp = new VlanPcp(sourceAction.pcp as short);
353         actionBuilder.action = new SetVlanPcpActionCaseBuilder().setSetVlanPcpAction(it.build).build;
354         return actionBuilder.build();
355     }
356
357     public static dispatch def toAction(SwPath sourceAction) {
358         val actionBuilder = new ActionBuilder();
359         actionBuilder.action = new SwPathActionCaseBuilder().setSwPathAction(new SwPathActionBuilder().build()).build();
360         return actionBuilder.build();
361     }
362
363     public static def dispatch Address toInetAddress(Inet4Address address) {
364         val it = new Ipv4Builder
365         ipv4Address = new Ipv4Prefix(InetAddresses.toAddrString(address))
366         return it.build()
367     }
368
369     public static def dispatch Address toInetAddress(Inet6Address address) {
370         val it = new Ipv6Builder
371         ipv6Address = new Ipv6Prefix(InetAddresses.toAddrString(address))
372         return it.build()
373     }
374
375     public static def Uri toUri(NodeConnector connector) {
376         return new NodeConnectorId(connector.ID as String);
377     }
378
379     public static def MacAddress toMacAddress(byte[] bytes) {
380         val sb = new StringBuilder(18);
381         for (byte b : bytes) {
382             if (sb.length() > 0)
383                 sb.append(':');
384             sb.append(String.format("%02x", b));
385         }
386         return new MacAddress(sb.toString());
387     }
388         
389         public static def toMDSalflow(Flow sourceFlow) {
390         if (sourceFlow == null)
391             throw new IllegalArgumentException();
392         val it = new FlowBuilder();
393
394         hardTimeout = sourceFlow.hardTimeout as int
395         idleTimeout = sourceFlow.idleTimeout as int
396         cookie = BigInteger.valueOf(sourceFlow.id)
397         priority = sourceFlow.priority as int
398
399         val sourceActions = sourceFlow.actions;
400         val targetActions = new ArrayList<Action>();
401         for (sourceAction : sourceActions) {
402             targetActions.add(sourceAction.toAction());
403         }
404         instructions = targetActions.toApplyInstruction();
405         match = sourceFlow.match.toMatch();
406         return it.build();
407         }
408         
409 }

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.