some optical intent changes
Change-Id: Ie9b02e2d199aa72f9828e91b248bd052f7b38fa2
diff --git a/apps/optical/src/main/java/org/onlab/onos/optical/cfg/OpticalConfigProvider.java b/apps/optical/src/main/java/org/onlab/onos/optical/cfg/OpticalConfigProvider.java
index 61c59a5..cfdeb1f 100644
--- a/apps/optical/src/main/java/org/onlab/onos/optical/cfg/OpticalConfigProvider.java
+++ b/apps/optical/src/main/java/org/onlab/onos/optical/cfg/OpticalConfigProvider.java
@@ -93,9 +93,9 @@
log.info("Starting optical network configuration process...");
log.info("Optical config file set to {}", configFileName);
-// loadOpticalConfig();
-// parseOpticalConfig();
-// publishOpticalConfig();
+ loadOpticalConfig();
+ parseOpticalConfig();
+ publishOpticalConfig();
}
@Deactivate
diff --git a/apps/optical/src/main/java/org/onlab/onos/optical/testapp/LambdaForwarding.java b/apps/optical/src/main/java/org/onlab/onos/optical/testapp/LambdaForwarding.java
index 7d64123..20138c8 100644
--- a/apps/optical/src/main/java/org/onlab/onos/optical/testapp/LambdaForwarding.java
+++ b/apps/optical/src/main/java/org/onlab/onos/optical/testapp/LambdaForwarding.java
@@ -29,7 +29,7 @@
/**
* Sample reactive forwarding application.
*/
-//:@Component(immediate = true)
+//@Component(immediate = true)
public class LambdaForwarding {
private final Logger log = getLogger(getClass());
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 f5272f2..58586dc 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
@@ -84,8 +84,8 @@
// create a new opticalPathIntent
Intent newIntent = new OpticalPathIntent(intent.appId(),
- path.src(),
- path.dst(),
+ intent.getSrcConnectPoint(),
+ intent.getDst(),
path);
retList.add(newIntent);
@@ -100,8 +100,11 @@
@Override
public double weight(TopologyEdge edge) {
boolean isOptical = false;
- String t = edge.link().annotations().value("linkType");
- if (t.equals("WDM")) {
+
+ Link.Type lt = edge.link().type();
+
+ //String t = edge.link().annotations().value("linkType");
+ if (lt == Link.Type.OPTICAL) {
isOptical = true;
}
if (isOptical) {
diff --git a/core/net/src/main/java/org/onlab/onos/net/intent/impl/OpticalPathIntentInstaller.java b/core/net/src/main/java/org/onlab/onos/net/intent/impl/OpticalPathIntentInstaller.java
index 5cfee19..64ac3ea 100644
--- a/core/net/src/main/java/org/onlab/onos/net/intent/impl/OpticalPathIntentInstaller.java
+++ b/core/net/src/main/java/org/onlab/onos/net/intent/impl/OpticalPathIntentInstaller.java
@@ -87,8 +87,6 @@
TrafficSelector.Builder selectorBuilder = DefaultTrafficSelector.builder();
selectorBuilder.matchInport(intent.src().port());
- TrafficTreatment.Builder treatmentBuilder = DefaultTrafficTreatment.builder();
-
List<FlowRuleBatchEntry> rules = Lists.newLinkedList();
ConnectPoint prev = intent.src();
@@ -107,6 +105,7 @@
return null;
}
+ TrafficTreatment.Builder treatmentBuilder = DefaultTrafficTreatment.builder();
treatmentBuilder.setOutput(link.src().port());
treatmentBuilder.setLambda((short) la.toInt());