ONOS-3633 - Adding intent event listener to PointToPointIntent virtual network
provider. Intent events will either set the virtual link state to ACTIVE or
INACTIVE.

Change-Id: I34b65b2bfff29b791e7b2eb4d7cefb2ec4e88672
diff --git a/core/api/src/main/java/org/onosproject/net/DefaultEdgeLink.java b/core/api/src/main/java/org/onosproject/net/DefaultEdgeLink.java
index e08f9fc..7bafeda 100644
--- a/core/api/src/main/java/org/onosproject/net/DefaultEdgeLink.java
+++ b/core/api/src/main/java/org/onosproject/net/DefaultEdgeLink.java
@@ -42,7 +42,7 @@
                            HostLocation hostLocation, boolean isIngress,
                            Annotations... annotations) {
         super(providerId, isIngress ? hostPoint : hostLocation,
-              isIngress ? hostLocation : hostPoint, Type.EDGE, annotations);
+              isIngress ? hostLocation : hostPoint, Type.EDGE, State.ACTIVE, annotations);
         checkArgument(hostPoint.elementId() instanceof HostId,
                       "Host point does not refer to a host ID");
         this.hostId = (HostId) hostPoint.elementId();
diff --git a/core/api/src/main/java/org/onosproject/net/DefaultLink.java b/core/api/src/main/java/org/onosproject/net/DefaultLink.java
index 9aed9c9..628d785 100644
--- a/core/api/src/main/java/org/onosproject/net/DefaultLink.java
+++ b/core/api/src/main/java/org/onosproject/net/DefaultLink.java
@@ -36,17 +36,18 @@
     private final boolean isExpected;
 
     /**
-     * Creates an active infrastructure link using the supplied information.
+     * Creates an infrastructure link using the supplied information.
      *
      * @param providerId  provider identity
      * @param src         link source
      * @param dst         link destination
      * @param type        link type
+     * @param state       link state
      * @param annotations optional key/value annotations
      */
     protected DefaultLink(ProviderId providerId, ConnectPoint src, ConnectPoint dst,
-                       Type type, Annotations... annotations) {
-        this(providerId, src, dst, type, ACTIVE, false, annotations);
+                       Type type, State state, Annotations... annotations) {
+        this(providerId, src, dst, type, state, false, annotations);
     }
 
     /**
diff --git a/core/api/src/main/java/org/onosproject/net/DefaultPath.java b/core/api/src/main/java/org/onosproject/net/DefaultPath.java
index 9f0480d..e4c3d8c 100644
--- a/core/api/src/main/java/org/onosproject/net/DefaultPath.java
+++ b/core/api/src/main/java/org/onosproject/net/DefaultPath.java
@@ -44,7 +44,7 @@
      */
     public DefaultPath(ProviderId providerId, List<Link> links, double cost,
                        Annotations... annotations) {
-        super(providerId, source(links), destination(links), Type.INDIRECT, annotations);
+        super(providerId, source(links), destination(links), Type.INDIRECT, State.ACTIVE, annotations);
         this.links = ImmutableList.copyOf(links);
         this.cost = cost;
     }
diff --git a/core/api/src/test/java/org/onosproject/net/DefaultLinkTest.java b/core/api/src/test/java/org/onosproject/net/DefaultLinkTest.java
index 33af473..7bb7a5c 100644
--- a/core/api/src/test/java/org/onosproject/net/DefaultLinkTest.java
+++ b/core/api/src/test/java/org/onosproject/net/DefaultLinkTest.java
@@ -42,11 +42,11 @@
 
     @Test
     public void testEquality() {
-        Link l1 = new DefaultLink(PID, cp(DID1, P1), cp(DID2, P2), DIRECT);
-        Link l2 = new DefaultLink(PID, cp(DID1, P1), cp(DID2, P2), DIRECT);
-        Link l3 = new DefaultLink(PID, cp(DID1, P2), cp(DID2, P2), DIRECT);
-        Link l4 = new DefaultLink(PID, cp(DID1, P2), cp(DID2, P2), DIRECT);
-        Link l5 = new DefaultLink(PID, cp(DID1, P2), cp(DID2, P2), INDIRECT);
+        Link l1 = new DefaultLink(PID, cp(DID1, P1), cp(DID2, P2), DIRECT, Link.State.ACTIVE);
+        Link l2 = new DefaultLink(PID, cp(DID1, P1), cp(DID2, P2), DIRECT, Link.State.ACTIVE);
+        Link l3 = new DefaultLink(PID, cp(DID1, P2), cp(DID2, P2), DIRECT, Link.State.ACTIVE);
+        Link l4 = new DefaultLink(PID, cp(DID1, P2), cp(DID2, P2), DIRECT, Link.State.ACTIVE);
+        Link l5 = new DefaultLink(PID, cp(DID1, P2), cp(DID2, P2), INDIRECT, Link.State.ACTIVE);
 
         new EqualsTester().addEqualityGroup(l1, l2)
                 .addEqualityGroup(l3, l4)
@@ -56,7 +56,7 @@
 
     @Test
     public void basics() {
-        Link link = new DefaultLink(PID, cp(DID1, P1), cp(DID2, P2), DIRECT);
+        Link link = new DefaultLink(PID, cp(DID1, P1), cp(DID2, P2), DIRECT, Link.State.ACTIVE);
         assertEquals("incorrect src", cp(DID1, P1), link.src());
         assertEquals("incorrect dst", cp(DID2, P2), link.dst());
         assertEquals("incorrect type", DIRECT, link.type());
diff --git a/core/api/src/test/java/org/onosproject/net/NetTestTools.java b/core/api/src/test/java/org/onosproject/net/NetTestTools.java
index 010c2cd..8898008 100644
--- a/core/api/src/test/java/org/onosproject/net/NetTestTools.java
+++ b/core/api/src/test/java/org/onosproject/net/NetTestTools.java
@@ -81,7 +81,7 @@
         return new DefaultLink(PID,
                                connectPoint(src, sp),
                                connectPoint(dst, dp),
-                               Link.Type.DIRECT);
+                               Link.Type.DIRECT, Link.State.ACTIVE);
     }
 
     // Creates a path that leads through the given devices.