Sho SHIMIZU

Reformat code

Change-Id: Icde0d7e8806f59da99082089a83dda26b23d12a8
...@@ -521,14 +521,11 @@ public class FlowRuleManager ...@@ -521,14 +521,11 @@ public class FlowRuleManager
521 request.ops().stream().forEach( 521 request.ops().stream().forEach(
522 op -> { 522 op -> {
523 switch (op.operator()) { 523 switch (op.operator()) {
524 -
525 case ADD: 524 case ADD:
526 - post(new FlowRuleEvent(RULE_ADD_REQUESTED, 525 + post(new FlowRuleEvent(RULE_ADD_REQUESTED, op.target()));
527 - op.target()));
528 break; 526 break;
529 case REMOVE: 527 case REMOVE:
530 - post(new FlowRuleEvent(RULE_REMOVE_REQUESTED, 528 + post(new FlowRuleEvent(RULE_REMOVE_REQUESTED, op.target()));
531 - op.target()));
532 break; 529 break;
533 case MODIFY: 530 case MODIFY:
534 //TODO: do something here when the time comes. 531 //TODO: do something here when the time comes.
...@@ -540,10 +537,7 @@ public class FlowRuleManager ...@@ -540,10 +537,7 @@ public class FlowRuleManager
540 ); 537 );
541 538
542 DeviceId deviceId = event.deviceId(); 539 DeviceId deviceId = event.deviceId();
543 - 540 + FlowRuleBatchOperation batchOperation = request.asBatchOperation(deviceId);
544 - FlowRuleBatchOperation batchOperation =
545 - request.asBatchOperation(deviceId);
546 -
547 FlowRuleProvider flowRuleProvider = getProvider(deviceId); 541 FlowRuleProvider flowRuleProvider = getProvider(deviceId);
548 if (flowRuleProvider != null) { 542 if (flowRuleProvider != null) {
549 flowRuleProvider.executeBatch(batchOperation); 543 flowRuleProvider.executeBatch(batchOperation);
...@@ -609,8 +603,7 @@ public class FlowRuleManager ...@@ -609,8 +603,7 @@ public class FlowRuleManager
609 } 603 }
610 604
611 private void process(Set<FlowRuleOperation> ops) { 605 private void process(Set<FlowRuleOperation> ops) {
612 - Multimap<DeviceId, FlowRuleBatchEntry> perDeviceBatches = 606 + Multimap<DeviceId, FlowRuleBatchEntry> perDeviceBatches = ArrayListMultimap.create();
613 - ArrayListMultimap.create();
614 607
615 for (FlowRuleOperation flowRuleOperation : ops) { 608 for (FlowRuleOperation flowRuleOperation : ops) {
616 FlowRuleBatchEntry fbe = 609 FlowRuleBatchEntry fbe =
...@@ -619,7 +612,6 @@ public class FlowRuleManager ...@@ -619,7 +612,6 @@ public class FlowRuleManager
619 perDeviceBatches.put(flowRuleOperation.rule().deviceId(), fbe); 612 perDeviceBatches.put(flowRuleOperation.rule().deviceId(), fbe);
620 } 613 }
621 614
622 -
623 for (DeviceId deviceId : perDeviceBatches.keySet()) { 615 for (DeviceId deviceId : perDeviceBatches.keySet()) {
624 long id = idGenerator.getNewId(); 616 long id = idGenerator.getNewId();
625 final FlowRuleBatchOperation b = new FlowRuleBatchOperation(perDeviceBatches.get(deviceId), 617 final FlowRuleBatchOperation b = new FlowRuleBatchOperation(perDeviceBatches.get(deviceId),
...@@ -636,8 +628,6 @@ public class FlowRuleManager ...@@ -636,8 +628,6 @@ public class FlowRuleManager
636 } 628 }
637 } 629 }
638 630
639 -
640 -
641 synchronized void fail(DeviceId devId, Set<? extends FlowRule> failures) { 631 synchronized void fail(DeviceId devId, Set<? extends FlowRule> failures) {
642 hasFailed = true; 632 hasFailed = true;
643 pendingDevices.remove(devId); 633 pendingDevices.remove(devId);
...@@ -653,7 +643,6 @@ public class FlowRuleManager ...@@ -653,7 +643,6 @@ public class FlowRuleManager
653 context.onError(failedOpsBuilder.build()); 643 context.onError(failedOpsBuilder.build());
654 } 644 }
655 } 645 }
656 -
657 } 646 }
658 647
659 @Override 648 @Override
......