Merge "Moving TableIds into a single constants file"
[vpnservice.git] / mdsalutil / mdsalutil-api / src / main / java / org / opendaylight / vpnservice / mdsalutil / InstructionType.java
index 5ee42539a4425e771823edcfa750fce5bb11f998..dec055d4c6ba29b0cb53cc47a9bd3023f53a905d 100644 (file)
@@ -1,6 +1,9 @@
 /*
- * Copyright (c) 2013 Ericsson AB.  All rights reserved.
+ * Copyright (c) 2015 Ericsson India Global Services Pvt Ltd. and others.  All rights reserved.
  *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
 package org.opendaylight.vpnservice.mdsalutil;
 
@@ -33,8 +36,10 @@ public enum InstructionType {
         public Instruction buildInstruction(InstructionInfo instructionInfo, int instructionKey) {
             List<ActionInfo> mkActions = instructionInfo.getActionInfos();
             List<Action> listAction = new ArrayList <Action> ();
+            int actionKey = 0 ;
             for(ActionInfo mkAction: mkActions) {
                 ActionType actionType = mkAction.getActionType();
+                mkAction.setActionKey(actionKey++);
                 listAction.add(actionType.buildAction(mkAction));
             }
             ApplyActions applyActions = new ApplyActionsBuilder().setAction(listAction).build();
@@ -66,8 +71,10 @@ public enum InstructionType {
         public Instruction buildInstruction(InstructionInfo instructionInfo, int instructionKey) {
             List<ActionInfo> mkActions = instructionInfo.getActionInfos();
             List<Action> listAction = new ArrayList <Action> ();
+            int actionKey = 0 ;
             for(ActionInfo mkAction: mkActions) {
                 ActionType actionType = mkAction.getActionType();
+                mkAction.setActionKey(actionKey++);
                 listAction.add(actionType.buildAction(mkAction));
             }
             WriteActions writeActions = new WriteActionsBuilder().setAction(listAction).build();