http://git-wip-us.apache.org/repos/asf/cloudstack/blob/12b0d188/server/src/org/apache/cloudstack/network/topology/BasicNetworkVisitor.java ---------------------------------------------------------------------- diff --git a/server/src/org/apache/cloudstack/network/topology/BasicNetworkVisitor.java b/server/src/org/apache/cloudstack/network/topology/BasicNetworkVisitor.java index d95ca03..7dddb81 100644 --- a/server/src/org/apache/cloudstack/network/topology/BasicNetworkVisitor.java +++ b/server/src/org/apache/cloudstack/network/topology/BasicNetworkVisitor.java @@ -32,8 +32,10 @@ import com.cloud.network.Network; import com.cloud.network.PublicIpAddress; import com.cloud.network.VpnUser; import com.cloud.network.lb.LoadBalancingRule; +import com.cloud.network.router.VirtualNetworkApplianceManager; import com.cloud.network.router.VirtualRouter; import com.cloud.network.rules.DhcpEntryRules; +import com.cloud.network.rules.DhcpSubNetRules; import com.cloud.network.rules.FirewallRule; import com.cloud.network.rules.FirewallRule.Purpose; import com.cloud.network.rules.FirewallRules; @@ -68,7 +70,7 @@ public class BasicNetworkVisitor extends NetworkTopologyVisitor { } @Inject - protected NEWVirtualNetworkApplianceManager _applianceManager; + protected VirtualNetworkApplianceManager _applianceManager; @Override public boolean visit(final StaticNatRules nat) throws ResourceUnavailableException { @@ -242,12 +244,12 @@ public class BasicNetworkVisitor extends NetworkTopologyVisitor { @Override public boolean visit(final DhcpPvlanRules vpn) throws ResourceUnavailableException { - return false; + throw new CloudRuntimeException("DhcpPvlanRules not implemented in Basic Network Topology."); } @Override - public boolean visit(final VpnRules userdata) throws ResourceUnavailableException { - return false; + public boolean visit(final DhcpSubNetRules vpn) throws ResourceUnavailableException { + throw new CloudRuntimeException("DhcpSubNetRules not implemented in Basic Network Topology."); } @Override
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/12b0d188/server/src/org/apache/cloudstack/network/topology/NetworkTopology.java ---------------------------------------------------------------------- diff --git a/server/src/org/apache/cloudstack/network/topology/NetworkTopology.java b/server/src/org/apache/cloudstack/network/topology/NetworkTopology.java index d61de37..5a501f7 100644 --- a/server/src/org/apache/cloudstack/network/topology/NetworkTopology.java +++ b/server/src/org/apache/cloudstack/network/topology/NetworkTopology.java @@ -44,19 +44,22 @@ public interface NetworkTopology { NicProfile retrieveControlNic(final VirtualMachineProfile profile); - boolean configDhcpForSubnet(final Network network, final NicProfile nic, final VirtualMachineProfile profile, final DeployDestination dest, final List<DomainRouterVO> routers) - throws ResourceUnavailableException; - - boolean applyDhcpEntry(final Network network, final NicProfile nic, final VirtualMachineProfile profile, final DeployDestination dest, final List<DomainRouterVO> routers) - throws ResourceUnavailableException; // ====== USER FOR VPC ONLY ====== // + boolean setupDhcpForPvlan(final boolean add, final DomainRouterVO router, final Long hostId, final NicProfile nic) throws ResourceUnavailableException; + + boolean configDhcpForSubnet(final Network network, final NicProfile nic, final VirtualMachineProfile profile, final DeployDestination dest, final List<DomainRouterVO> routers) + throws ResourceUnavailableException; + boolean applyNetworkACLs(final Network network, final List<? extends NetworkACLItem> rules, final List<? extends VirtualRouter> routers, final boolean isPrivateGateway) throws ResourceUnavailableException; // ====== USER FOR GUEST NETWORK AND VCP ====== // + boolean applyDhcpEntry(final Network network, final NicProfile nic, final VirtualMachineProfile profile, final DeployDestination dest, final List<DomainRouterVO> routers) + throws ResourceUnavailableException; + boolean applyUserData(final Network network, final NicProfile nic, final VirtualMachineProfile profile, final DeployDestination dest, final List<DomainRouterVO> routers) throws ResourceUnavailableException; http://git-wip-us.apache.org/repos/asf/cloudstack/blob/12b0d188/server/src/org/apache/cloudstack/network/topology/NetworkTopologyVisitor.java ---------------------------------------------------------------------- diff --git a/server/src/org/apache/cloudstack/network/topology/NetworkTopologyVisitor.java b/server/src/org/apache/cloudstack/network/topology/NetworkTopologyVisitor.java index e284ac5..32dcc89 100644 --- a/server/src/org/apache/cloudstack/network/topology/NetworkTopologyVisitor.java +++ b/server/src/org/apache/cloudstack/network/topology/NetworkTopologyVisitor.java @@ -19,6 +19,7 @@ package org.apache.cloudstack.network.topology; import com.cloud.exception.ResourceUnavailableException; import com.cloud.network.rules.DhcpRules; +import com.cloud.network.rules.DhcpSubNetRules; import com.cloud.network.rules.FirewallRules; import com.cloud.network.rules.IpAssociationRules; import com.cloud.network.rules.LoadBalancingRules; @@ -69,6 +70,7 @@ public abstract class NetworkTopologyVisitor { public abstract boolean visit(DhcpPvlanRules vpn) throws ResourceUnavailableException; - public abstract boolean visit(DhcpSubNetRules vpn) throws ResourceUnavailableException; + public abstract boolean visit(DhcpSubNetRules subnet) throws ResourceUnavailableException; + public abstract boolean visit(NicPlugInOutRules nicPlugInOutRules) throws ResourceUnavailableException; } \ No newline at end of file http://git-wip-us.apache.org/repos/asf/cloudstack/blob/12b0d188/server/test/com/cloud/vpc/MockVpcVirtualNetworkApplianceManager.java ---------------------------------------------------------------------- diff --git a/server/test/com/cloud/vpc/MockVpcVirtualNetworkApplianceManager.java b/server/test/com/cloud/vpc/MockVpcVirtualNetworkApplianceManager.java index d24951e..3127858 100644 --- a/server/test/com/cloud/vpc/MockVpcVirtualNetworkApplianceManager.java +++ b/server/test/com/cloud/vpc/MockVpcVirtualNetworkApplianceManager.java @@ -27,7 +27,7 @@ import org.apache.cloudstack.api.command.admin.router.UpgradeRouterCmd; import org.apache.cloudstack.api.command.admin.router.UpgradeRouterTemplateCmd; import org.springframework.stereotype.Component; -import com.cloud.deploy.DeployDestination; +import com.cloud.agent.manager.Commands; import com.cloud.exception.AgentUnavailableException; import com.cloud.exception.ConcurrentOperationException; import com.cloud.exception.InsufficientCapacityException; @@ -45,7 +45,6 @@ import com.cloud.user.Account; import com.cloud.user.User; import com.cloud.utils.component.ManagerBase; import com.cloud.vm.DomainRouterVO; -import com.cloud.vm.NicProfile; import com.cloud.vm.VirtualMachineProfile; @Component @@ -53,15 +52,6 @@ import com.cloud.vm.VirtualMachineProfile; public class MockVpcVirtualNetworkApplianceManager extends ManagerBase implements VpcVirtualNetworkApplianceManager, VpcVirtualNetworkApplianceService { /* (non-Javadoc) - * @see com.cloud.network.router.VirtualNetworkApplianceManager#sendSshKeysToHost(java.lang.Long, java.lang.String, java.lang.String) - */ - @Override - public boolean sendSshKeysToHost(final Long hostId, final String pubKey, final String prvKey) { - // TODO Auto-generated method stub - return false; - } - - /* (non-Javadoc) * @see com.cloud.network.router.VirtualNetworkApplianceManager#startRemoteAccessVpn(com.cloud.network.Network, com.cloud.network.RemoteAccessVpn, java.util.List) */ @Override @@ -89,15 +79,6 @@ public class MockVpcVirtualNetworkApplianceManager extends ManagerBase implement } /* (non-Javadoc) - * @see com.cloud.network.router.VirtualNetworkApplianceManager#applyVpnUsers(com.cloud.network.Network, java.util.List, java.util.List) - */ - @Override - public String[] applyVpnUsers(final Network network, final List<? extends VpnUser> users, final List<DomainRouterVO> routers) throws ResourceUnavailableException { - // TODO Auto-generated method stub - return null; - } - - /* (non-Javadoc) * @see com.cloud.network.router.VirtualNetworkApplianceManager#stop(com.cloud.network.router.VirtualRouter, boolean, com.cloud.user.User, com.cloud.user.Account) */ @Override @@ -116,12 +97,6 @@ public class MockVpcVirtualNetworkApplianceManager extends ManagerBase implement } @Override - public boolean configDhcpForSubnet(final Network network, final NicProfile nic, final VirtualMachineProfile uservm, final DeployDestination dest, final List<DomainRouterVO> routers) - throws ResourceUnavailableException { - return false; //To change body of implemented methods use File | Settings | File Templates. - } - - @Override public boolean removeDhcpSupportForSubnet(final Network network, final List<DomainRouterVO> routers) throws ResourceUnavailableException { return false; //To change body of implemented methods use File | Settings | File Templates. } @@ -297,12 +272,6 @@ public class MockVpcVirtualNetworkApplianceManager extends ManagerBase implement } @Override - public boolean setupDhcpForPvlan(final boolean add, final DomainRouterVO router, final Long hostId, final NicProfile nic) { - // TODO Auto-generated method stub - return false; - } - - @Override public boolean prepareAggregatedExecution(final Network network, final List<DomainRouterVO> routers) throws AgentUnavailableException { return true; //To change body of implemented methods use File | Settings | File Templates. } @@ -329,4 +298,11 @@ public class MockVpcVirtualNetworkApplianceManager extends ManagerBase implement // TODO Auto-generated method stub return null; } + + @Override + public boolean sendCommandsToRouter(final VirtualRouter router, final Commands cmds) + throws AgentUnavailableException { + // TODO Auto-generated method stub + return false; + } } \ No newline at end of file