mirror of https://github.com/apache/cloudstack.git
FR23 plugable isolation methods
FR23 plugable isolation methods This is brought to the public version as CLOUDSTACK-10007
This commit is contained in:
parent
c1118c2a4e
commit
576b4c7c27
|
|
@ -16,12 +16,16 @@
|
|||
// under the License.
|
||||
package com.cloud.network;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.cloud.exception.CloudException;
|
||||
import com.cloud.utils.Pair;
|
||||
import com.cloud.utils.StringUtils;
|
||||
import org.apache.cloudstack.api.Identity;
|
||||
import org.apache.cloudstack.api.InternalIdentity;
|
||||
|
||||
import com.cloud.utils.Pair;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
@ -32,8 +36,101 @@ public interface PhysicalNetwork extends Identity, InternalIdentity {
|
|||
Disabled, Enabled;
|
||||
}
|
||||
|
||||
public enum IsolationMethod {
|
||||
VLAN, L3, GRE, STT, VNS, MIDO, SSP, VXLAN, ODL, L3VPN, VSP, VCS;
|
||||
public class IsolationMethod {
|
||||
protected static final String UNKNOWN_PROVIDER = "Unknown";
|
||||
static Set<IsolationMethod> registeredIsolationMethods = new HashSet<>();
|
||||
|
||||
String methodPrefix;
|
||||
String provider;
|
||||
|
||||
public IsolationMethod(String prfx) {
|
||||
this(prfx, UNKNOWN_PROVIDER);
|
||||
}
|
||||
|
||||
public IsolationMethod(String prfx, String prvdr) {
|
||||
methodPrefix = prfx;
|
||||
provider = StringUtils.isNotBlank(prvdr)? prvdr : UNKNOWN_PROVIDER;
|
||||
registeredIsolationMethods.add(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* gets a IsolationMethod object that defines this prefix and if any it returns the first one found that has a known provider. If none has a known provider
|
||||
* it will return the one with the unknown provider. if none is found it return null.
|
||||
*
|
||||
* @param prfx
|
||||
* @return
|
||||
*/
|
||||
public static IsolationMethod getIsolationMethod(String prfx) throws IsolationMethodNotRegistered {
|
||||
IsolationMethod rc = null;
|
||||
for (IsolationMethod method: registeredIsolationMethods) {
|
||||
if (method.methodPrefix.equals(prfx)) {
|
||||
rc = method;
|
||||
if(! rc.provider.equals(UNKNOWN_PROVIDER)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (rc == null) {
|
||||
throw new IsolationMethodNotRegistered("No registration of prefix '" + prfx + "' found.");
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
||||
public static IsolationMethod getIsolationMethod(String prfx, String provider) throws IsolationMethodNotRegistered {
|
||||
for (IsolationMethod method: registeredIsolationMethods) {
|
||||
if (method.methodPrefix.equals(prfx) && method.provider.equals(provider)) {
|
||||
return method;
|
||||
}
|
||||
}
|
||||
throw new IsolationMethodNotRegistered("No registration of prefix '" + prfx + "' for provider '" + provider + "' found.");
|
||||
}
|
||||
|
||||
static class IsolationMethodNotRegistered extends CloudException {
|
||||
IsolationMethodNotRegistered (String message) {
|
||||
super(message);
|
||||
}
|
||||
}
|
||||
|
||||
public String getMethodPrefix() {
|
||||
return methodPrefix;
|
||||
}
|
||||
|
||||
public String getProvider() {
|
||||
return provider;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o)
|
||||
return true;
|
||||
if (o == null || getClass() != o.getClass())
|
||||
return false;
|
||||
IsolationMethod that = (IsolationMethod)o;
|
||||
return Objects.equals(methodPrefix, that.methodPrefix) && Objects.equals(provider, that.provider);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(methodPrefix, provider);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return methodPrefix;
|
||||
}
|
||||
|
||||
public static boolean remove(String prfx, String prvdr) {
|
||||
prvdr = StringUtils.isNotBlank(prvdr)? prvdr : UNKNOWN_PROVIDER;
|
||||
try {
|
||||
return remove(getIsolationMethod(prfx, prvdr));
|
||||
} catch (IsolationMethodNotRegistered isolationMethodNotRegistered) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean remove(IsolationMethod method) {
|
||||
return registeredIsolationMethods.remove(method);
|
||||
}
|
||||
}
|
||||
|
||||
public enum BroadcastDomainRange {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,73 @@
|
|||
package com.cloud.network;
|
||||
|
||||
import org.junit.After;
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
|
||||
public class IsolationMethodTest {
|
||||
@After
|
||||
public void cleanTheRegistry() {
|
||||
PhysicalNetwork.IsolationMethod.registeredIsolationMethods.removeAll(PhysicalNetwork.IsolationMethod.registeredIsolationMethods);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void equalsTest() throws Exception {
|
||||
PhysicalNetwork.IsolationMethod method = new PhysicalNetwork.IsolationMethod("bla");
|
||||
assertEquals(PhysicalNetwork.IsolationMethod.UNKNOWN_PROVIDER, method.provider);
|
||||
assertEquals(new PhysicalNetwork.IsolationMethod("bla", PhysicalNetwork.IsolationMethod.UNKNOWN_PROVIDER), method);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void toStringTest() throws Exception {
|
||||
PhysicalNetwork.IsolationMethod method = new PhysicalNetwork.IsolationMethod("bla", "blob");
|
||||
assertEquals("bla", method.toString());
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getGeneric() throws Exception {
|
||||
PhysicalNetwork.IsolationMethod method = new PhysicalNetwork.IsolationMethod("bla", "blob");
|
||||
method = new PhysicalNetwork.IsolationMethod("bla");
|
||||
|
||||
assertEquals("blob",PhysicalNetwork.IsolationMethod.getIsolationMethod("bla").getProvider());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void removeUnregistered() throws Exception {
|
||||
assertFalse(PhysicalNetwork.IsolationMethod.remove("bla", "blob"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void removeSuccesfulGeneric() throws Exception {
|
||||
PhysicalNetwork.IsolationMethod method = new PhysicalNetwork.IsolationMethod("bla", "blob");
|
||||
method = new PhysicalNetwork.IsolationMethod("bla");
|
||||
|
||||
PhysicalNetwork.IsolationMethod.remove("bla", "blob");
|
||||
assertEquals(PhysicalNetwork.IsolationMethod.UNKNOWN_PROVIDER,PhysicalNetwork.IsolationMethod.getIsolationMethod("bla").getProvider());
|
||||
}
|
||||
|
||||
@Test(expected= PhysicalNetwork.IsolationMethod.IsolationMethodNotRegistered.class)
|
||||
public void removeSuccesfulSpecificByString() throws Exception {
|
||||
PhysicalNetwork.IsolationMethod method = new PhysicalNetwork.IsolationMethod("bla", "blob");
|
||||
|
||||
PhysicalNetwork.IsolationMethod.remove("bla", "blob");
|
||||
PhysicalNetwork.IsolationMethod.getIsolationMethod("bla");
|
||||
}
|
||||
|
||||
@Test(expected= PhysicalNetwork.IsolationMethod.IsolationMethodNotRegistered.class)
|
||||
public void removeSuccesfulSpecificObject() throws Exception {
|
||||
PhysicalNetwork.IsolationMethod method = new PhysicalNetwork.IsolationMethod("bla");
|
||||
|
||||
PhysicalNetwork.IsolationMethod.remove(method);
|
||||
PhysicalNetwork.IsolationMethod.getIsolationMethod("bla");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getIsolationMethodTest() throws Exception {
|
||||
PhysicalNetwork.IsolationMethod method = new PhysicalNetwork.IsolationMethod("bla");
|
||||
final PhysicalNetwork.IsolationMethod isolationMethod = PhysicalNetwork.IsolationMethod.getIsolationMethod("bla");
|
||||
assertEquals(method, isolationMethod);
|
||||
}
|
||||
}
|
||||
|
|
@ -19,15 +19,6 @@
|
|||
|
||||
package com.cloud.network.guru;
|
||||
|
||||
import java.net.URI;
|
||||
import java.net.URISyntaxException;
|
||||
import java.util.List;
|
||||
|
||||
import javax.ejb.Local;
|
||||
import javax.inject.Inject;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.agent.AgentManager;
|
||||
import com.cloud.agent.api.CreateVnsNetworkAnswer;
|
||||
import com.cloud.agent.api.CreateVnsNetworkCommand;
|
||||
|
|
@ -61,6 +52,13 @@ import com.cloud.user.dao.AccountDao;
|
|||
import com.cloud.vm.NicProfile;
|
||||
import com.cloud.vm.ReservationContext;
|
||||
import com.cloud.vm.VirtualMachineProfile;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import javax.ejb.Local;
|
||||
import javax.inject.Inject;
|
||||
import java.net.URI;
|
||||
import java.net.URISyntaxException;
|
||||
import java.util.List;
|
||||
|
||||
@Local(value = NetworkGuru.class)
|
||||
public class BigSwitchVnsGuestNetworkGuru extends GuestNetworkGuru {
|
||||
|
|
@ -85,7 +83,7 @@ public class BigSwitchVnsGuestNetworkGuru extends GuestNetworkGuru {
|
|||
|
||||
public BigSwitchVnsGuestNetworkGuru() {
|
||||
super();
|
||||
_isolationMethods = new IsolationMethod[] {IsolationMethod.VNS};
|
||||
_isolationMethods = new IsolationMethod[] {new IsolationMethod("VNS")};
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -16,13 +16,6 @@
|
|||
// under the License.
|
||||
package com.cloud.network.guru;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.ejb.Local;
|
||||
import javax.inject.Inject;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.agent.AgentManager;
|
||||
import com.cloud.agent.api.AssociateMacToNetworkAnswer;
|
||||
import com.cloud.agent.api.AssociateMacToNetworkCommand;
|
||||
|
|
@ -62,6 +55,11 @@ import com.cloud.user.Account;
|
|||
import com.cloud.vm.NicProfile;
|
||||
import com.cloud.vm.ReservationContext;
|
||||
import com.cloud.vm.VirtualMachineProfile;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import javax.ejb.Local;
|
||||
import javax.inject.Inject;
|
||||
import java.util.List;
|
||||
|
||||
@Local(value = NetworkGuru.class)
|
||||
public class BrocadeVcsGuestNetworkGuru extends GuestNetworkGuru {
|
||||
|
|
@ -84,7 +82,7 @@ public class BrocadeVcsGuestNetworkGuru extends GuestNetworkGuru {
|
|||
|
||||
public BrocadeVcsGuestNetworkGuru() {
|
||||
super();
|
||||
_isolationMethods = new IsolationMethod[] {IsolationMethod.VCS};
|
||||
_isolationMethods = new IsolationMethod[] {new IsolationMethod("VCS")};
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -19,12 +19,6 @@
|
|||
|
||||
package com.cloud.network.guru;
|
||||
|
||||
import javax.ejb.Local;
|
||||
import javax.inject.Inject;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import com.cloud.dc.DataCenter.NetworkType;
|
||||
import com.cloud.deploy.DeployDestination;
|
||||
import com.cloud.deploy.DeploymentPlan;
|
||||
|
|
@ -43,6 +37,11 @@ import com.cloud.user.dao.AccountDao;
|
|||
import com.cloud.vm.NicProfile;
|
||||
import com.cloud.vm.ReservationContext;
|
||||
import com.cloud.vm.VirtualMachineProfile;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.ejb.Local;
|
||||
import javax.inject.Inject;
|
||||
|
||||
@Component
|
||||
@Local(value = NetworkGuru.class)
|
||||
|
|
@ -54,7 +53,7 @@ public class MidoNetGuestNetworkGuru extends GuestNetworkGuru {
|
|||
|
||||
public MidoNetGuestNetworkGuru() {
|
||||
super();
|
||||
_isolationMethods = new PhysicalNetwork.IsolationMethod[] {PhysicalNetwork.IsolationMethod.MIDO};
|
||||
_isolationMethods = new PhysicalNetwork.IsolationMethod[] {new PhysicalNetwork.IsolationMethod("MIDO")};
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -19,15 +19,6 @@
|
|||
|
||||
package com.cloud.network.guru;
|
||||
|
||||
import java.net.URI;
|
||||
import java.net.URISyntaxException;
|
||||
import java.util.List;
|
||||
|
||||
import javax.ejb.Local;
|
||||
import javax.inject.Inject;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.agent.AgentManager;
|
||||
import com.cloud.agent.api.CreateLogicalSwitchAnswer;
|
||||
import com.cloud.agent.api.CreateLogicalSwitchCommand;
|
||||
|
|
@ -66,6 +57,13 @@ import com.cloud.user.dao.AccountDao;
|
|||
import com.cloud.vm.NicProfile;
|
||||
import com.cloud.vm.ReservationContext;
|
||||
import com.cloud.vm.VirtualMachineProfile;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import javax.ejb.Local;
|
||||
import javax.inject.Inject;
|
||||
import java.net.URI;
|
||||
import java.net.URISyntaxException;
|
||||
import java.util.List;
|
||||
|
||||
@Local(value = NetworkGuru.class)
|
||||
public class NiciraNvpGuestNetworkGuru extends GuestNetworkGuru {
|
||||
|
|
@ -98,7 +96,7 @@ public class NiciraNvpGuestNetworkGuru extends GuestNetworkGuru {
|
|||
|
||||
public NiciraNvpGuestNetworkGuru() {
|
||||
super();
|
||||
_isolationMethods = new IsolationMethod[] {IsolationMethod.STT};
|
||||
_isolationMethods = new IsolationMethod[] {new IsolationMethod("STT")};
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ public class NuageVspGuestNetworkGuru extends GuestNetworkGuru {
|
|||
|
||||
public NuageVspGuestNetworkGuru() {
|
||||
super();
|
||||
_isolationMethods = new IsolationMethod[] {IsolationMethod.VSP};
|
||||
_isolationMethods = new IsolationMethod[] {new IsolationMethod("VSP")};
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -413,4 +413,4 @@ public class NuageVspGuestNetworkGuru extends GuestNetworkGuru {
|
|||
}
|
||||
return nuageVspHost;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,26 +19,6 @@
|
|||
|
||||
package org.apache.cloudstack.network.opendaylight;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import org.apache.cloudstack.network.opendaylight.agent.commands.AddHypervisorCommand;
|
||||
import org.apache.cloudstack.network.opendaylight.agent.commands.ConfigureNetworkCommand;
|
||||
import org.apache.cloudstack.network.opendaylight.agent.commands.ConfigurePortCommand;
|
||||
import org.apache.cloudstack.network.opendaylight.agent.commands.DestroyNetworkCommand;
|
||||
import org.apache.cloudstack.network.opendaylight.agent.commands.DestroyPortCommand;
|
||||
import org.apache.cloudstack.network.opendaylight.agent.responses.AddHypervisorAnswer;
|
||||
import org.apache.cloudstack.network.opendaylight.agent.responses.ConfigureNetworkAnswer;
|
||||
import org.apache.cloudstack.network.opendaylight.agent.responses.ConfigurePortAnswer;
|
||||
import org.apache.cloudstack.network.opendaylight.agent.responses.DestroyNetworkAnswer;
|
||||
import org.apache.cloudstack.network.opendaylight.agent.responses.DestroyPortAnswer;
|
||||
import org.apache.cloudstack.network.opendaylight.dao.OpenDaylightControllerMappingDao;
|
||||
import org.apache.cloudstack.network.opendaylight.dao.OpenDaylightControllerVO;
|
||||
|
||||
import com.cloud.agent.AgentManager;
|
||||
import com.cloud.dc.DataCenter;
|
||||
import com.cloud.dc.DataCenter.NetworkType;
|
||||
|
|
@ -68,6 +48,23 @@ import com.cloud.utils.exception.CloudRuntimeException;
|
|||
import com.cloud.vm.NicProfile;
|
||||
import com.cloud.vm.ReservationContext;
|
||||
import com.cloud.vm.VirtualMachineProfile;
|
||||
import org.apache.cloudstack.network.opendaylight.agent.commands.AddHypervisorCommand;
|
||||
import org.apache.cloudstack.network.opendaylight.agent.commands.ConfigureNetworkCommand;
|
||||
import org.apache.cloudstack.network.opendaylight.agent.commands.ConfigurePortCommand;
|
||||
import org.apache.cloudstack.network.opendaylight.agent.commands.DestroyNetworkCommand;
|
||||
import org.apache.cloudstack.network.opendaylight.agent.commands.DestroyPortCommand;
|
||||
import org.apache.cloudstack.network.opendaylight.agent.responses.AddHypervisorAnswer;
|
||||
import org.apache.cloudstack.network.opendaylight.agent.responses.ConfigureNetworkAnswer;
|
||||
import org.apache.cloudstack.network.opendaylight.agent.responses.ConfigurePortAnswer;
|
||||
import org.apache.cloudstack.network.opendaylight.agent.responses.DestroyNetworkAnswer;
|
||||
import org.apache.cloudstack.network.opendaylight.agent.responses.DestroyPortAnswer;
|
||||
import org.apache.cloudstack.network.opendaylight.dao.OpenDaylightControllerMappingDao;
|
||||
import org.apache.cloudstack.network.opendaylight.dao.OpenDaylightControllerVO;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
public class OpendaylightGuestNetworkGuru extends GuestNetworkGuru {
|
||||
private static final Logger s_logger = Logger.getLogger(OpendaylightGuestNetworkGuru.class);
|
||||
|
|
@ -86,7 +83,7 @@ public class OpendaylightGuestNetworkGuru extends GuestNetworkGuru {
|
|||
NetworkDao networkDao;
|
||||
|
||||
public OpendaylightGuestNetworkGuru() {
|
||||
_isolationMethods = new IsolationMethod[] {IsolationMethod.ODL};
|
||||
_isolationMethods = new IsolationMethod[] {new IsolationMethod("ODL")};
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -16,16 +16,6 @@
|
|||
// under the License.
|
||||
package com.cloud.network.guru;
|
||||
|
||||
import com.cloud.network.vpc.VpcVO;
|
||||
import com.cloud.network.vpc.dao.VpcDao;
|
||||
import javax.ejb.Local;
|
||||
import javax.inject.Inject;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import org.apache.cloudstack.context.CallContext;
|
||||
|
||||
import com.cloud.dc.DataCenter;
|
||||
import com.cloud.dc.DataCenter.NetworkType;
|
||||
import com.cloud.deploy.DeployDestination;
|
||||
|
|
@ -46,12 +36,20 @@ import com.cloud.network.PhysicalNetwork.IsolationMethod;
|
|||
import com.cloud.network.dao.NetworkVO;
|
||||
import com.cloud.network.dao.PhysicalNetworkVO;
|
||||
import com.cloud.network.ovs.OvsTunnelManager;
|
||||
import com.cloud.network.vpc.VpcVO;
|
||||
import com.cloud.network.vpc.dao.VpcDao;
|
||||
import com.cloud.offering.NetworkOffering;
|
||||
import com.cloud.offerings.dao.NetworkOfferingServiceMapDao;
|
||||
import com.cloud.user.Account;
|
||||
import com.cloud.vm.NicProfile;
|
||||
import com.cloud.vm.ReservationContext;
|
||||
import com.cloud.vm.VirtualMachineProfile;
|
||||
import org.apache.cloudstack.context.CallContext;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.ejb.Local;
|
||||
import javax.inject.Inject;
|
||||
|
||||
@Component
|
||||
@Local(value = NetworkGuru.class)
|
||||
|
|
@ -68,8 +66,8 @@ public class OvsGuestNetworkGuru extends GuestNetworkGuru {
|
|||
|
||||
OvsGuestNetworkGuru() {
|
||||
super();
|
||||
_isolationMethods = new IsolationMethod[] {IsolationMethod.GRE,
|
||||
IsolationMethod.L3, IsolationMethod.VLAN};
|
||||
_isolationMethods = new IsolationMethod[] {new IsolationMethod("GRE"),
|
||||
new IsolationMethod("L3"), new IsolationMethod("VLAN")};
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -16,14 +16,6 @@
|
|||
// under the License.
|
||||
package org.apache.cloudstack.network.guru;
|
||||
|
||||
import javax.ejb.Local;
|
||||
import javax.inject.Inject;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import org.apache.cloudstack.network.element.SspElement;
|
||||
import org.apache.cloudstack.network.element.SspManager;
|
||||
|
||||
import com.cloud.dc.DataCenter.NetworkType;
|
||||
import com.cloud.deploy.DeployDestination;
|
||||
import com.cloud.exception.InsufficientAddressCapacityException;
|
||||
|
|
@ -42,6 +34,12 @@ import com.cloud.vm.NicProfile;
|
|||
import com.cloud.vm.ReservationContext;
|
||||
import com.cloud.vm.ReservationContextImpl;
|
||||
import com.cloud.vm.VirtualMachineProfile;
|
||||
import org.apache.cloudstack.network.element.SspElement;
|
||||
import org.apache.cloudstack.network.element.SspManager;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import javax.ejb.Local;
|
||||
import javax.inject.Inject;
|
||||
|
||||
/**
|
||||
* Stratosphere SDN Platform NetworkGuru
|
||||
|
|
@ -59,7 +57,7 @@ public class SspGuestNetworkGuru extends GuestNetworkGuru implements NetworkMigr
|
|||
|
||||
public SspGuestNetworkGuru() {
|
||||
super();
|
||||
_isolationMethods = new IsolationMethod[] {IsolationMethod.SSP};
|
||||
_isolationMethods = new IsolationMethod[] {new IsolationMethod("SSP")};
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -16,13 +16,6 @@
|
|||
// under the License.
|
||||
package com.cloud.network.guru;
|
||||
|
||||
import javax.ejb.Local;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import org.apache.cloudstack.context.CallContext;
|
||||
|
||||
import com.cloud.dc.DataCenter;
|
||||
import com.cloud.dc.DataCenter.NetworkType;
|
||||
import com.cloud.deploy.DeployDestination;
|
||||
|
|
@ -45,6 +38,11 @@ import com.cloud.user.Account;
|
|||
import com.cloud.vm.NicProfile;
|
||||
import com.cloud.vm.ReservationContext;
|
||||
import com.cloud.vm.VirtualMachineProfile;
|
||||
import org.apache.cloudstack.context.CallContext;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.ejb.Local;
|
||||
|
||||
@Component
|
||||
@Local(value = NetworkGuru.class)
|
||||
|
|
@ -53,7 +51,7 @@ public class VxlanGuestNetworkGuru extends GuestNetworkGuru {
|
|||
|
||||
public VxlanGuestNetworkGuru() {
|
||||
super();
|
||||
_isolationMethods = new IsolationMethod[] {IsolationMethod.VXLAN};
|
||||
_isolationMethods = new IsolationMethod[] {new IsolationMethod("VXLAN")};
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -16,16 +16,6 @@
|
|||
// under the License.
|
||||
package com.cloud.network.guru;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.ejb.Local;
|
||||
import javax.inject.Inject;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import org.apache.cloudstack.context.CallContext;
|
||||
import org.apache.cloudstack.engine.orchestration.service.NetworkOrchestrationService;
|
||||
|
||||
import com.cloud.dc.DataCenter;
|
||||
import com.cloud.dc.DataCenter.NetworkType;
|
||||
import com.cloud.dc.dao.DataCenterDao;
|
||||
|
|
@ -43,15 +33,15 @@ import com.cloud.network.Network.State;
|
|||
import com.cloud.network.Networks.BroadcastDomainType;
|
||||
import com.cloud.network.PhysicalNetwork;
|
||||
import com.cloud.network.PhysicalNetwork.IsolationMethod;
|
||||
import com.cloud.network.dao.FirewallRulesCidrsDao;
|
||||
import com.cloud.network.dao.FirewallRulesCidrsVO;
|
||||
import com.cloud.network.dao.FirewallRulesDao;
|
||||
import com.cloud.network.dao.IPAddressDao;
|
||||
import com.cloud.network.dao.IPAddressVO;
|
||||
import com.cloud.network.dao.NetworkDao;
|
||||
import com.cloud.network.dao.NetworkVO;
|
||||
import com.cloud.network.dao.FirewallRulesCidrsDao;
|
||||
import com.cloud.network.dao.FirewallRulesDao;
|
||||
import com.cloud.network.rules.FirewallRule;
|
||||
import com.cloud.network.rules.FirewallRuleVO;
|
||||
import com.cloud.network.dao.FirewallRulesCidrsVO;
|
||||
import com.cloud.network.rules.PortForwardingRuleVO;
|
||||
import com.cloud.network.rules.dao.PortForwardingRulesDao;
|
||||
import com.cloud.offering.NetworkOffering;
|
||||
|
|
@ -65,6 +55,13 @@ import com.cloud.vm.NicProfile;
|
|||
import com.cloud.vm.NicVO;
|
||||
import com.cloud.vm.ReservationContext;
|
||||
import com.cloud.vm.VirtualMachineProfile;
|
||||
import org.apache.cloudstack.context.CallContext;
|
||||
import org.apache.cloudstack.engine.orchestration.service.NetworkOrchestrationService;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import javax.ejb.Local;
|
||||
import javax.inject.Inject;
|
||||
import java.util.List;
|
||||
|
||||
@Local(value = NetworkGuru.class)
|
||||
public class ExternalGuestNetworkGuru extends GuestNetworkGuru {
|
||||
|
|
@ -88,7 +85,7 @@ public class ExternalGuestNetworkGuru extends GuestNetworkGuru {
|
|||
|
||||
public ExternalGuestNetworkGuru() {
|
||||
super();
|
||||
_isolationMethods = new IsolationMethod[] {IsolationMethod.GRE, IsolationMethod.L3, IsolationMethod.VLAN};
|
||||
_isolationMethods = new IsolationMethod[] {new IsolationMethod("GRE"), new IsolationMethod("L3"), new IsolationMethod("VLAN")};
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
Loading…
Reference in New Issue