Cleaned up inconsistency in OpticalConnectivityIntent API.
Change-Id: I76b629aa8f4cf95a224da49780b3eca275b9acfc
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 fdb8668e..361f5dd 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
@@ -19,13 +19,12 @@
import org.onlab.onos.net.ConnectPoint;
/**
- * An optical layer Intent for a connectivity from one Transponder port to another
- * Transponder port. No trafficSelector as well as trafficTreament are needed.
- *
+ * An optical layer intent for connectivity from one transponder port to another
+ * transponder port. No traffic selector or traffic treatment are needed.
*/
public class OpticalConnectivityIntent extends Intent {
- protected ConnectPoint src;
- protected ConnectPoint dst;
+ protected final ConnectPoint src;
+ protected final ConnectPoint dst;
/**
* Creates an optical connectivity intent between the specified
@@ -35,7 +34,8 @@
* @param src the source transponder port
* @param dst the destination transponder port
*/
- public OpticalConnectivityIntent(ApplicationId appId, ConnectPoint src, ConnectPoint dst) {
+ public OpticalConnectivityIntent(ApplicationId appId,
+ ConnectPoint src, ConnectPoint dst) {
super(id(OpticalConnectivityIntent.class, src, dst),
appId, null);
this.src = src;
@@ -56,7 +56,7 @@
*
* @return source transponder port
*/
- public ConnectPoint getSrcConnectPoint() {
+ public ConnectPoint getSrc() {
return src;
}
diff --git a/core/net/src/main/java/org/onlab/onos/net/intent/impl/OpticalConnectivityIntentCompiler.java b/core/net/src/main/java/org/onlab/onos/net/intent/impl/OpticalConnectivityIntentCompiler.java
index 066d730..e5a1203 100644
--- a/core/net/src/main/java/org/onlab/onos/net/intent/impl/OpticalConnectivityIntentCompiler.java
+++ b/core/net/src/main/java/org/onlab/onos/net/intent/impl/OpticalConnectivityIntentCompiler.java
@@ -65,9 +65,9 @@
List<Intent> installable,
Set<LinkResourceAllocations> resources) {
// TODO: compute multiple paths using the K-shortest path algorithm
- Path path = calculateOpticalPath(intent.getSrcConnectPoint(), intent.getDst());
+ Path path = calculateOpticalPath(intent.getSrc(), intent.getDst());
Intent newIntent = new OpticalPathIntent(intent.appId(),
- intent.getSrcConnectPoint(),
+ intent.getSrc(),
intent.getDst(),
path);
return ImmutableList.of(newIntent);
diff --git a/web/gui/src/main/java/org/onlab/onos/gui/TopologyViewWebSocket.java b/web/gui/src/main/java/org/onlab/onos/gui/TopologyViewWebSocket.java
index cc5756c..935ba79 100644
--- a/web/gui/src/main/java/org/onlab/onos/gui/TopologyViewWebSocket.java
+++ b/web/gui/src/main/java/org/onlab/onos/gui/TopologyViewWebSocket.java
@@ -377,7 +377,7 @@
// Indicates whether the specified intent involves all of the given edge points.
private boolean isIntentRelevant(OpticalConnectivityIntent opticalIntent,
Set<Intent> intents) {
- Link ccSrc = getFirstLink(opticalIntent.getSrcConnectPoint(), false);
+ Link ccSrc = getFirstLink(opticalIntent.getSrc(), false);
Link ccDst = getFirstLink(opticalIntent.getDst(), true);
for (Intent intent : intents) {