+
+ public static def toMDSalflow(Flow sourceFlow) {
+ if (sourceFlow == null)
+ throw new IllegalArgumentException();
+ val it = new FlowBuilder();
+
+ hardTimeout = sourceFlow.hardTimeout as int
+ idleTimeout = sourceFlow.idleTimeout as int
+ cookie = BigInteger.valueOf(sourceFlow.id)
+ priority = sourceFlow.priority as int
+
+ val sourceActions = sourceFlow.actions;
+ val targetActions = new ArrayList<Action>();
+ for (sourceAction : sourceActions) {
+ targetActions.add(sourceAction.toAction());
+ }
+ instructions = targetActions.toApplyInstruction();
+ match = sourceFlow.match.toMatch();
+ return it.build();
+ }
+