optical intent module

Change-Id: Ifa405ab1d883b293d349f1b66d26a05a0724691f
diff --git a/core/api/src/main/java/org/onlab/onos/net/intent/OpticalConnectivityIntent.java b/core/api/src/main/java/org/onlab/onos/net/intent/OpticalConnectivityIntent.java
index 4e4ebe5..6e595c5 100644
--- a/core/api/src/main/java/org/onlab/onos/net/intent/OpticalConnectivityIntent.java
+++ b/core/api/src/main/java/org/onlab/onos/net/intent/OpticalConnectivityIntent.java
@@ -1,13 +1,14 @@
 package org.onlab.onos.net.intent;
 
+import org.onlab.onos.ApplicationId;
 import org.onlab.onos.net.ConnectPoint;
 
 /**
- * An optical layer Intent for a connectivity from a Transponder port to another
+ * An optical layer Intent for a connectivity from one Transponder port to another
  * Transponder port. No trafficSelector as well as trafficTreament are needed.
  *
  */
-public class OpticalConnectivityIntent extends AbstractIntent {
+public class OpticalConnectivityIntent extends Intent {
     protected ConnectPoint src;
     protected ConnectPoint dst;
 
@@ -18,8 +19,9 @@
      * @param src The source transponder port.
      * @param dst The destination transponder port.
      */
-    public OpticalConnectivityIntent(IntentId id, ConnectPoint src, ConnectPoint dst) {
-        super(id);
+    public OpticalConnectivityIntent(ApplicationId appId, ConnectPoint src, ConnectPoint dst) {
+        super(id(OpticalConnectivityIntent.class, src, dst),
+                appId, null);
         this.src = src;
         this.dst = dst;
     }
diff --git a/core/api/src/main/java/org/onlab/onos/net/intent/OpticalPathIntent.java b/core/api/src/main/java/org/onlab/onos/net/intent/OpticalPathIntent.java
index d0d73d9..1ad828d 100644
--- a/core/api/src/main/java/org/onlab/onos/net/intent/OpticalPathIntent.java
+++ b/core/api/src/main/java/org/onlab/onos/net/intent/OpticalPathIntent.java
@@ -1,8 +1,8 @@
 package org.onlab.onos.net.intent;
 
 import java.util.Collection;
-import java.util.Objects;
 
+import org.onlab.onos.ApplicationId;
 import org.onlab.onos.net.ConnectPoint;
 import org.onlab.onos.net.Link;
 import org.onlab.onos.net.Path;
@@ -11,15 +11,18 @@
 
 import com.google.common.base.MoreObjects;
 
-public class OpticalPathIntent extends OpticalConnectivityIntent implements InstallableIntent {
-
+public class OpticalPathIntent extends OpticalConnectivityIntent {
     private final Path path;
     private final TrafficSelector opticalMatch;
     private final TrafficTreatment opticalAction;
 
-    public OpticalPathIntent(IntentId id, TrafficSelector match, TrafficTreatment action,
-                      ConnectPoint ingressPort, ConnectPoint egressPort,
-                      Path path) {
+    public OpticalPathIntent(ApplicationId appId,
+            ConnectPoint src,
+            ConnectPoint dst,
+            TrafficSelector match,
+            TrafficTreatment action,
+            Path path) {
+        super(appId, src, dst);
         this.opticalMatch = match;
         this.opticalAction = action;
         this.path = path;
@@ -44,32 +47,11 @@
     }
 
     @Override
-    public boolean equals(Object o) {
-        if (this == o) {
-            return true;
-        }
-        if (o == null || getClass() != o.getClass()) {
-            return false;
-        }
-        if (!super.equals(o)) {
-            return false;
-        }
-
-        OpticalPathIntent that = (OpticalPathIntent) o;
-
-        if (!path.equals(that.path)) {
-            return false;
-        }
-
+    public boolean isInstallable() {
         return true;
     }
 
     @Override
-    public int hashCode() {
-        return Objects.hash(super.hashCode(), path);
-    }
-
-    @Override
     public String toString() {
         return MoreObjects.toStringHelper(getClass())
                 .add("id", id())
@@ -81,7 +63,6 @@
                 .toString();
     }
 
-    @Override
     public Collection<Link> requiredLinks() {
         return path.links();
     }