Priorty (assigned from REST module) is set to the policy.
(priority field was added in MatchAction class)

Change-Id: Idcf25a40e70bee8786b7cedfe2ae4be842c6f132
diff --git a/src/main/java/net/onrc/onos/core/drivermanager/OFSwitchImplCPqD13.java b/src/main/java/net/onrc/onos/core/drivermanager/OFSwitchImplCPqD13.java
index c2ac997..93632e7 100644
--- a/src/main/java/net/onrc/onos/core/drivermanager/OFSwitchImplCPqD13.java
+++ b/src/main/java/net/onrc/onos/core/drivermanager/OFSwitchImplCPqD13.java
@@ -1544,7 +1544,7 @@
                 .setTableId(TableId.of(TABLE_ACL))
                 .setMatch(matchBuilder.build())
                 .setInstructions(instructions)
-                .setPriority(MAX_PRIORITY) // exact match and exclusive
+                .setPriority(ma.getPriority()) // exact match and exclusive
                 .setBufferId(OFBufferId.NO_BUFFER)
                 .setIdleTimeout(0)
                 .setHardTimeout(0)
diff --git a/src/main/java/net/onrc/onos/core/matchaction/MatchAction.java b/src/main/java/net/onrc/onos/core/matchaction/MatchAction.java
index d7d5d73..5891f11 100644
--- a/src/main/java/net/onrc/onos/core/matchaction/MatchAction.java
+++ b/src/main/java/net/onrc/onos/core/matchaction/MatchAction.java
@@ -15,6 +15,7 @@
     private final SwitchPort port;
     private final Match match;
     private final List<Action> actions;
+    private final int priority;
 
     /**
      * Constructor.
@@ -29,6 +30,24 @@
         this.port = port;
         this.match = match;
         this.actions = actions;
+        this.priority = 0;
+    }
+
+    /**
+     * Constructor.
+     *
+     * @param id ID for this MatchAction object
+     * @param port switch port to apply changes to
+     * @param match the Match object as match condition on the port
+     * @param actions the list of Action objects as actions on the switch
+     * @param priority the priority of the MatchAction
+     */
+    public MatchAction(MatchActionId id, SwitchPort port, Match match, int priority, List<Action> actions) {
+        this.id = id;
+        this.port = port;
+        this.match = match;
+        this.actions = actions;
+        this.priority = priority;
     }
 
     /**
@@ -39,6 +58,7 @@
         port = null;
         match = null;
         actions = null;
+        priority = 0;
     }
 
     /**
@@ -77,6 +97,15 @@
         return actions;
     }
 
+    /**
+     * Get the priority of the match action
+     *
+     * @return priority
+     */
+    public int getPriority() {
+        return priority;
+    }
+
     @Override
     public int hashCode() {
         return id.hashCode();
@@ -90,4 +119,6 @@
         }
         return false;
     }
+
+
 }