Jonathan Hart

Cleaned up inconsistency in OpticalConnectivityIntent API.

Change-Id: I76b629aa8f4cf95a224da49780b3eca275b9acfc
...@@ -19,13 +19,12 @@ import org.onlab.onos.core.ApplicationId; ...@@ -19,13 +19,12 @@ import org.onlab.onos.core.ApplicationId;
19 import org.onlab.onos.net.ConnectPoint; 19 import org.onlab.onos.net.ConnectPoint;
20 20
21 /** 21 /**
22 - * An optical layer Intent for a connectivity from one Transponder port to another 22 + * An optical layer intent for connectivity from one transponder port to another
23 - * Transponder port. No trafficSelector as well as trafficTreament are needed. 23 + * transponder port. No traffic selector or traffic treatment are needed.
24 - *
25 */ 24 */
26 public class OpticalConnectivityIntent extends Intent { 25 public class OpticalConnectivityIntent extends Intent {
27 - protected ConnectPoint src; 26 + protected final ConnectPoint src;
28 - protected ConnectPoint dst; 27 + protected final ConnectPoint dst;
29 28
30 /** 29 /**
31 * Creates an optical connectivity intent between the specified 30 * Creates an optical connectivity intent between the specified
...@@ -35,7 +34,8 @@ public class OpticalConnectivityIntent extends Intent { ...@@ -35,7 +34,8 @@ public class OpticalConnectivityIntent extends Intent {
35 * @param src the source transponder port 34 * @param src the source transponder port
36 * @param dst the destination transponder port 35 * @param dst the destination transponder port
37 */ 36 */
38 - public OpticalConnectivityIntent(ApplicationId appId, ConnectPoint src, ConnectPoint dst) { 37 + public OpticalConnectivityIntent(ApplicationId appId,
38 + ConnectPoint src, ConnectPoint dst) {
39 super(id(OpticalConnectivityIntent.class, src, dst), 39 super(id(OpticalConnectivityIntent.class, src, dst),
40 appId, null); 40 appId, null);
41 this.src = src; 41 this.src = src;
...@@ -56,7 +56,7 @@ public class OpticalConnectivityIntent extends Intent { ...@@ -56,7 +56,7 @@ public class OpticalConnectivityIntent extends Intent {
56 * 56 *
57 * @return source transponder port 57 * @return source transponder port
58 */ 58 */
59 - public ConnectPoint getSrcConnectPoint() { 59 + public ConnectPoint getSrc() {
60 return src; 60 return src;
61 } 61 }
62 62
......
...@@ -65,9 +65,9 @@ public class OpticalConnectivityIntentCompiler implements IntentCompiler<Optical ...@@ -65,9 +65,9 @@ public class OpticalConnectivityIntentCompiler implements IntentCompiler<Optical
65 List<Intent> installable, 65 List<Intent> installable,
66 Set<LinkResourceAllocations> resources) { 66 Set<LinkResourceAllocations> resources) {
67 // TODO: compute multiple paths using the K-shortest path algorithm 67 // TODO: compute multiple paths using the K-shortest path algorithm
68 - Path path = calculateOpticalPath(intent.getSrcConnectPoint(), intent.getDst()); 68 + Path path = calculateOpticalPath(intent.getSrc(), intent.getDst());
69 Intent newIntent = new OpticalPathIntent(intent.appId(), 69 Intent newIntent = new OpticalPathIntent(intent.appId(),
70 - intent.getSrcConnectPoint(), 70 + intent.getSrc(),
71 intent.getDst(), 71 intent.getDst(),
72 path); 72 path);
73 return ImmutableList.of(newIntent); 73 return ImmutableList.of(newIntent);
......
...@@ -377,7 +377,7 @@ public class TopologyViewWebSocket ...@@ -377,7 +377,7 @@ public class TopologyViewWebSocket
377 // Indicates whether the specified intent involves all of the given edge points. 377 // Indicates whether the specified intent involves all of the given edge points.
378 private boolean isIntentRelevant(OpticalConnectivityIntent opticalIntent, 378 private boolean isIntentRelevant(OpticalConnectivityIntent opticalIntent,
379 Set<Intent> intents) { 379 Set<Intent> intents) {
380 - Link ccSrc = getFirstLink(opticalIntent.getSrcConnectPoint(), false); 380 + Link ccSrc = getFirstLink(opticalIntent.getSrc(), false);
381 Link ccDst = getFirstLink(opticalIntent.getDst(), true); 381 Link ccDst = getFirstLink(opticalIntent.getDst(), true);
382 382
383 for (Intent intent : intents) { 383 for (Intent intent : intents) {
......