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;
import java.util.Set;
import static com.google.common.base.Preconditions.checkNotNull;
import static org.onosproject.cordvtn.CordService.ServiceType.*;
import static org.onosproject.cordvtn.CordService.ServiceType.PRIVATE;
import static org.onosproject.cordvtn.CordService.ServiceType.PUBLIC_INDIRECT;
public final class CordService {
enum ServiceType {
PRIVATE,
PRIVATE_DIRECT,
PRIVATE_INDIRECT,
PUBLIC_DIRECT,
PUBLIC_INDIRECT,
PUBLIC,
MANAGEMENT
}
......@@ -172,18 +166,12 @@ public final class CordService {
checkNotNull(netName);
String name = netName.toUpperCase();
if (name.contains(PRIVATE_DIRECT.toString())) {
return PRIVATE_DIRECT;
} else if (name.contains(PRIVATE_INDIRECT.toString())) {
return PRIVATE_INDIRECT;
} else if (name.contains(PUBLIC_DIRECT.toString())) {
return PUBLIC_DIRECT;
} else if (name.contains(PUBLIC_INDIRECT.toString())) {
return PUBLIC_INDIRECT;
} else if (name.contains(MANAGEMENT.toString())) {
return MANAGEMENT;
if (name.contains(ServiceType.PUBLIC.toString())) {
return ServiceType.PUBLIC;
} else if (name.contains(ServiceType.MANAGEMENT.toString())) {
return ServiceType.MANAGEMENT;
} else {
return PRIVATE;
return ServiceType.PRIVATE;
}
}
}
......
......@@ -559,11 +559,8 @@ public class CordVtn extends AbstractProvider implements CordVtnService, HostPro
ruleInstaller.populateManagementNetworkRules(host, service);
break;
case PRIVATE:
case PRIVATE_INDIRECT:
case PRIVATE_DIRECT:
arpProxy.addGateway(service.serviceIp(), privateGatewayMac);
case PUBLIC_INDIRECT:
case PUBLIC_DIRECT:
case PUBLIC:
default:
// TODO check if the service needs an update on its group buckets after done CORD-433
ruleInstaller.updateServiceGroup(service);
......@@ -634,13 +631,10 @@ public class CordVtn extends AbstractProvider implements CordVtnService, HostPro
ruleInstaller.removeManagementNetworkRules(host, service);
break;
case PRIVATE:
case PRIVATE_INDIRECT:
case PRIVATE_DIRECT:
if (getHostsWithOpenstackNetwork(vNet).isEmpty()) {
arpProxy.removeGateway(service.serviceIp());
}
case PUBLIC_INDIRECT:
case PUBLIC_DIRECT:
case PUBLIC:
default:
// TODO check if the service needs an update on its group buckets after done CORD-433
ruleInstaller.updateServiceGroup(service);
......