Hyunsun Moon
Committed by Gerrit Code Review

Removed INDRECT and DIRECT subtypes from network types

Change-Id: I97a35472281a60bc1d109491d193607baf70107c
...@@ -27,18 +27,12 @@ import java.util.Objects; ...@@ -27,18 +27,12 @@ import java.util.Objects;
27 import java.util.Set; 27 import java.util.Set;
28 28
29 import static com.google.common.base.Preconditions.checkNotNull; 29 import static com.google.common.base.Preconditions.checkNotNull;
30 -import static org.onosproject.cordvtn.CordService.ServiceType.*;
31 -import static org.onosproject.cordvtn.CordService.ServiceType.PRIVATE;
32 -import static org.onosproject.cordvtn.CordService.ServiceType.PUBLIC_INDIRECT;
33 30
34 public final class CordService { 31 public final class CordService {
35 32
36 enum ServiceType { 33 enum ServiceType {
37 PRIVATE, 34 PRIVATE,
38 - PRIVATE_DIRECT, 35 + PUBLIC,
39 - PRIVATE_INDIRECT,
40 - PUBLIC_DIRECT,
41 - PUBLIC_INDIRECT,
42 MANAGEMENT 36 MANAGEMENT
43 } 37 }
44 38
...@@ -172,18 +166,12 @@ public final class CordService { ...@@ -172,18 +166,12 @@ public final class CordService {
172 checkNotNull(netName); 166 checkNotNull(netName);
173 167
174 String name = netName.toUpperCase(); 168 String name = netName.toUpperCase();
175 - if (name.contains(PRIVATE_DIRECT.toString())) { 169 + if (name.contains(ServiceType.PUBLIC.toString())) {
176 - return PRIVATE_DIRECT; 170 + return ServiceType.PUBLIC;
177 - } else if (name.contains(PRIVATE_INDIRECT.toString())) { 171 + } else if (name.contains(ServiceType.MANAGEMENT.toString())) {
178 - return PRIVATE_INDIRECT; 172 + return ServiceType.MANAGEMENT;
179 - } else if (name.contains(PUBLIC_DIRECT.toString())) {
180 - return PUBLIC_DIRECT;
181 - } else if (name.contains(PUBLIC_INDIRECT.toString())) {
182 - return PUBLIC_INDIRECT;
183 - } else if (name.contains(MANAGEMENT.toString())) {
184 - return MANAGEMENT;
185 } else { 173 } else {
186 - return PRIVATE; 174 + return ServiceType.PRIVATE;
187 } 175 }
188 } 176 }
189 } 177 }
......
...@@ -559,11 +559,8 @@ public class CordVtn extends AbstractProvider implements CordVtnService, HostPro ...@@ -559,11 +559,8 @@ public class CordVtn extends AbstractProvider implements CordVtnService, HostPro
559 ruleInstaller.populateManagementNetworkRules(host, service); 559 ruleInstaller.populateManagementNetworkRules(host, service);
560 break; 560 break;
561 case PRIVATE: 561 case PRIVATE:
562 - case PRIVATE_INDIRECT:
563 - case PRIVATE_DIRECT:
564 arpProxy.addGateway(service.serviceIp(), privateGatewayMac); 562 arpProxy.addGateway(service.serviceIp(), privateGatewayMac);
565 - case PUBLIC_INDIRECT: 563 + case PUBLIC:
566 - case PUBLIC_DIRECT:
567 default: 564 default:
568 // TODO check if the service needs an update on its group buckets after done CORD-433 565 // TODO check if the service needs an update on its group buckets after done CORD-433
569 ruleInstaller.updateServiceGroup(service); 566 ruleInstaller.updateServiceGroup(service);
...@@ -634,13 +631,10 @@ public class CordVtn extends AbstractProvider implements CordVtnService, HostPro ...@@ -634,13 +631,10 @@ public class CordVtn extends AbstractProvider implements CordVtnService, HostPro
634 ruleInstaller.removeManagementNetworkRules(host, service); 631 ruleInstaller.removeManagementNetworkRules(host, service);
635 break; 632 break;
636 case PRIVATE: 633 case PRIVATE:
637 - case PRIVATE_INDIRECT:
638 - case PRIVATE_DIRECT:
639 if (getHostsWithOpenstackNetwork(vNet).isEmpty()) { 634 if (getHostsWithOpenstackNetwork(vNet).isEmpty()) {
640 arpProxy.removeGateway(service.serviceIp()); 635 arpProxy.removeGateway(service.serviceIp());
641 } 636 }
642 - case PUBLIC_INDIRECT: 637 + case PUBLIC:
643 - case PUBLIC_DIRECT:
644 default: 638 default:
645 // TODO check if the service needs an update on its group buckets after done CORD-433 639 // TODO check if the service needs an update on its group buckets after done CORD-433
646 ruleInstaller.updateServiceGroup(service); 640 ruleInstaller.updateServiceGroup(service);
......