|
59 | 59 | import com.cloud.network.Networks.TrafficType; |
60 | 60 | import com.cloud.network.PhysicalNetwork; |
61 | 61 | import com.cloud.network.dao.FirewallRulesDao; |
62 | | -import com.cloud.network.Site2SiteVpnGateway; |
63 | | -import com.cloud.network.addr.PublicIp; |
64 | 62 | import com.cloud.network.dao.IPAddressDao; |
65 | 63 | import com.cloud.network.dao.NetworkDao; |
66 | 64 | import com.cloud.network.dao.PhysicalNetworkDao; |
67 | | -import com.cloud.network.dao.Site2SiteVpnConnectionDao; |
68 | 65 | import com.cloud.network.dao.Site2SiteVpnGatewayDao; |
69 | 66 | import com.cloud.network.element.VpcProvider; |
70 | 67 | import com.cloud.network.vpc.VpcOffering.State; |
@@ -271,11 +268,10 @@ public VpcOffering createVpcOffering(String name, String displayText, List<Strin |
271 | 268 |
|
272 | 269 | return createVpcOffering(name, displayText, svcProviderMap, false, null); |
273 | 270 | } |
| 271 | + |
274 | 272 |
|
275 | | - |
276 | | - @Override |
277 | 273 | @DB |
278 | | - public VpcOffering createVpcOffering(String name, String displayText, Map<Network.Service, |
| 274 | + protected VpcOffering createVpcOffering(String name, String displayText, Map<Network.Service, |
279 | 275 | Set<Network.Provider>> svcProviderMap, boolean isDefault, State state) { |
280 | 276 | Transaction txn = Transaction.currentTxn(); |
281 | 277 | txn.start(); |
@@ -407,12 +403,12 @@ public List<? extends VpcOffering> listVpcOfferings(Long id, String name, String |
407 | 403 | return offerings; |
408 | 404 | } |
409 | 405 | } |
410 | | - |
411 | | - @Override |
412 | | - public boolean areServicesSupportedByVpcOffering(long vpcOffId, Service... services) { |
| 406 | + |
| 407 | + |
| 408 | + protected boolean areServicesSupportedByVpcOffering(long vpcOffId, Service... services) { |
413 | 409 | return (_vpcOffSvcMapDao.areServicesSupportedByNetworkOffering(vpcOffId, services)); |
414 | 410 | } |
415 | | - |
| 411 | + |
416 | 412 |
|
417 | 413 | @Override |
418 | 414 | @ActionEvent(eventType = EventTypes.EVENT_VPC_OFFERING_DELETE, eventDescription = "deleting vpc offering") |
@@ -539,9 +535,9 @@ public boolean vpcProviderEnabledInZone(long zoneId) |
539 | 535 |
|
540 | 536 | return false; |
541 | 537 | } |
542 | | - |
543 | | - @Override |
544 | | - public Vpc createVpc(long zoneId, long vpcOffId, Account vpcOwner, String vpcName, String displayText, String cidr, |
| 538 | + |
| 539 | + |
| 540 | + protected Vpc createVpc(long zoneId, long vpcOffId, Account vpcOwner, String vpcName, String displayText, String cidr, |
545 | 541 | String networkDomain) { |
546 | 542 |
|
547 | 543 | if (!vpcProviderEnabledInZone(zoneId)) { |
@@ -778,21 +774,21 @@ public List<? extends Vpc> listVpcs(Long id, String vpcName, String displayText, |
778 | 774 | return vpcs; |
779 | 775 | } |
780 | 776 | } |
| 777 | + |
781 | 778 |
|
782 | | - @Override |
783 | | - public List<Service> getSupportedServices() { |
784 | | - List<Service> services = new ArrayList<Service>(); |
785 | | - services.add(Network.Service.Dhcp); |
786 | | - services.add(Network.Service.Dns); |
787 | | - services.add(Network.Service.UserData); |
788 | | - services.add(Network.Service.NetworkACL); |
789 | | - services.add(Network.Service.PortForwarding); |
790 | | - services.add(Network.Service.Lb); |
791 | | - services.add(Network.Service.SourceNat); |
792 | | - services.add(Network.Service.StaticNat); |
793 | | - services.add(Network.Service.Gateway); |
794 | | - services.add(Network.Service.Vpn); |
795 | | - return services; |
| 779 | + protected List<Service> getSupportedServices() { |
| 780 | + List<Service> services = new ArrayList<Service>(); |
| 781 | + services.add(Network.Service.Dhcp); |
| 782 | + services.add(Network.Service.Dns); |
| 783 | + services.add(Network.Service.UserData); |
| 784 | + services.add(Network.Service.NetworkACL); |
| 785 | + services.add(Network.Service.PortForwarding); |
| 786 | + services.add(Network.Service.Lb); |
| 787 | + services.add(Network.Service.SourceNat); |
| 788 | + services.add(Network.Service.StaticNat); |
| 789 | + services.add(Network.Service.Gateway); |
| 790 | + services.add(Network.Service.Vpn); |
| 791 | + return services; |
796 | 792 | } |
797 | 793 |
|
798 | 794 | @Override |
@@ -870,8 +866,8 @@ public boolean shutdownVpc(long vpcId) throws ConcurrentOperationException, Reso |
870 | 866 |
|
871 | 867 | //shutdown provider |
872 | 868 | boolean success = getVpcElement().shutdownVpc(vpc); |
873 | | - |
874 | | - //FIXME - once more features are added to vpc (gateway/firewall rules, etc - cleanup them here) |
| 869 | + |
| 870 | + //TODO - cleanup all vpc resources here (ACLs, gateways, etc) |
875 | 871 | if (success) { |
876 | 872 | s_logger.debug("Vpc " + vpc + " has been shutdown succesfully"); |
877 | 873 | } else { |
@@ -996,9 +992,9 @@ protected void validateNewVpcGuestNetwork(String cidr, String gateway, Account n |
996 | 992 | _vpcDao.releaseFromLockTable(locked.getId()); |
997 | 993 | } |
998 | 994 | } |
999 | | - |
1000 | | - @Override |
1001 | | - public VpcProvider getVpcElement() { |
| 995 | + |
| 996 | + |
| 997 | + protected VpcProvider getVpcElement() { |
1002 | 998 | if (vpcElement == null) { |
1003 | 999 | vpcElement = ((VpcProvider)_ntwkMgr.getElementImplementingProvider(Provider.VPCVirtualRouter.getName())); |
1004 | 1000 | } |
@@ -1618,9 +1614,4 @@ public void run() { |
1618 | 1614 | public VpcGateway getPrivateGatewayForVpc(long vpcId) { |
1619 | 1615 | return _vpcGatewayDao.getPrivateGatewayForVpc(vpcId); |
1620 | 1616 | } |
1621 | | - |
1622 | | - public int getMaxNetworksPerVpc() { |
1623 | | - return _maxNetworks; |
1624 | | - } |
1625 | | - |
1626 | 1617 | } |
0 commit comments