Committed by
Thomas Vachuska
Reformat code
Change-Id: Icde0d7e8806f59da99082089a83dda26b23d12a8
Showing
1 changed file
with
4 additions
and
15 deletions
... | @@ -542,14 +542,11 @@ public class FlowRuleManager | ... | @@ -542,14 +542,11 @@ public class FlowRuleManager |
542 | request.ops().forEach( | 542 | request.ops().forEach( |
543 | op -> { | 543 | op -> { |
544 | switch (op.operator()) { | 544 | switch (op.operator()) { |
545 | - | ||
546 | case ADD: | 545 | case ADD: |
547 | - post(new FlowRuleEvent(RULE_ADD_REQUESTED, | 546 | + post(new FlowRuleEvent(RULE_ADD_REQUESTED, op.target())); |
548 | - op.target())); | ||
549 | break; | 547 | break; |
550 | case REMOVE: | 548 | case REMOVE: |
551 | - post(new FlowRuleEvent(RULE_REMOVE_REQUESTED, | 549 | + post(new FlowRuleEvent(RULE_REMOVE_REQUESTED, op.target())); |
552 | - op.target())); | ||
553 | break; | 550 | break; |
554 | case MODIFY: | 551 | case MODIFY: |
555 | //TODO: do something here when the time comes. | 552 | //TODO: do something here when the time comes. |
... | @@ -561,10 +558,7 @@ public class FlowRuleManager | ... | @@ -561,10 +558,7 @@ public class FlowRuleManager |
561 | ); | 558 | ); |
562 | 559 | ||
563 | DeviceId deviceId = event.deviceId(); | 560 | DeviceId deviceId = event.deviceId(); |
564 | - | 561 | + FlowRuleBatchOperation batchOperation = request.asBatchOperation(deviceId); |
565 | - FlowRuleBatchOperation batchOperation = | ||
566 | - request.asBatchOperation(deviceId); | ||
567 | - | ||
568 | FlowRuleProvider flowRuleProvider = getProvider(deviceId); | 562 | FlowRuleProvider flowRuleProvider = getProvider(deviceId); |
569 | if (flowRuleProvider != null) { | 563 | if (flowRuleProvider != null) { |
570 | flowRuleProvider.executeBatch(batchOperation); | 564 | flowRuleProvider.executeBatch(batchOperation); |
... | @@ -630,8 +624,7 @@ public class FlowRuleManager | ... | @@ -630,8 +624,7 @@ public class FlowRuleManager |
630 | } | 624 | } |
631 | 625 | ||
632 | private void process(Set<FlowRuleOperation> ops) { | 626 | private void process(Set<FlowRuleOperation> ops) { |
633 | - Multimap<DeviceId, FlowRuleBatchEntry> perDeviceBatches = | 627 | + Multimap<DeviceId, FlowRuleBatchEntry> perDeviceBatches = ArrayListMultimap.create(); |
634 | - ArrayListMultimap.create(); | ||
635 | 628 | ||
636 | for (FlowRuleOperation flowRuleOperation : ops) { | 629 | for (FlowRuleOperation flowRuleOperation : ops) { |
637 | FlowRuleBatchEntry fbe = | 630 | FlowRuleBatchEntry fbe = |
... | @@ -640,7 +633,6 @@ public class FlowRuleManager | ... | @@ -640,7 +633,6 @@ public class FlowRuleManager |
640 | perDeviceBatches.put(flowRuleOperation.rule().deviceId(), fbe); | 633 | perDeviceBatches.put(flowRuleOperation.rule().deviceId(), fbe); |
641 | } | 634 | } |
642 | 635 | ||
643 | - | ||
644 | for (DeviceId deviceId : perDeviceBatches.keySet()) { | 636 | for (DeviceId deviceId : perDeviceBatches.keySet()) { |
645 | long id = idGenerator.getNewId(); | 637 | long id = idGenerator.getNewId(); |
646 | final FlowRuleBatchOperation b = new FlowRuleBatchOperation(perDeviceBatches.get(deviceId), | 638 | final FlowRuleBatchOperation b = new FlowRuleBatchOperation(perDeviceBatches.get(deviceId), |
... | @@ -657,8 +649,6 @@ public class FlowRuleManager | ... | @@ -657,8 +649,6 @@ public class FlowRuleManager |
657 | } | 649 | } |
658 | } | 650 | } |
659 | 651 | ||
660 | - | ||
661 | - | ||
662 | synchronized void fail(DeviceId devId, Set<? extends FlowRule> failures) { | 652 | synchronized void fail(DeviceId devId, Set<? extends FlowRule> failures) { |
663 | hasFailed = true; | 653 | hasFailed = true; |
664 | pendingDevices.remove(devId); | 654 | pendingDevices.remove(devId); |
... | @@ -674,7 +664,6 @@ public class FlowRuleManager | ... | @@ -674,7 +664,6 @@ public class FlowRuleManager |
674 | context.onError(failedOpsBuilder.build()); | 664 | context.onError(failedOpsBuilder.build()); |
675 | } | 665 | } |
676 | } | 666 | } |
677 | - | ||
678 | } | 667 | } |
679 | 668 | ||
680 | @Override | 669 | @Override | ... | ... |
-
Please register or login to post a comment