Fix latency constraint

1. Consider that the type "Duration" in the String is composed by
characters and numbers, it's not easy to convert it to double for
comparison, I modified the latency's annotation to
cfg.latency().toNanos().
2. Exclude two EdgeLinks for the calculation of the whole path's latency
3. The unit of latency in ONOS is not the same, so I set all the latency units to
nanoseconds.
4. Add the latency constraint option for ConnectivityIntentCommand.

Change-Id: Iddf5634880e43ed563db9978659db5eb9ee6c7f8
diff --git a/core/api/src/test/java/org/onosproject/net/intent/constraint/LatencyConstraintTest.java b/core/api/src/test/java/org/onosproject/net/intent/constraint/LatencyConstraintTest.java
index c1ee3aa..8b764a9 100644
--- a/core/api/src/test/java/org/onosproject/net/intent/constraint/LatencyConstraintTest.java
+++ b/core/api/src/test/java/org/onosproject/net/intent/constraint/LatencyConstraintTest.java
@@ -91,7 +91,7 @@
      */
     @Test
     public void testLessThanLatency() {
-        sut = new LatencyConstraint(Duration.of(10, ChronoUnit.MICROS));
+        sut = new LatencyConstraint(Duration.of(10, ChronoUnit.NANOS));
 
         assertThat(sut.validate(path, resourceContext), is(true));
     }
@@ -101,7 +101,7 @@
      */
     @Test
     public void testMoreThanLatency() {
-        sut = new LatencyConstraint(Duration.of(3, ChronoUnit.MICROS));
+        sut = new LatencyConstraint(Duration.of(3, ChronoUnit.NANOS));
 
         assertThat(sut.validate(path, resourceContext), is(false));
     }
@@ -111,7 +111,7 @@
      */
     @Test
     public void testCost() {
-        sut = new LatencyConstraint(Duration.of(10, ChronoUnit.MICROS));
+        sut = new LatencyConstraint(Duration.of(10, ChronoUnit.NANOS));
 
         assertThat(sut.cost(link1, resourceContext), is(closeTo(Double.parseDouble(LATENCY1), 1.0e-6)));
         assertThat(sut.cost(link2, resourceContext), is(closeTo(Double.parseDouble(LATENCY2), 1.0e-6)));