Brian O'Connor
Committed by Gerrit Code Review

Some fixes for the optical app

Change-Id: Ib3e317ad080d822ac41b1cf113ba388a7ce78316
...@@ -101,14 +101,19 @@ public class OpticalPathIntentInstaller implements IntentInstaller<OpticalPathIn ...@@ -101,14 +101,19 @@ public class OpticalPathIntentInstaller implements IntentInstaller<OpticalPathIn
101 @Override 101 @Override
102 public List<FlowRuleBatchOperation> uninstall(OpticalPathIntent intent) { 102 public List<FlowRuleBatchOperation> uninstall(OpticalPathIntent intent) {
103 LinkResourceAllocations allocations = resourceService.getAllocations(intent.id()); 103 LinkResourceAllocations allocations = resourceService.getAllocations(intent.id());
104 - return generateRules(intent, allocations, FlowRuleOperation.REMOVE); 104 + List<FlowRuleBatchOperation> rules = generateRules(intent, allocations, FlowRuleOperation.REMOVE);
105 + log.info("uninstall rules: {}", rules);
106 + return rules;
105 } 107 }
106 108
107 @Override 109 @Override
108 - public List<FlowRuleBatchOperation> replace(OpticalPathIntent intent, 110 + public List<FlowRuleBatchOperation> replace(OpticalPathIntent oldIntent,
109 OpticalPathIntent newIntent) { 111 OpticalPathIntent newIntent) {
110 // FIXME: implement this 112 // FIXME: implement this
111 - return null; 113 + List<FlowRuleBatchOperation> batches = Lists.newArrayList();
114 + batches.addAll(uninstall(oldIntent));
115 + batches.addAll(install(newIntent));
116 + return batches;
112 } 117 }
113 118
114 private LinkResourceAllocations assignWavelength(OpticalPathIntent intent) { 119 private LinkResourceAllocations assignWavelength(OpticalPathIntent intent) {
......