weibit

some optical intent changes

Change-Id: Ie9b02e2d199aa72f9828e91b248bd052f7b38fa2
......@@ -93,9 +93,9 @@ public class OpticalConfigProvider extends AbstractProvider implements DevicePro
log.info("Starting optical network configuration process...");
log.info("Optical config file set to {}", configFileName);
// loadOpticalConfig();
// parseOpticalConfig();
// publishOpticalConfig();
loadOpticalConfig();
parseOpticalConfig();
publishOpticalConfig();
}
@Deactivate
......
......@@ -29,7 +29,7 @@ import org.slf4j.Logger;
/**
* Sample reactive forwarding application.
*/
//:@Component(immediate = true)
//@Component(immediate = true)
public class LambdaForwarding {
private final Logger log = getLogger(getClass());
......
......@@ -84,8 +84,8 @@ public class OpticalConnectivityIntentCompiler implements IntentCompiler<Optical
// 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 @@ public class OpticalConnectivityIntentCompiler implements IntentCompiler<Optical
@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) {
......
......@@ -87,8 +87,6 @@ public class OpticalPathIntentInstaller implements IntentInstaller<OpticalPathIn
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 @@ public class OpticalPathIntentInstaller implements IntentInstaller<OpticalPathIn
return null;
}
TrafficTreatment.Builder treatmentBuilder = DefaultTrafficTreatment.builder();
treatmentBuilder.setOutput(link.src().port());
treatmentBuilder.setLambda((short) la.toInt());
......