refactoring OpticalPathIntent
Change-Id: Ic6ab6237237b2a5019851182b2869110bc5b1b73
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 afa0004..372da91 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
@@ -6,46 +6,45 @@
import org.onlab.onos.net.ConnectPoint;
import org.onlab.onos.net.Link;
import org.onlab.onos.net.Path;
-import org.onlab.onos.net.flow.TrafficSelector;
-import org.onlab.onos.net.flow.TrafficTreatment;
import com.google.common.base.MoreObjects;
-public class OpticalPathIntent extends OpticalConnectivityIntent {
+public class OpticalPathIntent extends ConnectivityIntent {
+
+ private final ConnectPoint src;
+ private final ConnectPoint dst;
private final Path path;
- // private final TrafficSelector opticalMatch;
- // private final TrafficTreatment opticalAction;
+
public OpticalPathIntent(ApplicationId appId,
ConnectPoint src,
ConnectPoint dst,
- TrafficSelector match,
- TrafficTreatment action,
Path path) {
- super(appId, src, dst);
- // this.opticalMatch = match;
- // this.opticalAction = action;
+ super(id(OpticalPathIntent.class, src, dst),
+ appId, resources(path.links()), null, null);
+ this.src = src;
+ this.dst = dst;
this.path = path;
}
protected OpticalPathIntent() {
- // this.opticalMatch = null;
- // this.opticalAction = null;
+ this.src = null;
+ this.dst = null;
this.path = null;
}
+ public ConnectPoint src() {
+ return src;
+ }
+
+ public ConnectPoint dst() {
+ return dst;
+ }
+
public Path path() {
return path;
}
-/*
- public TrafficSelector selector() {
- // return opticalMatch;
- }
- public TrafficTreatment treatment() {
- // return opticalAction;
- }
-*/
@Override
public boolean isInstallable() {
return true;
@@ -55,10 +54,8 @@
public String toString() {
return MoreObjects.toStringHelper(getClass())
.add("id", id())
- //.add("match", opticalMatch)
- //.add("action", opticalAction)
- .add("ingressPort", this.getSrcConnectPoint())
- .add("egressPort", this.getDst())
+ .add("ingressPort", src)
+ .add("egressPort", dst)
.add("path", path)
.toString();
}