cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ahu...@apache.org
Subject [11/16] git commit: updated refs/heads/master to 494ea50
Date Mon, 19 Aug 2013 21:12:19 GMT
Divided NetworkManagerImpl into two files: NetworkManagerImpl and IpAddressManagerImpl


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/092e2020
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/092e2020
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/092e2020

Branch: refs/heads/master
Commit: 092e20204aa1e62f4f4223971f047e1651a2b627
Parents: 564502a
Author: Alex Huang <alex.huang@citrix.com>
Authored: Thu Aug 15 17:06:17 2013 -0700
Committer: Alex Huang <alex.huang@citrix.com>
Committed: Mon Aug 19 14:13:29 2013 -0700

----------------------------------------------------------------------
 .../entity/api/VirtualMachineEntityFactory.java |   41 -
 .../networkservice/BaremetaNetworkGuru.java     |   15 +-
 .../cloud/network/element/CiscoVnmcElement.java |   26 +-
 .../network/element/CiscoVnmcElementTest.java   |   22 +-
 .../lb/ElasticLoadBalancerManagerImpl.java      |    7 +-
 .../lb/InternalLoadBalancerVMManagerImpl.java   |    5 +-
 .../network/guru/MidoNetPublicNetworkGuru.java  |   39 +-
 .../cloud/network/element/NiciraNvpElement.java |   33 +-
 .../configuration/ConfigurationManagerImpl.java |   10 +-
 .../ExternalLoadBalancerDeviceManagerImpl.java  |   26 +-
 .../src/com/cloud/network/NetworkManager.java   |  141 --
 .../com/cloud/network/NetworkManagerImpl.java   | 1884 ++----------------
 .../com/cloud/network/NetworkServiceImpl.java   |   37 +-
 .../network/firewall/FirewallManagerImpl.java   |   58 +-
 .../cloud/network/guru/DirectNetworkGuru.java   |   13 +-
 .../network/guru/DirectPodBasedNetworkGuru.java |    9 +-
 .../network/guru/ExternalGuestNetworkGuru.java  |   16 +-
 .../cloud/network/guru/GuestNetworkGuru.java    |   43 +-
 .../cloud/network/guru/PublicNetworkGuru.java   |   13 +-
 .../lb/LoadBalancingRulesManagerImpl.java       |   50 +-
 .../VirtualNetworkApplianceManagerImpl.java     |   25 +-
 .../cloud/network/rules/RulesManagerImpl.java   |   74 +-
 .../com/cloud/network/vpc/VpcManagerImpl.java   |  149 +-
 .../src/com/cloud/user/AccountManagerImpl.java  |    7 +-
 .../lb/ApplicationLoadBalancerManagerImpl.java  |   27 +-
 .../configuration/ConfigurationManagerTest.java |    5 +-
 .../network/firewall/FirewallManagerTest.java   |   22 +-
 .../com/cloud/vpc/MockNetworkManagerImpl.java   |  312 ---
 28 files changed, 597 insertions(+), 2512 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/092e2020/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/VirtualMachineEntityFactory.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/VirtualMachineEntityFactory.java b/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/VirtualMachineEntityFactory.java
deleted file mode 100644
index e8ad8e4..0000000
--- a/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/VirtualMachineEntityFactory.java
+++ /dev/null
@@ -1,41 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-package org.apache.cloudstack.engine.cloud.entity.api;
-
-import com.cloud.utils.component.ComponentContext;
-import org.springframework.beans.factory.FactoryBean;
-import org.springframework.stereotype.Component;
-
-@Component
-public class VirtualMachineEntityFactory implements FactoryBean<VirtualMachineEntityImpl>{
-
-	@Override
-	public VirtualMachineEntityImpl getObject() throws Exception {
-        return ComponentContext.inject(VirtualMachineEntityImpl.class.newInstance());
-	}
-
-	@Override
-	public Class<?> getObjectType() {
-		return VirtualMachineEntityImpl.class;
-	}
-
-	@Override
-	public boolean isSingleton() {
-		return false;
-	}
-
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/092e2020/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetaNetworkGuru.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetaNetworkGuru.java b/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetaNetworkGuru.java
index 7501882..07ee12d 100755
--- a/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetaNetworkGuru.java
+++ b/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetaNetworkGuru.java
@@ -5,9 +5,9 @@
 // to you under the Apache License, Version 2.0 (the
 // "License"); you may not use this file except in compliance
 // with the License.  You may obtain a copy of the License at
-// 
+//
 //   http://www.apache.org/licenses/LICENSE-2.0
-// 
+//
 // Unless required by applicable law or agreed to in writing,
 // software distributed under the License is distributed on an
 // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -23,9 +23,10 @@ import java.net.URI;
 import javax.ejb.Local;
 import javax.inject.Inject;
 
-import org.apache.cloudstack.api.ApiConstants;
 import org.apache.log4j.Logger;
 
+import org.apache.cloudstack.api.ApiConstants;
+
 import com.cloud.dc.DataCenter;
 import com.cloud.dc.Pod;
 import com.cloud.dc.PodVlanMapVO;
@@ -41,6 +42,7 @@ import com.cloud.exception.InsufficientVirtualNetworkCapcityException;
 import com.cloud.host.HostVO;
 import com.cloud.host.dao.HostDao;
 import com.cloud.hypervisor.Hypervisor.HypervisorType;
+import com.cloud.network.IpAddressManager;
 import com.cloud.network.Network;
 import com.cloud.network.NetworkManager;
 import com.cloud.network.Networks.AddressFormat;
@@ -54,7 +56,6 @@ import com.cloud.offerings.dao.NetworkOfferingDao;
 import com.cloud.utils.db.Transaction;
 import com.cloud.vm.NicProfile;
 import com.cloud.vm.ReservationContext;
-import com.cloud.vm.VirtualMachine;
 import com.cloud.vm.VirtualMachineProfile;
 
 @Local(value = { NetworkGuru.class })
@@ -74,6 +75,8 @@ public class BaremetaNetworkGuru extends DirectPodBasedNetworkGuru {
     NetworkOfferingDao _networkOfferingDao;
     @Inject
     PodVlanMapDao _podVlanDao;
+    @Inject
+    IpAddressManager _ipAddrMgr;
 
     @Override
     public void reserve(NicProfile nic, Network network, VirtualMachineProfile vm, DeployDestination dest, ReservationContext context)
@@ -106,7 +109,7 @@ public class BaremetaNetworkGuru extends DirectPodBasedNetworkGuru {
                     txn.start();
 
                     // release the old ip here
-                    _networkMgr.markIpAsUnavailable(ipVO.getId());
+                    _ipAddrMgr.markIpAsUnavailable(ipVO.getId());
                     _ipAddressDao.unassignIpAddress(ipVO.getId());
 
                     txn.commit();
@@ -154,7 +157,7 @@ public class BaremetaNetworkGuru extends DirectPodBasedNetworkGuru {
         DataCenter dc = _dcDao.findById(pod.getDataCenterId());
         if (nic.getIp4Address() == null) {
             s_logger.debug(String.format("Requiring ip address: %s", nic.getIp4Address()));
-            PublicIp ip = _networkMgr.assignPublicIpAddress(dc.getId(), pod.getId(), vm.getOwner(), VlanType.DirectAttached, network.getId(), requiredIp, false);
+            PublicIp ip = _ipAddrMgr.assignPublicIpAddress(dc.getId(), pod.getId(), vm.getOwner(), VlanType.DirectAttached, network.getId(), requiredIp, false);
             nic.setIp4Address(ip.getAddress().toString());
             nic.setFormat(AddressFormat.Ip4);
             nic.setGateway(ip.getGateway());

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/092e2020/plugins/network-elements/cisco-vnmc/src/com/cloud/network/element/CiscoVnmcElement.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/cisco-vnmc/src/com/cloud/network/element/CiscoVnmcElement.java b/plugins/network-elements/cisco-vnmc/src/com/cloud/network/element/CiscoVnmcElement.java
index 8a5f041..3ae6a08 100644
--- a/plugins/network-elements/cisco-vnmc/src/com/cloud/network/element/CiscoVnmcElement.java
+++ b/plugins/network-elements/cisco-vnmc/src/com/cloud/network/element/CiscoVnmcElement.java
@@ -28,11 +28,11 @@ import javax.ejb.Local;
 import javax.inject.Inject;
 import javax.naming.ConfigurationException;
 
+import org.apache.log4j.Logger;
+
 import org.apache.cloudstack.context.CallContext;
 import org.apache.cloudstack.network.ExternalNetworkDeviceManager.NetworkDevice;
 
-import org.apache.log4j.Logger;
-
 import com.cloud.agent.AgentManager;
 import com.cloud.agent.api.Answer;
 import com.cloud.agent.api.AssociateAsaWithLogicalEdgeFirewallCommand;
@@ -62,8 +62,8 @@ import com.cloud.configuration.ConfigurationManager;
 import com.cloud.dc.ClusterVO;
 import com.cloud.dc.ClusterVSMMapVO;
 import com.cloud.dc.DataCenter;
-import com.cloud.dc.Vlan;
 import com.cloud.dc.DataCenter.NetworkType;
+import com.cloud.dc.Vlan;
 import com.cloud.dc.VlanVO;
 import com.cloud.dc.dao.ClusterDao;
 import com.cloud.dc.dao.ClusterVSMMapDao;
@@ -81,15 +81,15 @@ import com.cloud.host.dao.HostDao;
 import com.cloud.host.dao.HostDetailsDao;
 import com.cloud.network.CiscoNexusVSMDeviceVO;
 import com.cloud.network.IpAddress;
+import com.cloud.network.IpAddressManager;
 import com.cloud.network.Network;
-import com.cloud.network.NetworkManager;
-import com.cloud.network.NetworkModel;
-import com.cloud.network.PhysicalNetworkServiceProvider;
-import com.cloud.network.dao.PhysicalNetworkVO;
 import com.cloud.network.Network.Capability;
 import com.cloud.network.Network.Provider;
 import com.cloud.network.Network.Service;
+import com.cloud.network.NetworkManager;
+import com.cloud.network.NetworkModel;
 import com.cloud.network.Networks.BroadcastDomainType;
+import com.cloud.network.PhysicalNetworkServiceProvider;
 import com.cloud.network.PublicIpAddress;
 import com.cloud.network.addr.PublicIp;
 import com.cloud.network.cisco.CiscoAsa1000vDevice;
@@ -107,6 +107,7 @@ import com.cloud.network.dao.NetworkDao;
 import com.cloud.network.dao.PhysicalNetworkDao;
 import com.cloud.network.dao.PhysicalNetworkServiceProviderDao;
 import com.cloud.network.dao.PhysicalNetworkServiceProviderVO;
+import com.cloud.network.dao.PhysicalNetworkVO;
 import com.cloud.network.resource.CiscoVnmcResource;
 import com.cloud.network.rules.FirewallRule;
 import com.cloud.network.rules.FirewallRule.TrafficType;
@@ -125,7 +126,6 @@ import com.cloud.utils.exception.CloudRuntimeException;
 import com.cloud.utils.net.NetUtils;
 import com.cloud.vm.NicProfile;
 import com.cloud.vm.ReservationContext;
-import com.cloud.vm.VirtualMachine;
 import com.cloud.vm.VirtualMachine.Type;
 import com.cloud.vm.VirtualMachineProfile;
 
@@ -146,6 +146,8 @@ public class CiscoVnmcElement extends AdapterBase implements SourceNatServicePro
     NetworkManager _networkMgr;
     @Inject
     NetworkModel _networkModel;
+    @Inject
+    IpAddressManager _ipAddrMgr;
 
     @Inject
     PhysicalNetworkDao _physicalNetworkDao;
@@ -262,7 +264,7 @@ public class CiscoVnmcElement extends AdapterBase implements SourceNatServicePro
 
     private boolean associateAsaWithLogicalEdgeFirewall(long vlanId,
             String asaMgmtIp, long hostId) {
-        AssociateAsaWithLogicalEdgeFirewallCommand cmd = 
+        AssociateAsaWithLogicalEdgeFirewallCommand cmd =
                 new AssociateAsaWithLogicalEdgeFirewallCommand(vlanId, asaMgmtIp);
         Answer answer = _agentMgr.easySend(hostId, cmd);
         return answer.getResult();
@@ -336,7 +338,7 @@ public class CiscoVnmcElement extends AdapterBase implements SourceNatServicePro
             HostVO ciscoVnmcHost = _hostDao.findById(ciscoVnmcDevice.getHostId());
             _hostDao.loadDetails(ciscoVnmcHost);
             Account owner = context.getAccount();
-            PublicIp sourceNatIp = _networkMgr.assignSourceNatIpAddressToGuestNetwork(owner, network);
+            PublicIp sourceNatIp = _ipAddrMgr.assignSourceNatIpAddressToGuestNetwork(owner, network);
             String vlan = network.getBroadcastUri().getHost();
             long vlanId = Long.parseLong(vlan);
 
@@ -362,14 +364,14 @@ public class CiscoVnmcElement extends AdapterBase implements SourceNatServicePro
                 try {
                     Account caller = CallContext.current().getCallingAccount();
                     long callerUserId = CallContext.current().getCallingUserId();
-                    outsideIp = _networkMgr.allocateIp(owner, false, caller, callerUserId, zone);
+                    outsideIp = _ipAddrMgr.allocateIp(owner, false, caller, callerUserId, zone);
                 } catch (ResourceAllocationException e) {
                     s_logger.error("Unable to allocate additional public Ip address. Exception details " + e);
                     return false;
                 }
 
                 try {
-                    outsideIp = _networkMgr.associateIPToGuestNetwork(outsideIp.getId(), network.getId(), true);
+                    outsideIp = _ipAddrMgr.associateIPToGuestNetwork(outsideIp.getId(), network.getId(), true);
                 } catch (ResourceAllocationException e) {
                     s_logger.error("Unable to assign allocated additional public Ip " + outsideIp.getAddress().addr() + " to network with vlan " + vlanId + ". Exception details " + e);
                     return false;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/092e2020/plugins/network-elements/cisco-vnmc/test/com/cloud/network/element/CiscoVnmcElementTest.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/cisco-vnmc/test/com/cloud/network/element/CiscoVnmcElementTest.java b/plugins/network-elements/cisco-vnmc/test/com/cloud/network/element/CiscoVnmcElementTest.java
index a16733b..36460a8 100755
--- a/plugins/network-elements/cisco-vnmc/test/com/cloud/network/element/CiscoVnmcElementTest.java
+++ b/plugins/network-elements/cisco-vnmc/test/com/cloud/network/element/CiscoVnmcElementTest.java
@@ -16,6 +16,13 @@
 // under the License.
 package com.cloud.network.element;
 
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.Matchers.any;
+import static org.mockito.Matchers.anyLong;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
 import java.net.URI;
 import java.util.ArrayList;
 import java.util.Collections;
@@ -25,7 +32,6 @@ import javax.naming.ConfigurationException;
 
 import org.junit.Before;
 import org.junit.Test;
-import org.mockito.internal.matchers.Any;
 
 import com.cloud.agent.AgentManager;
 import com.cloud.agent.api.Answer;
@@ -40,8 +46,8 @@ import com.cloud.agent.api.routing.SetStaticNatRulesCommand;
 import com.cloud.configuration.ConfigurationManager;
 import com.cloud.dc.ClusterVSMMapVO;
 import com.cloud.dc.DataCenter;
-import com.cloud.dc.VlanVO;
 import com.cloud.dc.DataCenter.NetworkType;
+import com.cloud.dc.VlanVO;
 import com.cloud.dc.dao.ClusterVSMMapDao;
 import com.cloud.dc.dao.VlanDao;
 import com.cloud.deploy.DeployDestination;
@@ -51,12 +57,13 @@ import com.cloud.exception.InsufficientCapacityException;
 import com.cloud.exception.ResourceUnavailableException;
 import com.cloud.host.HostVO;
 import com.cloud.host.dao.HostDao;
+import com.cloud.network.CiscoNexusVSMDeviceVO;
+import com.cloud.network.IpAddress;
+import com.cloud.network.IpAddressManager;
 import com.cloud.network.Network;
 import com.cloud.network.Network.GuestType;
 import com.cloud.network.Network.Provider;
 import com.cloud.network.Network.Service;
-import com.cloud.network.CiscoNexusVSMDeviceVO;
-import com.cloud.network.IpAddress;
 import com.cloud.network.NetworkManager;
 import com.cloud.network.NetworkModel;
 import com.cloud.network.Networks.BroadcastDomainType;
@@ -73,16 +80,12 @@ import com.cloud.network.dao.NetworkServiceMapDao;
 import com.cloud.network.rules.FirewallRule;
 import com.cloud.network.rules.PortForwardingRule;
 import com.cloud.network.rules.StaticNat;
-import com.cloud.network.rules.StaticNatRule;
 import com.cloud.offering.NetworkOffering;
 import com.cloud.resource.ResourceManager;
 import com.cloud.user.Account;
 import com.cloud.utils.net.Ip;
 import com.cloud.vm.ReservationContext;
 
-import static org.junit.Assert.*;
-import static org.mockito.Mockito.*;
-
 public class CiscoVnmcElementTest {
 
     CiscoVnmcElement _element = new CiscoVnmcElement();
@@ -98,6 +101,7 @@ public class CiscoVnmcElementTest {
     ClusterVSMMapDao _clusterVsmMapDao = mock(ClusterVSMMapDao.class);
     CiscoNexusVSMDeviceDao _vsmDeviceDao = mock(CiscoNexusVSMDeviceDao.class);
     VlanDao _vlanDao = mock(VlanDao.class);
+    IpAddressManager _ipAddrMgr = mock(IpAddressManager.class);
 
     @Before
     public void setUp() throws ConfigurationException {
@@ -206,7 +210,7 @@ public class CiscoVnmcElementTest {
         when(publicIp.getNetmask()).thenReturn("1.1.1.1");
         when(publicIp.getMacAddress()).thenReturn(null);
         when(publicIp.isOneToOneNat()).thenReturn(true);
-        when(_networkMgr.assignSourceNatIpAddressToGuestNetwork(acc, network)).thenReturn(publicIp);
+        when(_ipAddrMgr.assignSourceNatIpAddressToGuestNetwork(acc, network)).thenReturn(publicIp);
 
         VlanVO vlanVO = mock(VlanVO.class);
         when(vlanVO.getVlanGateway()).thenReturn("1.1.1.1");

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/092e2020/plugins/network-elements/elastic-loadbalancer/src/com/cloud/network/lb/ElasticLoadBalancerManagerImpl.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/elastic-loadbalancer/src/com/cloud/network/lb/ElasticLoadBalancerManagerImpl.java b/plugins/network-elements/elastic-loadbalancer/src/com/cloud/network/lb/ElasticLoadBalancerManagerImpl.java
index 71045c9..55ed253 100644
--- a/plugins/network-elements/elastic-loadbalancer/src/com/cloud/network/lb/ElasticLoadBalancerManagerImpl.java
+++ b/plugins/network-elements/elastic-loadbalancer/src/com/cloud/network/lb/ElasticLoadBalancerManagerImpl.java
@@ -75,6 +75,7 @@ import com.cloud.exception.ResourceUnavailableException;
 import com.cloud.exception.StorageUnavailableException;
 import com.cloud.hypervisor.Hypervisor.HypervisorType;
 import com.cloud.network.ElasticLbVmMapVO;
+import com.cloud.network.IpAddressManager;
 import com.cloud.network.Network;
 import com.cloud.network.Network.Provider;
 import com.cloud.network.Network.Service;
@@ -164,6 +165,8 @@ public class ElasticLoadBalancerManagerImpl extends ManagerBase implements Elast
     @Inject
     DataCenterDao _dcDao = null;
     @Inject
+    IpAddressManager _ipAddrMgr;
+    @Inject
     protected NetworkDao _networkDao;
     @Inject
     protected NetworkOfferingDao _networkOfferingDao;
@@ -585,7 +588,7 @@ public class ElasticLoadBalancerManagerImpl extends ManagerBase implements Elast
         Transaction txn = Transaction.currentTxn();
         txn.start();
         
-        PublicIp ip = _networkMgr.assignPublicIpAddress(frontEndNetwork.getDataCenterId(), null, account, VlanType.DirectAttached, frontEndNetwork.getId(), null, true);
+        PublicIp ip = _ipAddrMgr.assignPublicIpAddress(frontEndNetwork.getDataCenterId(), null, account, VlanType.DirectAttached, frontEndNetwork.getId(), null, true);
         IPAddressVO ipvo = _ipAddressDao.findById(ip.getId());
         ipvo.setAssociatedWithNetworkId(frontEndNetwork.getId());
         _ipAddressDao.update(ipvo.getId(), ipvo);
@@ -600,7 +603,7 @@ public class ElasticLoadBalancerManagerImpl extends ManagerBase implements Elast
         IPAddressVO ipvo = _ipAddressDao.findById(ipId);
         ipvo.setAssociatedWithNetworkId(null);
         _ipAddressDao.update(ipvo.getId(), ipvo);
-       _networkMgr.disassociatePublicIpAddress(ipId, userId, caller);
+        _ipAddrMgr.disassociatePublicIpAddress(ipId, userId, caller);
        _ipAddressDao.unassignIpAddress(ipId);
     }
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/092e2020/plugins/network-elements/internal-loadbalancer/src/org/apache/cloudstack/network/lb/InternalLoadBalancerVMManagerImpl.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/internal-loadbalancer/src/org/apache/cloudstack/network/lb/InternalLoadBalancerVMManagerImpl.java b/plugins/network-elements/internal-loadbalancer/src/org/apache/cloudstack/network/lb/InternalLoadBalancerVMManagerImpl.java
index 26d5570..aa5c182 100644
--- a/plugins/network-elements/internal-loadbalancer/src/org/apache/cloudstack/network/lb/InternalLoadBalancerVMManagerImpl.java
+++ b/plugins/network-elements/internal-loadbalancer/src/org/apache/cloudstack/network/lb/InternalLoadBalancerVMManagerImpl.java
@@ -61,6 +61,7 @@ import com.cloud.exception.OperationTimedoutException;
 import com.cloud.exception.ResourceUnavailableException;
 import com.cloud.exception.StorageUnavailableException;
 import com.cloud.hypervisor.Hypervisor.HypervisorType;
+import com.cloud.network.IpAddressManager;
 import com.cloud.network.Network;
 import com.cloud.network.Network.Provider;
 import com.cloud.network.Network.Service;
@@ -130,6 +131,8 @@ public class InternalLoadBalancerVMManagerImpl extends ManagerBase implements
     private String _mgmtCidr;
     private long _internalLbVmOfferingId = 0L;
     
+    @Inject
+    IpAddressManager _ipAddrMgr;
     @Inject VirtualMachineManager _itMgr;
     @Inject DomainRouterDao _internalLbVmDao;
     @Inject ConfigurationDao _configDao;
@@ -661,7 +664,7 @@ public class InternalLoadBalancerVMManagerImpl extends ManagerBase implements
             if (guestIp != null) {
                 guestNic.setIp4Address(guestIp.addr());
             } else {
-                guestNic.setIp4Address(_ntwkMgr.acquireGuestIpAddress(guestNetwork, null));
+                guestNic.setIp4Address(_ipAddrMgr.acquireGuestIpAddress(guestNetwork, null));
             }
             guestNic.setGateway(guestNetwork.getGateway());
             guestNic.setBroadcastUri(guestNetwork.getBroadcastUri());

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/092e2020/plugins/network-elements/midonet/src/com/cloud/network/guru/MidoNetPublicNetworkGuru.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/midonet/src/com/cloud/network/guru/MidoNetPublicNetworkGuru.java b/plugins/network-elements/midonet/src/com/cloud/network/guru/MidoNetPublicNetworkGuru.java
index 38da02b..ef97380 100644
--- a/plugins/network-elements/midonet/src/com/cloud/network/guru/MidoNetPublicNetworkGuru.java
+++ b/plugins/network-elements/midonet/src/com/cloud/network/guru/MidoNetPublicNetworkGuru.java
@@ -18,6 +18,13 @@
  */
 package com.cloud.network.guru;
 
+import java.net.URI;
+
+import javax.ejb.Local;
+import javax.inject.Inject;
+
+import org.apache.log4j.Logger;
+
 import com.cloud.dc.DataCenter;
 import com.cloud.dc.Vlan;
 import com.cloud.deploy.DeployDestination;
@@ -25,25 +32,26 @@ import com.cloud.deploy.DeploymentPlan;
 import com.cloud.exception.ConcurrentOperationException;
 import com.cloud.exception.InsufficientAddressCapacityException;
 import com.cloud.exception.InsufficientVirtualNetworkCapcityException;
-import com.cloud.network.*;
+import com.cloud.network.IpAddressManager;
 import com.cloud.network.Network;
+import com.cloud.network.NetworkModel;
+import com.cloud.network.NetworkProfile;
+import com.cloud.network.Networks;
 import com.cloud.network.addr.PublicIp;
+import com.cloud.network.dao.IPAddressVO;
+import com.cloud.network.dao.NetworkVO;
 import com.cloud.offering.NetworkOffering;
 import com.cloud.user.Account;
+import com.cloud.user.AccountVO;
+import com.cloud.user.dao.AccountDao;
 import com.cloud.utils.db.DB;
 import com.cloud.utils.db.Transaction;
 import com.cloud.utils.exception.CloudRuntimeException;
-import com.cloud.utils.net.NetUtils;
-import com.cloud.user.AccountVO;
-import com.cloud.user.dao.AccountDao;
-import com.cloud.network.dao.NetworkVO;
-import com.cloud.network.dao.IPAddressVO;
-import com.cloud.vm.*;
-import org.apache.log4j.Logger;
-import java.net.URI;
-
-import javax.ejb.Local;
-import javax.inject.Inject;
+import com.cloud.vm.Nic;
+import com.cloud.vm.NicProfile;
+import com.cloud.vm.ReservationContext;
+import com.cloud.vm.VirtualMachine;
+import com.cloud.vm.VirtualMachineProfile;
 
 @Local(value = NetworkGuru.class)
 public class MidoNetPublicNetworkGuru extends PublicNetworkGuru {
@@ -54,6 +62,8 @@ public class MidoNetPublicNetworkGuru extends PublicNetworkGuru {
     NetworkModel _networkModel;
     @Inject
     AccountDao _accountDao;
+    @Inject
+    IpAddressManager _ipAddrMgr;
 
     // Don't need to change traffic type stuff, public is fine
 
@@ -78,10 +88,11 @@ public class MidoNetPublicNetworkGuru extends PublicNetworkGuru {
         super();
     }
 
+    @Override
     protected void getIp(NicProfile nic, DataCenter dc, VirtualMachineProfile vm, Network network) throws InsufficientVirtualNetworkCapcityException,
             InsufficientAddressCapacityException, ConcurrentOperationException {
         if (nic.getIp4Address() == null) {
-            PublicIp ip = _networkMgr.assignPublicIpAddress(dc.getId(), null, vm.getOwner(), Vlan.VlanType.VirtualNetwork, null, null, false);
+            PublicIp ip = _ipAddrMgr.assignPublicIpAddress(dc.getId(), null, vm.getOwner(), Vlan.VlanType.VirtualNetwork, null, null, false);
             nic.setIp4Address(ip.getAddress().toString());
 
             nic.setGateway(ip.getGateway());
@@ -201,7 +212,7 @@ public class MidoNetPublicNetworkGuru extends PublicNetworkGuru {
             Transaction txn = Transaction.currentTxn();
             txn.start();
 
-            _networkMgr.markIpAsUnavailable(ip.getId());
+            _ipAddrMgr.markIpAsUnavailable(ip.getId());
             _ipAddressDao.unassignIpAddress(ip.getId());
 
             txn.commit();

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/092e2020/plugins/network-elements/nicira-nvp/src/com/cloud/network/element/NiciraNvpElement.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/nicira-nvp/src/com/cloud/network/element/NiciraNvpElement.java b/plugins/network-elements/nicira-nvp/src/com/cloud/network/element/NiciraNvpElement.java
index 754e7b1..c7d0884 100644
--- a/plugins/network-elements/nicira-nvp/src/com/cloud/network/element/NiciraNvpElement.java
+++ b/plugins/network-elements/nicira-nvp/src/com/cloud/network/element/NiciraNvpElement.java
@@ -28,10 +28,11 @@ import javax.ejb.Local;
 import javax.inject.Inject;
 import javax.naming.ConfigurationException;
 
-import org.apache.cloudstack.network.ExternalNetworkDeviceManager.NetworkDevice;
 import org.apache.log4j.Logger;
 import org.springframework.stereotype.Component;
 
+import org.apache.cloudstack.network.ExternalNetworkDeviceManager.NetworkDevice;
+
 import com.cloud.agent.AgentManager;
 import com.cloud.agent.api.ConfigurePortForwardingRulesOnLogicalRouterAnswer;
 import com.cloud.agent.api.ConfigurePortForwardingRulesOnLogicalRouterCommand;
@@ -74,6 +75,7 @@ import com.cloud.host.HostVO;
 import com.cloud.host.dao.HostDao;
 import com.cloud.host.dao.HostDetailsDao;
 import com.cloud.network.IpAddress;
+import com.cloud.network.IpAddressManager;
 import com.cloud.network.Network;
 import com.cloud.network.Network.Capability;
 import com.cloud.network.Network.Provider;
@@ -117,13 +119,12 @@ import com.cloud.utils.net.NetUtils;
 import com.cloud.vm.NicProfile;
 import com.cloud.vm.NicVO;
 import com.cloud.vm.ReservationContext;
-import com.cloud.vm.VirtualMachine;
 import com.cloud.vm.VirtualMachineProfile;
 import com.cloud.vm.dao.NicDao;
 
 @Component
-@Local(value = {NetworkElement.class, ConnectivityProvider.class, 
-        SourceNatServiceProvider.class, StaticNatServiceProvider.class, 
+@Local(value = {NetworkElement.class, ConnectivityProvider.class,
+        SourceNatServiceProvider.class, StaticNatServiceProvider.class,
         PortForwardingServiceProvider.class, IpDeployer.class} )
 public class NiciraNvpElement extends AdapterBase implements
 ConnectivityProvider, SourceNatServiceProvider,
@@ -134,20 +135,20 @@ NiciraNvpElementService, ResourceStateAdapter, IpDeployer {
 
     private static final Map<Service, Map<Capability, String>> capabilities = setCapabilities();
 
-    @Inject 
+    @Inject
     NicDao _nicDao;
-    @Inject 
-    ResourceManager _resourceMgr;    
+    @Inject
+    ResourceManager _resourceMgr;
     @Inject
     PhysicalNetworkDao _physicalNetworkDao;
     @Inject
     PhysicalNetworkServiceProviderDao _physicalNetworkServiceProviderDao;
     @Inject
     NiciraNvpDao _niciraNvpDao;
-    @Inject 
+    @Inject
     HostDetailsDao _hostDetailsDao;
     @Inject
-    HostDao _hostDao;  
+    HostDao _hostDao;
     @Inject
     AgentManager _agentMgr;
     @Inject
@@ -166,6 +167,8 @@ NiciraNvpElementService, ResourceStateAdapter, IpDeployer {
     NetworkServiceMapDao _ntwkSrvcDao;
     @Inject
     VlanDao _vlanDao;
+    @Inject
+    IpAddressManager _ipAddrMgr;
 
     @Override
     public Map<Service, Map<Capability, String>> getCapabilities() {
@@ -199,7 +202,7 @@ NiciraNvpElementService, ResourceStateAdapter, IpDeployer {
             return false;
         }
 
-        return true;        
+        return true;
     }
 
     @Override
@@ -259,7 +262,7 @@ NiciraNvpElementService, ResourceStateAdapter, IpDeployer {
                 network.getId(), Service.SourceNat, Provider.NiciraNvp)) {
             s_logger.debug("Apparently we are supposed to provide SourceNat on this network");
 
-            PublicIp sourceNatIp = _networkManager
+            PublicIp sourceNatIp = _ipAddrMgr
                     .assignSourceNatIpAddressToGuestNetwork(owner, network);
             String publicCidr = sourceNatIp.getAddress().addr() + "/"
                     + NetUtils.getCidrSize(sourceNatIp.getVlanNetmask());
@@ -629,7 +632,7 @@ NiciraNvpElementService, ResourceStateAdapter, IpDeployer {
             } else {
                 throw new CloudRuntimeException(
                         "Failed to add Nicira Nvp Device due to internal error.");
-            }            
+            }
         } catch (ConfigurationException e) {
             txn.rollback();
             throw new CloudRuntimeException(e.getMessage());
@@ -665,7 +668,7 @@ NiciraNvpElementService, ResourceStateAdapter, IpDeployer {
         if (niciraNvpDevice == null) {
             throw new InvalidParameterValueException(
                     "Could not find a nicira device with id " + niciraDeviceId);
-        }        
+        }
 
         // Find the physical network we work for
         Long physicalNetworkId = niciraNvpDevice.getPhysicalNetworkId();
@@ -736,7 +739,7 @@ NiciraNvpElementService, ResourceStateAdapter, IpDeployer {
         return responseList;
     }
 
-    @Override    
+    @Override
     public List<? extends Network> listNiciraNvpDeviceNetworks(
             ListNiciraNvpDeviceNetworksCmd cmd) {
         Long niciraDeviceId = cmd.getNiciraNvpDeviceId();
@@ -745,7 +748,7 @@ NiciraNvpElementService, ResourceStateAdapter, IpDeployer {
         if (niciraNvpDevice == null) {
             throw new InvalidParameterValueException(
                     "Could not find a nicira device with id " + niciraDeviceId);
-        }        
+        }
 
         // Find the physical network we work for
         Long physicalNetworkId = niciraNvpDevice.getPhysicalNetworkId();

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/092e2020/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
index 62699d6..57dc0b3 100755
--- a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
+++ b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
@@ -21,6 +21,7 @@ import java.sql.PreparedStatement;
 import java.sql.ResultSet;
 import java.sql.SQLException;
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.Collection;
 import java.util.HashMap;
 import java.util.HashSet;
@@ -132,6 +133,7 @@ import com.cloud.exception.PermissionDeniedException;
 import com.cloud.exception.ResourceAllocationException;
 import com.cloud.exception.ResourceUnavailableException;
 import com.cloud.hypervisor.Hypervisor.HypervisorType;
+import com.cloud.network.IpAddressManager;
 import com.cloud.network.Network;
 import com.cloud.network.Network.Capability;
 import com.cloud.network.Network.GuestType;
@@ -203,8 +205,6 @@ import com.cloud.vm.dao.NicIpAliasDao;
 import com.cloud.vm.dao.NicIpAliasVO;
 import com.cloud.vm.dao.NicSecondaryIpDao;
 
-import java.util.Arrays;
-
 @Local(value = { ConfigurationManager.class, ConfigurationService.class })
 public class ConfigurationManagerImpl extends ManagerBase implements ConfigurationManager, ConfigurationService {
     public static final Logger s_logger = Logger.getLogger(ConfigurationManagerImpl.class.getName());
@@ -303,6 +303,8 @@ public class ConfigurationManagerImpl extends ManagerBase implements Configurati
     public ManagementService _mgr;
     @Inject
     DedicatedResourceDao _dedicatedDao;
+    @Inject
+    IpAddressManager _ipAddrMgr;
 
     // FIXME - why don't we have interface for DataCenterLinkLocalIpAddressDao?
     @Inject
@@ -3208,7 +3210,7 @@ public class ConfigurationManagerImpl extends ManagerBase implements Configurati
                                     + " belonging to the range has firewall rules applied. Cleanup the rules first");
                         }
                         // release public ip address here
-                        success = success && _networkMgr.disassociatePublicIpAddress(ip.getId(), userId, caller);
+                        success = success && _ipAddrMgr.disassociatePublicIpAddress(ip.getId(), userId, caller);
                     }
                     if (!success) {
                         s_logger.warn("Some ip addresses failed to be released as a part of vlan " + vlanDbId
@@ -3391,7 +3393,7 @@ public class ConfigurationManagerImpl extends ManagerBase implements Configurati
                             s_logger.debug("Releasing Public IP addresses" + ip + " of vlan " + vlanDbId
                                     + " as part of Public IP" + " range release to the system pool");
                         }
-                        success = success && _networkMgr.disassociatePublicIpAddress(ip.getId(), userId, caller);
+                        success = success && _ipAddrMgr.disassociatePublicIpAddress(ip.getId(), userId, caller);
                     } else {
                         ipsInUse.add(ip);
                     }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/092e2020/server/src/com/cloud/network/ExternalLoadBalancerDeviceManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/ExternalLoadBalancerDeviceManagerImpl.java b/server/src/com/cloud/network/ExternalLoadBalancerDeviceManagerImpl.java
index c3bc0ac..c018127 100644
--- a/server/src/com/cloud/network/ExternalLoadBalancerDeviceManagerImpl.java
+++ b/server/src/com/cloud/network/ExternalLoadBalancerDeviceManagerImpl.java
@@ -5,7 +5,7 @@
 // to you under the Apache License, Version 2.0 (the
 // "License"); you may not use this file except in compliance
 // with the License.  You may obtain a copy of the License at
-// 
+//
 //   http://www.apache.org/licenses/LICENSE-2.0
 //
 // Unless required by applicable law or agreed to in writing,
@@ -26,13 +26,13 @@ import java.util.UUID;
 import javax.inject.Inject;
 import javax.naming.ConfigurationException;
 
+import org.apache.log4j.Logger;
+
 import org.apache.cloudstack.api.ApiConstants;
 import org.apache.cloudstack.api.response.ExternalLoadBalancerResponse;
 import org.apache.cloudstack.framework.config.dao.ConfigurationDao;
 import org.apache.cloudstack.network.ExternalNetworkDeviceManager.NetworkDevice;
 
-import org.apache.log4j.Logger;
-
 import com.cloud.agent.AgentManager;
 import com.cloud.agent.api.Answer;
 import com.cloud.agent.api.StartupCommand;
@@ -184,6 +184,8 @@ public abstract class ExternalLoadBalancerDeviceManagerImpl extends AdapterBase
     ExternalFirewallDeviceDao _externalFirewallDeviceDao;
     @Inject
     protected HostPodDao _podDao = null;
+    @Inject
+    IpAddressManager _ipAddrMgr;
 
     private long _defaultLbCapacity;
     private static final org.apache.log4j.Logger s_logger = Logger.getLogger(ExternalLoadBalancerDeviceManagerImpl.class);
@@ -507,7 +509,13 @@ public abstract class ExternalLoadBalancerDeviceManagerImpl extends AdapterBase
 
                             // acquire a public IP to associate with lb appliance (used as subnet IP to make the
 // appliance part of private network)
-                            PublicIp publicIp = _networkMgr.assignPublicIpAddress(guestConfig.getDataCenterId(), null, _accountMgr.getSystemAccount(), VlanType.VirtualNetwork, null, null, false);
+                            PublicIp publicIp = _ipAddrMgr.assignPublicIpAddress(guestConfig.getDataCenterId(),
+                                null,
+                                _accountMgr.getSystemAccount(),
+                                VlanType.VirtualNetwork,
+                                null,
+                                null,
+                                false);
                             String publicIPNetmask = publicIp.getVlanNetmask();
                             String publicIPgateway = publicIp.getVlanGateway();
                             String publicIPVlanTag = publicIp.getVlanTag();
@@ -544,7 +552,7 @@ public abstract class ExternalLoadBalancerDeviceManagerImpl extends AdapterBase
                                         // release the public & private IP back to dc pool, as the load balancer
 // appliance is now destroyed
                                         _dcDao.releasePrivateIpAddress(lbIP, guestConfig.getDataCenterId(), null);
-                                        _networkMgr.disassociatePublicIpAddress(publicIp.getId(), _accountMgr.getSystemUser().getId(), _accountMgr.getSystemAccount());
+                                        _ipAddrMgr.disassociatePublicIpAddress(publicIp.getId(), _accountMgr.getSystemUser().getId(), _accountMgr.getSystemAccount());
                                     }
                                 } catch (Exception e) {
                                     s_logger.warn("Failed to destroy load balancer appliance created for the network" + guestConfig.getId() + " due to " + e.getMessage());
@@ -696,7 +704,7 @@ public abstract class ExternalLoadBalancerDeviceManagerImpl extends AdapterBase
                     // release the public IP allocated for this LB appliance
                     DetailVO publicIpDetail = _hostDetailDao.findDetail(lbHost.getId(), "publicip");
                     IPAddressVO ipVo = _ipAddressDao.findByIpAndDcId(guestConfig.getDataCenterId(), publicIpDetail.toString());
-                    _networkMgr.disassociatePublicIpAddress(ipVo.getId(), _accountMgr.getSystemUser().getId(), _accountMgr.getSystemAccount());
+                    _ipAddrMgr.disassociatePublicIpAddress(ipVo.getId(), _accountMgr.getSystemUser().getId(), _accountMgr.getSystemAccount());
                 } else {
                     deviceMapLock.unlock();
                 }
@@ -763,7 +771,7 @@ public abstract class ExternalLoadBalancerDeviceManagerImpl extends AdapterBase
                 String loadBalancingIpAddress = existedGuestIp;
                 
                 if (loadBalancingIpAddress == null) {
-                    loadBalancingIpAddress = _networkMgr.acquireGuestIpAddress(network, null);
+                    loadBalancingIpAddress = _ipAddrMgr.acquireGuestIpAddress(network, null);
                 }
 
                 if (loadBalancingIpAddress == null) {
@@ -803,7 +811,7 @@ public abstract class ExternalLoadBalancerDeviceManagerImpl extends AdapterBase
                 // Find the NIC that the mapping refers to
                 loadBalancingIpNic = _nicDao.findById(mapping.getNicId());
 
-                int count = _networkMgr.getRuleCountForIp(sourceIpId, Purpose.LoadBalancing, FirewallRule.State.Active);
+                int count = _ipAddrMgr.getRuleCountForIp(sourceIpId, Purpose.LoadBalancing, FirewallRule.State.Active);
                 if (count == 0) {
                     // On the firewall provider for the network, delete the static NAT rule between the source IP
                     // address and the load balancing IP address
@@ -984,7 +992,7 @@ public abstract class ExternalLoadBalancerDeviceManagerImpl extends AdapterBase
             }
 
             // Acquire a self-ip address from the guest network IP address range
-            selfIp = _networkMgr.acquireGuestIpAddress(guestConfig, null);
+            selfIp = _ipAddrMgr.acquireGuestIpAddress(guestConfig, null);
             if (selfIp == null) {
                 String msg = "failed to acquire guest IP address so not implementing the network on the external load balancer ";
                 s_logger.error(msg);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/092e2020/server/src/com/cloud/network/NetworkManager.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/NetworkManager.java b/server/src/com/cloud/network/NetworkManager.java
index b8e5aef..4acf8c3 100755
--- a/server/src/com/cloud/network/NetworkManager.java
+++ b/server/src/com/cloud/network/NetworkManager.java
@@ -22,9 +22,6 @@ import java.util.Map;
 
 import org.apache.cloudstack.acl.ControlledEntity.ACLType;
 
-import com.cloud.dc.DataCenter;
-import com.cloud.dc.Pod;
-import com.cloud.dc.Vlan.VlanType;
 import com.cloud.deploy.DataCenterDeployment;
 import com.cloud.deploy.DeployDestination;
 import com.cloud.deploy.DeploymentPlan;
@@ -36,17 +33,13 @@ import com.cloud.exception.ResourceAllocationException;
 import com.cloud.exception.ResourceUnavailableException;
 import com.cloud.network.Network.Provider;
 import com.cloud.network.Network.Service;
-import com.cloud.network.addr.PublicIp;
-import com.cloud.network.dao.IPAddressVO;
 import com.cloud.network.dao.NetworkVO;
 import com.cloud.network.element.DhcpServiceProvider;
 import com.cloud.network.element.LoadBalancingServiceProvider;
 import com.cloud.network.element.StaticNatServiceProvider;
 import com.cloud.network.element.UserDataServiceProvider;
 import com.cloud.network.guru.NetworkGuru;
-import com.cloud.network.rules.FirewallRule;
 import com.cloud.network.rules.LoadBalancerContainer.Scheme;
-import com.cloud.network.rules.StaticNat;
 import com.cloud.offering.NetworkOffering;
 import com.cloud.offerings.NetworkOfferingVO;
 import com.cloud.user.Account;
@@ -65,38 +58,8 @@ import com.cloud.vm.VirtualMachineProfile;
  * 
  */
 public interface NetworkManager  {
-    /**
-     * Assigns a new public ip address.
-     * 
-     * @param dcId
-     * @param podId
-     *            TODO
-     * @param owner
-     * @param type
-     * @param networkId
-     * @param requestedIp
-     *            TODO
-     * @param allocatedBy
-     *            TODO
-     * @return
-     * @throws InsufficientAddressCapacityException
-     */
-
-    PublicIp assignPublicIpAddress(long dcId, Long podId, Account owner, VlanType type, Long networkId, String requestedIp,
-            boolean isSystem) throws InsufficientAddressCapacityException;
 
 
-    /**
-     * Do all of the work of releasing public ip addresses. Note that if this method fails, there can be side effects.
-     * 
-     * @param userId
-     * @param caller
-     *            TODO
-     * @param IpAddress
-     * @return true if it did; false if it didn't
-     */
-    public boolean disassociatePublicIpAddress(long id, long userId, Account caller);
-
     List<NetworkVO> setupNetwork(Account owner, NetworkOffering offering, DeploymentPlan plan, String name, String displayText, boolean isDefault)
             throws ConcurrentOperationException;
 
@@ -117,8 +80,6 @@ public interface NetworkManager  {
 
     List<NicProfile> getNicProfiles(VirtualMachine vm);
 
-    boolean applyRules(List<? extends FirewallRule> rules, FirewallRule.Purpose purpose, NetworkRuleApplier applier, boolean continueOnError) throws ResourceUnavailableException;
-
     Pair<NetworkGuru, NetworkVO> implementNetwork(long networkId, DeployDestination dest, ReservationContext context) throws ConcurrentOperationException, ResourceUnavailableException,
             InsufficientCapacityException;
 
@@ -161,62 +122,14 @@ public interface NetworkManager  {
                                Boolean displayNetworkEnabled, String isolatedPvlan)
                     throws ConcurrentOperationException, InsufficientCapacityException, ResourceAllocationException;
 
-    /**
-     * @throws ResourceAllocationException TODO
-     * @throws InsufficientCapacityException
-     *             Associates an ip address list to an account. The list of ip addresses are all addresses associated
-     *             with the
-     *             given vlan id.
-     * @param userId
-     * @param accountId
-     * @param zoneId
-     * @param vlanId
-     * @throws InsufficientAddressCapacityException
-     * @throws
-     */
-    boolean associateIpAddressListToAccount(long userId, long accountId, long zoneId, Long vlanId, Network guestNetwork) throws InsufficientCapacityException, ConcurrentOperationException,
-            ResourceUnavailableException, ResourceAllocationException;
-
     UserDataServiceProvider getPasswordResetProvider(Network network);
 
     UserDataServiceProvider getSSHKeyResetProvider(Network network);
 
-    boolean applyIpAssociations(Network network, boolean continueOnError) throws ResourceUnavailableException;
-    
-    boolean applyIpAssociations(Network network, boolean rulesRevoked, boolean continueOnError, List<? extends PublicIpAddress> publicIps) throws ResourceUnavailableException;
-
     boolean startNetwork(long networkId, DeployDestination dest, ReservationContext context) throws ConcurrentOperationException, ResourceUnavailableException, InsufficientCapacityException;
 
-    IPAddressVO markIpAsUnavailable(long addrId);
-
-    public String acquireGuestIpAddress(Network network, String requestedIp);
-
-    boolean applyStaticNats(List<? extends StaticNat> staticNats, boolean continueOnError, boolean forRevoke) throws ResourceUnavailableException;
-
     boolean reallocate(VirtualMachineProfile vm, DataCenterDeployment dest) throws InsufficientCapacityException, ConcurrentOperationException;
 
-    IpAddress assignSystemIp(long networkId, Account owner,
-            boolean forElasticLb, boolean forElasticIp)
-            throws InsufficientAddressCapacityException;
-
-    boolean handleSystemIpRelease(IpAddress ip);
-
-    void allocateDirectIp(NicProfile nic, DataCenter dc,
-            VirtualMachineProfile vm,
-            Network network, String requestedIpv4, String requestedIpv6)
-            throws InsufficientVirtualNetworkCapcityException,
-            InsufficientAddressCapacityException;
-
-    /**
-     * @param owner
-     * @param guestNetwork
-     * @return
-     * @throws ConcurrentOperationException
-     * @throws InsufficientAddressCapacityException
-     */
-    PublicIp assignSourceNatIpAddressToGuestNetwork(Account owner, Network guestNetwork) throws InsufficientAddressCapacityException, ConcurrentOperationException;
-
-
     /**
      * @param requested
      * @param network
@@ -259,30 +172,6 @@ public interface NetworkManager  {
 
 
     /**
-     * @param ipAddrId
-     * @param networkId
-     * @param releaseOnFailure TODO
-     */
-    IPAddressVO associateIPToGuestNetwork(long ipAddrId, long networkId, boolean releaseOnFailure) throws ResourceAllocationException, ResourceUnavailableException,
-        InsufficientAddressCapacityException, ConcurrentOperationException;
-
-    IpAddress allocatePortableIp(Account ipOwner, Account caller, long dcId, Long networkId, Long vpcID)
-            throws ConcurrentOperationException, ResourceAllocationException, InsufficientAddressCapacityException;
-
-    boolean releasePortableIpAddress(long addrId);
-
-    IPAddressVO associatePortableIPToGuestNetwork(long ipAddrId, long networkId, boolean releaseOnFailure) throws ResourceAllocationException, ResourceUnavailableException,
-            InsufficientAddressCapacityException, ConcurrentOperationException;
-
-    IPAddressVO disassociatePortableIPToGuestNetwork(long ipAddrId, long networkId) throws ResourceAllocationException, ResourceUnavailableException,
-            InsufficientAddressCapacityException, ConcurrentOperationException;
-
-    boolean isPortableIpTransferableFromNetwork(long ipAddrId, long networkId);
-
-    void transferPortableIP(long ipAddrId, long currentNetworkId, long newNetworkId)  throws ResourceAllocationException, ResourceUnavailableException,
-            InsufficientAddressCapacityException, ConcurrentOperationException;;
-
-    /**
      * @param network
      * @param provider
      * @return
@@ -318,24 +207,6 @@ public interface NetworkManager  {
             InsufficientAddressCapacityException, ConcurrentOperationException, InsufficientCapacityException, ResourceUnavailableException;
 
 
-    /**
-     * @param addr
-     */
-    void markPublicIpAsAllocated(IPAddressVO addr);
-
-
-    /**
-     * @param owner
-     * @param guestNtwkId
-     * @param vpcId
-     * @param dcId
-     * @param isSourceNat
-     * @return
-     * @throws ConcurrentOperationException
-     * @throws InsufficientAddressCapacityException
-     */
-    PublicIp assignDedicateIpAddress(Account owner, Long guestNtwkId, Long vpcId, long dcId, boolean isSourceNat) throws ConcurrentOperationException, InsufficientAddressCapacityException;
-
     NetworkProfile convertNetworkToNetworkProfile(long networkId);
 
     /**
@@ -357,9 +228,6 @@ public interface NetworkManager  {
 			NetworkOfferingVO findById) throws ConcurrentOperationException, InsufficientAddressCapacityException, ResourceUnavailableException, InsufficientCapacityException;
 
 
-	IpAddress allocateIp(Account ipOwner, boolean isSystem, Account caller, long callerId,
-			DataCenter zone) throws ConcurrentOperationException, ResourceAllocationException, InsufficientAddressCapacityException;
-
 	Map<String, String> finalizeServicesAndProvidersForNetwork(NetworkOffering offering,
 			Long physicalNetworkId);
 
@@ -369,23 +237,14 @@ public interface NetworkManager  {
     
     boolean isNetworkInlineMode(Network network);
 
-    int getRuleCountForIp(Long addressId, FirewallRule.Purpose purpose, FirewallRule.State state);
-
     LoadBalancingServiceProvider getLoadBalancingProviderForNetwork(Network network, Scheme lbScheme);
 
     boolean isSecondaryIpSetForNic(long nicId);
 
-    public String allocateGuestIP(Account ipOwner, boolean isSystem, long zoneId, Long networkId, String requestedIp) throws InsufficientAddressCapacityException;
-
     List<? extends Nic> listVmNics(Long vmId, Long nicId);
     
-    String allocatePublicIpForGuestNic(Long networkId, DataCenter dc, Pod pod, Account caller, String requestedIp) throws InsufficientAddressCapacityException;
-
     NicVO savePlaceholderNic(Network network, String ip4Address, String ip6Address, Type vmType);
 
     DhcpServiceProvider getDhcpServiceProvider(Network network);
-
-    PublicIp assignPublicIpAddressFromVlans(long dcId, Long podId, Account owner, VlanType type, List<Long> vlanDbIds, Long networkId, String requestedIp, boolean isSystem) throws InsufficientAddressCapacityException;
-
     void removeDhcpServiceInSubnet(NicVO nic);
 }


Mime
View raw message