Jonathan Hart

Cleaned up inconsistency in OpticalConnectivityIntent API.

Change-Id: I76b629aa8f4cf95a224da49780b3eca275b9acfc
......@@ -19,13 +19,12 @@ import org.onlab.onos.core.ApplicationId;
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 @@ public class OpticalConnectivityIntent extends Intent {
* @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 @@ public class OpticalConnectivityIntent extends Intent {
*
* @return source transponder port
*/
public ConnectPoint getSrcConnectPoint() {
public ConnectPoint getSrc() {
return src;
}
......
......@@ -65,9 +65,9 @@ public class OpticalConnectivityIntentCompiler implements IntentCompiler<Optical
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);
......
......@@ -377,7 +377,7 @@ public class TopologyViewWebSocket
// 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) {
......