Add priority to Intents

Change-Id: Ibe63356f5b15a6aa6ca7731dba3382c3317a95ec
diff --git a/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/HostToHostIntentCompiler.java b/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/HostToHostIntentCompiler.java
index df8ef04..60306b2 100644
--- a/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/HostToHostIntentCompiler.java
+++ b/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/HostToHostIntentCompiler.java
@@ -98,7 +98,8 @@
         TrafficSelector selector = builder(intent.selector())
                 .matchEthSrc(src.mac()).matchEthDst(dst.mac()).build();
         return new PathIntent(intent.appId(), selector, intent.treatment(),
-                              path, intent.constraints());
+                              path, intent.constraints(),
+                              intent.priority());
     }
 
 }
diff --git a/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/MultiPointToSinglePointIntentCompiler.java b/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/MultiPointToSinglePointIntentCompiler.java
index b4889f4..6403019 100644
--- a/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/MultiPointToSinglePointIntentCompiler.java
+++ b/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/MultiPointToSinglePointIntentCompiler.java
@@ -89,12 +89,14 @@
             }
         }
 
+        Set<ConnectPoint> egress = ImmutableSet.of(intent.egressPoint());
         Intent result = new LinkCollectionIntent(intent.appId(),
                                                  intent.selector(), intent.treatment(),
                                                  Sets.newHashSet(links.values()),
                                                  intent.ingressPoints(),
                                                  ImmutableSet.of(intent.egressPoint()),
-                                                 Collections.emptyList());
+                                                 Collections.emptyList(),
+                                                 intent.priority());
         return Arrays.asList(result);
     }
 
diff --git a/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/PointToPointIntentCompiler.java b/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/PointToPointIntentCompiler.java
index 9371586..0f897a4 100644
--- a/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/PointToPointIntentCompiler.java
+++ b/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/PointToPointIntentCompiler.java
@@ -93,7 +93,8 @@
                                     PointToPointIntent intent) {
         return new PathIntent(intent.appId(),
                               intent.selector(), intent.treatment(), path,
-                              intent.constraints());
+                              intent.constraints(),
+                              intent.priority());
     }
 
 }
diff --git a/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/SinglePointToMultiPointIntentCompiler.java b/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/SinglePointToMultiPointIntentCompiler.java
index 8360820..4b2260e 100644
--- a/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/SinglePointToMultiPointIntentCompiler.java
+++ b/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/SinglePointToMultiPointIntentCompiler.java
@@ -70,7 +70,9 @@
                                                  intent.selector(),
                                                  intent.treatment(), links,
                                                  ImmutableSet.of(intent.ingressPoint()),
-                                                 intent.egressPoints(), Collections.emptyList());
+                                                 intent.egressPoints(),
+                                                 Collections.emptyList(),
+                                                 intent.priority());
 
         return Arrays.asList(result);
     }
diff --git a/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/TwoWayP2PIntentCompiler.java b/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/TwoWayP2PIntentCompiler.java
index 6c5b7f3..af603d5 100644
--- a/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/TwoWayP2PIntentCompiler.java
+++ b/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/TwoWayP2PIntentCompiler.java
@@ -51,11 +51,11 @@
                 new PointToPointIntent(intent.appId(), intent.key(),
                                        intent.selector(), intent.treatment(),
                                        intent.one(), intent.two(),
-                                       intent.constraints()),
+                                       intent.constraints(), Intent.DEFAULT_INTENT_PRIORITY),
                 new PointToPointIntent(intent.appId(), intent.key(),
                                        intent.selector(), intent.treatment(),
                                        intent.two(), intent.one(),
-                                       intent.constraints()));
+                                       intent.constraints(), Intent.DEFAULT_INTENT_PRIORITY));
 
     }
 }