incubator-cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chirad...@apache.org
Subject [14/39] Network-refactor: Refactor NetworkManager into NetworkModel and NetworkManager. NetworkManager's exclusive focus is now - handling plugins during orchestration, and - to deal with ip address allocation. Those classes that used to refer to Netwo
Date Fri, 18 Jan 2013 01:01:23 GMT
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5a830c4d/server/test/com/cloud/network/MockRulesManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/network/MockRulesManagerImpl.java b/server/test/com/cloud/network/MockRulesManagerImpl.java
new file mode 100644
index 0000000..fb5be2b
--- /dev/null
+++ b/server/test/com/cloud/network/MockRulesManagerImpl.java
@@ -0,0 +1,295 @@
+package com.cloud.network;
+
+import java.util.List;
+import java.util.Map;
+
+import javax.ejb.Local;
+import javax.naming.ConfigurationException;
+
+import com.cloud.api.commands.ListPortForwardingRulesCmd;
+import com.cloud.exception.InsufficientAddressCapacityException;
+import com.cloud.exception.NetworkRuleConflictException;
+import com.cloud.exception.ResourceUnavailableException;
+import com.cloud.network.rules.FirewallRule;
+import com.cloud.network.rules.PortForwardingRule;
+import com.cloud.network.rules.PortForwardingRuleVO;
+import com.cloud.network.rules.RulesManager;
+import com.cloud.network.rules.RulesService;
+import com.cloud.network.rules.StaticNatRule;
+import com.cloud.network.rules.FirewallRule.Purpose;
+import com.cloud.user.Account;
+import com.cloud.uservm.UserVm;
+import com.cloud.utils.Pair;
+import com.cloud.utils.component.Manager;
+import com.cloud.vm.VirtualMachine;
+
+@Local(value = {RulesManager.class, RulesService.class})
+public class MockRulesManagerImpl implements RulesManager,  Manager, RulesService {
+
+	@Override
+	public Pair<List<? extends FirewallRule>, Integer> searchStaticNatRules(
+			Long ipId, Long id, Long vmId, Long start, Long size,
+			String accountName, Long domainId, Long projectId,
+			boolean isRecursive, boolean listAll) {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	public PortForwardingRule createPortForwardingRule(PortForwardingRule rule,
+			Long vmId, boolean openFirewall)
+			throws NetworkRuleConflictException {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	public boolean revokePortForwardingRule(long ruleId, boolean apply) {
+		// TODO Auto-generated method stub
+		return false;
+	}
+
+	@Override
+	public Pair<List<? extends PortForwardingRule>, Integer> listPortForwardingRules(
+			ListPortForwardingRulesCmd cmd) {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	public boolean applyPortForwardingRules(long ipAdddressId, Account caller)
+			throws ResourceUnavailableException {
+		// TODO Auto-generated method stub
+		return false;
+	}
+
+	@Override
+	public boolean enableStaticNat(long ipAddressId, long vmId, long networkId,
+			boolean isSystemVm) throws NetworkRuleConflictException,
+			ResourceUnavailableException {
+		// TODO Auto-generated method stub
+		return false;
+	}
+
+	@Override
+	public PortForwardingRule getPortForwardigRule(long ruleId) {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	public FirewallRule getFirewallRule(long ruleId) {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	public StaticNatRule createStaticNatRule(StaticNatRule rule,
+			boolean openFirewall) throws NetworkRuleConflictException {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	public boolean revokeStaticNatRule(long ruleId, boolean apply) {
+		// TODO Auto-generated method stub
+		return false;
+	}
+
+	@Override
+	public boolean applyStaticNatRules(long ipAdddressId, Account caller)
+			throws ResourceUnavailableException {
+		// TODO Auto-generated method stub
+		return false;
+	}
+
+	@Override
+	public StaticNatRule buildStaticNatRule(FirewallRule rule, boolean forRevoke) {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	public List<String> getSourceCidrs(long ruleId) {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	public boolean disableStaticNat(long ipId)
+			throws ResourceUnavailableException, NetworkRuleConflictException,
+			InsufficientAddressCapacityException {
+		// TODO Auto-generated method stub
+		return false;
+	}
+
+	@Override
+	public boolean applyPortForwardingRules(long ipAddressId,
+			boolean continueOnError, Account caller) {
+		// TODO Auto-generated method stub
+		return false;
+	}
+
+	@Override
+	public boolean applyStaticNatRulesForIp(long sourceIpId,
+			boolean continueOnError, Account caller, boolean forRevoke) {
+		// TODO Auto-generated method stub
+		return false;
+	}
+
+	@Override
+	public boolean applyPortForwardingRulesForNetwork(long networkId,
+			boolean continueOnError, Account caller) {
+		// TODO Auto-generated method stub
+		return false;
+	}
+
+	@Override
+	public boolean applyStaticNatRulesForNetwork(long networkId,
+			boolean continueOnError, Account caller) {
+		// TODO Auto-generated method stub
+		return false;
+	}
+
+	@Override
+	public void checkIpAndUserVm(IpAddress ipAddress, UserVm userVm,
+			Account caller) {
+		// TODO Auto-generated method stub
+
+	}
+
+	@Override
+	public void checkRuleAndUserVm(FirewallRule rule, UserVm userVm,
+			Account caller) {
+		// TODO Auto-generated method stub
+
+	}
+
+	@Override
+	public boolean revokeAllPFAndStaticNatRulesForIp(long ipId, long userId,
+			Account caller) throws ResourceUnavailableException {
+		// TODO Auto-generated method stub
+		return false;
+	}
+
+	@Override
+	public boolean revokeAllPFStaticNatRulesForNetwork(long networkId,
+			long userId, Account caller) throws ResourceUnavailableException {
+		// TODO Auto-generated method stub
+		return false;
+	}
+
+	@Override
+	public List<? extends FirewallRule> listFirewallRulesByIp(long ipAddressId) {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	public List<? extends PortForwardingRule> listPortForwardingRulesForApplication(
+			long ipId) {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	public List<? extends PortForwardingRule> gatherPortForwardingRulesForApplication(
+			List<? extends IpAddress> addrs) {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	public boolean revokePortForwardingRulesForVm(long vmId) {
+		// TODO Auto-generated method stub
+		return false;
+	}
+
+	@Override
+	public boolean revokeStaticNatRulesForVm(long vmId) {
+		// TODO Auto-generated method stub
+		return false;
+	}
+
+	@Override
+	public FirewallRule[] reservePorts(IpAddress ip, String protocol,
+			Purpose purpose, boolean openFirewall, Account caller, int... ports)
+			throws NetworkRuleConflictException {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	public boolean releasePorts(long ipId, String protocol, Purpose purpose,
+			int... ports) {
+		// TODO Auto-generated method stub
+		return false;
+	}
+
+	@Override
+	public List<PortForwardingRuleVO> listByNetworkId(long networkId) {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	public boolean applyStaticNatForIp(long sourceIpId,
+			boolean continueOnError, Account caller, boolean forRevoke) {
+		// TODO Auto-generated method stub
+		return false;
+	}
+
+	@Override
+	public boolean applyStaticNatsForNetwork(long networkId,
+			boolean continueOnError, Account caller) {
+		// TODO Auto-generated method stub
+		return false;
+	}
+
+	@Override
+	public void getSystemIpAndEnableStaticNatForVm(VirtualMachine vm,
+			boolean getNewIp) throws InsufficientAddressCapacityException {
+		// TODO Auto-generated method stub
+
+	}
+
+	@Override
+	public boolean disableStaticNat(long ipAddressId, Account caller,
+			long callerUserId, boolean releaseIpIfElastic)
+			throws ResourceUnavailableException {
+		// TODO Auto-generated method stub
+		return false;
+	}
+
+	@Override
+	public boolean applyStaticNatForNetwork(long networkId,
+			boolean continueOnError, Account caller, boolean forRevoke) {
+		// TODO Auto-generated method stub
+		return false;
+	}
+
+	@Override
+	public boolean configure(String name, Map<String, Object> params)
+			throws ConfigurationException {
+		
+		return true;
+	}
+
+	@Override
+	public boolean start() {
+		return true;
+	}
+
+	@Override
+	public boolean stop() {
+		// TODO Auto-generated method stub
+		return false;
+	}
+
+	@Override
+	public String getName() {
+		// TODO Auto-generated method stub
+		return "MockRulesManagerImpl";
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5a830c4d/server/test/com/cloud/network/vpn/MockRemoteAccessVPNServiceProvider.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/network/vpn/MockRemoteAccessVPNServiceProvider.java b/server/test/com/cloud/network/vpn/MockRemoteAccessVPNServiceProvider.java
new file mode 100644
index 0000000..ddccc2b
--- /dev/null
+++ b/server/test/com/cloud/network/vpn/MockRemoteAccessVPNServiceProvider.java
@@ -0,0 +1,62 @@
+package com.cloud.network.vpn;
+
+import java.util.List;
+import java.util.Map;
+
+import javax.ejb.Local;
+import javax.naming.ConfigurationException;
+
+import com.cloud.exception.ResourceUnavailableException;
+import com.cloud.network.Network;
+import com.cloud.network.RemoteAccessVpn;
+import com.cloud.network.VpnUser;
+import com.cloud.network.element.RemoteAccessVPNServiceProvider;
+
+@Local (value = RemoteAccessVPNServiceProvider.class)
+public class MockRemoteAccessVPNServiceProvider implements
+		RemoteAccessVPNServiceProvider {
+
+	@Override
+	public boolean configure(String name, Map<String, Object> params)
+			throws ConfigurationException {
+		return true;
+	}
+
+	@Override
+	public String getName() {
+		return "MockRemoteAccessVPNServiceProvider";
+	}
+
+	@Override
+	public boolean start() {
+		return true;
+	}
+
+	@Override
+	public boolean stop() {
+		// TODO Auto-generated method stub
+		return false;
+	}
+
+	@Override
+	public String[] applyVpnUsers(RemoteAccessVpn vpn,
+			List<? extends VpnUser> users) throws ResourceUnavailableException {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	public boolean startVpn(Network network, RemoteAccessVpn vpn)
+			throws ResourceUnavailableException {
+		// TODO Auto-generated method stub
+		return false;
+	}
+
+	@Override
+	public boolean stopVpn(Network network, RemoteAccessVpn vpn)
+			throws ResourceUnavailableException {
+		// TODO Auto-generated method stub
+		return false;
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5a830c4d/server/test/com/cloud/network/vpn/RemoteAccessVpnTest.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/network/vpn/RemoteAccessVpnTest.java b/server/test/com/cloud/network/vpn/RemoteAccessVpnTest.java
new file mode 100644
index 0000000..f18626a
--- /dev/null
+++ b/server/test/com/cloud/network/vpn/RemoteAccessVpnTest.java
@@ -0,0 +1,91 @@
+package com.cloud.network.vpn;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+
+import javax.naming.ConfigurationException;
+
+import junit.framework.Assert;
+
+import org.apache.log4j.Logger;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import com.cloud.configuration.DefaultInterceptorLibrary;
+import com.cloud.configuration.dao.ConfigurationDaoImpl;
+import com.cloud.domain.dao.DomainDaoImpl;
+import com.cloud.event.dao.UsageEventDaoImpl;
+import com.cloud.network.MockFirewallManagerImpl;
+import com.cloud.network.MockNetworkManagerImpl;
+import com.cloud.network.MockRulesManagerImpl;
+import com.cloud.network.dao.FirewallRulesDaoImpl;
+import com.cloud.network.dao.IPAddressDaoImpl;
+import com.cloud.network.dao.RemoteAccessVpnDaoImpl;
+import com.cloud.network.dao.VpnUserDaoImpl;
+import com.cloud.network.element.RemoteAccessVPNServiceProvider;
+import com.cloud.user.MockAccountManagerImpl;
+import com.cloud.user.MockDomainManagerImpl;
+import com.cloud.user.dao.AccountDaoImpl;
+import com.cloud.utils.Pair;
+import com.cloud.utils.component.ComponentLocator;
+import com.cloud.utils.component.MockComponentLocator;
+
+public class RemoteAccessVpnTest {
+	private MockComponentLocator locator;
+    private final static Logger s_logger = Logger.getLogger(RemoteAccessVpnTest.class);
+
+	
+	private static void addDaos(MockComponentLocator locator) {
+		locator.addDao("AccountDao", AccountDaoImpl.class);
+		locator.addDao("VpnUserDao", VpnUserDaoImpl.class);
+		locator.addDao("FirewallRulesDao", FirewallRulesDaoImpl.class);
+		locator.addDao("IPAddressDao", IPAddressDaoImpl.class);
+		locator.addDao("DomainDao", DomainDaoImpl.class);
+		locator.addDao("UsageEventDao", UsageEventDaoImpl.class);
+		locator.addDao("RemoteAccessVpnDao", RemoteAccessVpnDaoImpl.class);
+		locator.addDao("ConfigurationDao", ConfigurationDaoImpl.class);
+
+	}
+	
+	private static void addManagers(MockComponentLocator locator) {
+		locator.addManager("AccountManager", MockAccountManagerImpl.class);
+		locator.addManager("DomainManager", MockDomainManagerImpl.class);
+		locator.addManager("NetworkManager", MockNetworkManagerImpl.class);
+		locator.addManager("RulesManager", MockRulesManagerImpl.class);
+		locator.addManager("FirewallManager", MockFirewallManagerImpl.class);
+	}
+	
+	@Before
+	public void setUp() {
+		locator = new MockComponentLocator("management-server");
+		addDaos(locator);
+		addManagers(locator);
+		s_logger.info("Finished setUp");
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	
+	@Test
+	public void testInjected() throws Exception  {
+		List<Pair<String, Class<? extends RemoteAccessVPNServiceProvider>>> list = 
+				new ArrayList<Pair<String, Class<? extends RemoteAccessVPNServiceProvider>>>();
+		list.add(new Pair<String, Class<? extends RemoteAccessVPNServiceProvider>>("RemoteAccessVPNServiceProvider", MockRemoteAccessVPNServiceProvider.class));
+		locator.addAdapterChain(RemoteAccessVPNServiceProvider.class, list);
+		s_logger.info("Finished add adapter");
+		locator.makeActive(new DefaultInterceptorLibrary());
+		s_logger.info("Finished make active");
+		RemoteAccessVpnManagerImpl vpnMgr = ComponentLocator.inject(RemoteAccessVpnManagerImpl.class);
+		s_logger.info("Finished inject");
+		Assert.assertTrue(vpnMgr.configure("RemoteAccessVpnMgr",new HashMap<String, Object>()) );
+		Assert.assertTrue(vpnMgr.start());
+		int numProviders = vpnMgr.getRemoteAccessVPNServiceProviders().size();
+		Assert.assertTrue(numProviders > 0);
+	}
+	
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5a830c4d/server/test/com/cloud/vpc/MockNetworkManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/vpc/MockNetworkManagerImpl.java b/server/test/com/cloud/vpc/MockNetworkManagerImpl.java
index f8818c0..15bb830 100644
--- a/server/test/com/cloud/vpc/MockNetworkManagerImpl.java
+++ b/server/test/com/cloud/vpc/MockNetworkManagerImpl.java
@@ -75,186 +75,273 @@ public class MockNetworkManagerImpl implements NetworkManager, NetworkService, M
     private static final Logger s_logger = Logger.getLogger(MockNetworkManagerImpl.class);
 
 
+  
+
+
     /* (non-Javadoc)
-     * @see com.cloud.network.NetworkService#getIsolatedNetworksOwnedByAccountInZone(long, com.cloud.user.Account)
+     * @see com.cloud.utils.component.Manager#start()
      */
     @Override
-    public List<? extends Network> getIsolatedNetworksOwnedByAccountInZone(long zoneId, Account owner) {
-        // TODO Auto-generated method stub
-        return null;
+    public boolean start() {
+        for (NetworkElement element : _networkElements) {
+            Provider implementedProvider = element.getProvider();
+            if (implementedProvider != null) {
+                if (s_providerToNetworkElementMap.containsKey(implementedProvider.getName())) {
+                    s_logger.error("Cannot start MapNetworkManager: Provider <-> NetworkElement must be a one-to-one map, " +
+                            "multiple NetworkElements found for Provider: " + implementedProvider.getName());
+                    return false;
+                }
+                s_providerToNetworkElementMap.put(implementedProvider.getName(), element.getName());
+            }
+        }
+        return true;
     }
 
+
+
+
+
     /* (non-Javadoc)
-     * @see com.cloud.network.NetworkService#releaseIpAddress(long)
+     * @see com.cloud.utils.component.Manager#configure(java.lang.String, java.util.Map)
      */
     @Override
-    public boolean releaseIpAddress(long ipAddressId) throws InsufficientAddressCapacityException {
+    public boolean configure(String name, Map<String, Object> params) throws ConfigurationException {
         // TODO Auto-generated method stub
         return false;
     }
 
+
+
+
+
     /* (non-Javadoc)
-     * @see com.cloud.network.NetworkService#createGuestNetwork(com.cloud.api.commands.CreateNetworkCmd)
+     * @see com.cloud.utils.component.Manager#stop()
      */
     @Override
-    public Network createGuestNetwork(CreateNetworkCmd cmd) throws InsufficientCapacityException, ConcurrentOperationException, ResourceAllocationException {
+    public boolean stop() {
         // TODO Auto-generated method stub
-        return null;
+        return false;
     }
 
+
+
+
+
     /* (non-Javadoc)
-     * @see com.cloud.network.NetworkService#searchForNetworks(com.cloud.api.commands.ListNetworksCmd)
+     * @see com.cloud.utils.component.Manager#getName()
      */
     @Override
-    public List<? extends Network> searchForNetworks(ListNetworksCmd cmd) {
+    public String getName() {
         // TODO Auto-generated method stub
         return null;
     }
 
-    /* (non-Javadoc)
-     * @see com.cloud.network.NetworkService#deleteNetwork(long)
-     */
-    @Override
-    public boolean deleteNetwork(long networkId) {
-        // TODO Auto-generated method stub
-        return false;
-    }
+
+
+
 
     /* (non-Javadoc)
-     * @see com.cloud.network.NetworkService#restartNetwork(com.cloud.api.commands.RestartNetworkCmd, boolean)
+     * @see com.cloud.network.NetworkService#getIsolatedNetworksOwnedByAccountInZone(long, com.cloud.user.Account)
      */
     @Override
-    public boolean restartNetwork(RestartNetworkCmd cmd, boolean cleanup) throws ConcurrentOperationException, ResourceUnavailableException, InsufficientCapacityException {
+    public List<? extends Network> getIsolatedNetworksOwnedByAccountInZone(long zoneId, Account owner) {
         // TODO Auto-generated method stub
-        return false;
+        return null;
     }
 
+
+
+
+
     /* (non-Javadoc)
-     * @see com.cloud.network.NetworkService#getActiveNicsInNetwork(long)
+     * @see com.cloud.network.NetworkService#allocateIP(com.cloud.user.Account, long, java.lang.Long)
      */
     @Override
-    public int getActiveNicsInNetwork(long networkId) {
+    public IpAddress allocateIP(Account ipOwner, long zoneId, Long networkId) throws ResourceAllocationException,
+            InsufficientAddressCapacityException, ConcurrentOperationException {
         // TODO Auto-generated method stub
-        return 0;
+        return null;
     }
 
+
+
+
+
     /* (non-Javadoc)
-     * @see com.cloud.network.NetworkService#getNetwork(long)
+     * @see com.cloud.network.NetworkService#releaseIpAddress(long)
      */
     @Override
-    public Network getNetwork(long networkId) {
+    public boolean releaseIpAddress(long ipAddressId) throws InsufficientAddressCapacityException {
         // TODO Auto-generated method stub
-        return null;
+        return false;
     }
 
+
+
+
+
     /* (non-Javadoc)
-     * @see com.cloud.network.NetworkService#getIp(long)
+     * @see com.cloud.network.NetworkService#createGuestNetwork(com.cloud.api.commands.CreateNetworkCmd)
      */
     @Override
-    public IpAddress getIp(long id) {
+    public Network createGuestNetwork(CreateNetworkCmd cmd) throws InsufficientCapacityException,
+            ConcurrentOperationException, ResourceAllocationException {
         // TODO Auto-generated method stub
         return null;
     }
 
+
+
+
+
     /* (non-Javadoc)
-     * @see com.cloud.network.NetworkService#convertNetworkToNetworkProfile(long)
+     * @see com.cloud.network.NetworkService#searchForNetworks(com.cloud.api.commands.ListNetworksCmd)
      */
     @Override
-    public NetworkProfile convertNetworkToNetworkProfile(long networkId) {
+    public List<? extends Network> searchForNetworks(ListNetworksCmd cmd) {
         // TODO Auto-generated method stub
         return null;
     }
 
+
+
+
+
     /* (non-Javadoc)
-     * @see com.cloud.network.NetworkService#getNetworkCapabilities(long)
+     * @see com.cloud.network.NetworkService#deleteNetwork(long)
      */
     @Override
-    public Map<Service, Map<Capability, String>> getNetworkCapabilities(long networkId) {
+    public boolean deleteNetwork(long networkId) {
         // TODO Auto-generated method stub
-        return null;
+        return false;
     }
 
+
+
+
+
     /* (non-Javadoc)
-     * @see com.cloud.network.NetworkService#isNetworkAvailableInDomain(long, long)
+     * @see com.cloud.network.NetworkService#restartNetwork(com.cloud.api.commands.RestartNetworkCmd, boolean)
      */
     @Override
-    public boolean isNetworkAvailableInDomain(long networkId, long domainId) {
+    public boolean restartNetwork(RestartNetworkCmd cmd, boolean cleanup) throws ConcurrentOperationException,
+            ResourceUnavailableException, InsufficientCapacityException {
         // TODO Auto-generated method stub
         return false;
     }
 
+
+
+
+
     /* (non-Javadoc)
-     * @see com.cloud.network.NetworkService#getDedicatedNetworkDomain(long)
+     * @see com.cloud.network.NetworkService#getActiveNicsInNetwork(long)
      */
     @Override
-    public Long getDedicatedNetworkDomain(long networkId) {
+    public int getActiveNicsInNetwork(long networkId) {
         // TODO Auto-generated method stub
-        return null;
+        return 0;
     }
 
+
+
+
+
     /* (non-Javadoc)
-     * @see com.cloud.network.NetworkService#updateGuestNetwork(long, java.lang.String, java.lang.String, com.cloud.user.Account, com.cloud.user.User, java.lang.String, java.lang.Long, java.lang.Boolean)
+     * @see com.cloud.network.NetworkService#getNetwork(long)
      */
     @Override
-    public Network updateGuestNetwork(long networkId, String name, String displayText, Account callerAccount, User callerUser, String domainSuffix, Long networkOfferingId, Boolean changeCidr) {
+    public Network getNetwork(long networkId) {
         // TODO Auto-generated method stub
         return null;
     }
 
+
+
+
+
     /* (non-Javadoc)
-     * @see com.cloud.network.NetworkService#getNetworkRate(long, java.lang.Long)
+     * @see com.cloud.network.NetworkService#getIp(long)
      */
     @Override
-    public Integer getNetworkRate(long networkId, Long vmId) {
+    public IpAddress getIp(long id) {
         // TODO Auto-generated method stub
         return null;
     }
 
+
+
+
+
     /* (non-Javadoc)
-     * @see com.cloud.network.NetworkService#getSystemNetworkByZoneAndTrafficType(long, com.cloud.network.Networks.TrafficType)
+     * @see com.cloud.network.NetworkService#isNetworkAvailableInDomain(long, long)
      */
     @Override
-    public Network getSystemNetworkByZoneAndTrafficType(long zoneId, TrafficType trafficType) {
+    public boolean isNetworkAvailableInDomain(long networkId, long domainId) {
         // TODO Auto-generated method stub
-        return null;
+        return false;
     }
 
+
+
+
+
     /* (non-Javadoc)
-     * @see com.cloud.network.NetworkService#getNetworkOfferingServiceProvidersMap(long)
+     * @see com.cloud.network.NetworkService#updateGuestNetwork(long, java.lang.String, java.lang.String, com.cloud.user.Account, com.cloud.user.User, java.lang.String, java.lang.Long, java.lang.Boolean)
      */
     @Override
-    public Map<Service, Set<Provider>> getNetworkOfferingServiceProvidersMap(long networkOfferingId) {
+    public Network updateGuestNetwork(long networkId, String name, String displayText, Account callerAccount,
+            User callerUser, String domainSuffix, Long networkOfferingId, Boolean changeCidr) {
         // TODO Auto-generated method stub
         return null;
     }
 
+
+
+
+
     /* (non-Javadoc)
      * @see com.cloud.network.NetworkService#createPhysicalNetwork(java.lang.Long, java.lang.String, java.lang.String, java.util.List, java.lang.String, java.lang.Long, java.util.List, java.lang.String)
      */
     @Override
-    public PhysicalNetwork createPhysicalNetwork(Long zoneId, String vnetRange, String networkSpeed, List<String> isolationMethods, String broadcastDomainRange, Long domainId, List<String> tags, String name) {
+    public PhysicalNetwork createPhysicalNetwork(Long zoneId, String vnetRange, String networkSpeed,
+            List<String> isolationMethods, String broadcastDomainRange, Long domainId, List<String> tags, String name) {
         // TODO Auto-generated method stub
         return null;
     }
 
+
+
+
+
     /* (non-Javadoc)
      * @see com.cloud.network.NetworkService#searchPhysicalNetworks(java.lang.Long, java.lang.Long, java.lang.String, java.lang.Long, java.lang.Long, java.lang.String)
      */
     @Override
-    public Pair<List<? extends PhysicalNetwork>, Integer> searchPhysicalNetworks(Long id, Long zoneId, String keyword, Long startIndex, Long pageSize, String name) {
+    public Pair<List<? extends PhysicalNetwork>, Integer> searchPhysicalNetworks(Long id, Long zoneId, String keyword,
+            Long startIndex, Long pageSize, String name) {
         // TODO Auto-generated method stub
         return null;
     }
 
+
+
+
+
     /* (non-Javadoc)
      * @see com.cloud.network.NetworkService#updatePhysicalNetwork(java.lang.Long, java.lang.String, java.util.List, java.lang.String, java.lang.String)
      */
     @Override
-    public PhysicalNetwork updatePhysicalNetwork(Long id, String networkSpeed, List<String> tags, String newVnetRangeString, String state) {
+    public PhysicalNetwork updatePhysicalNetwork(Long id, String networkSpeed, List<String> tags,
+            String newVnetRangeString, String state) {
         // TODO Auto-generated method stub
         return null;
     }
 
+
+
+
+
     /* (non-Javadoc)
      * @see com.cloud.network.NetworkService#deletePhysicalNetwork(java.lang.Long)
      */
@@ -264,6 +351,10 @@ public class MockNetworkManagerImpl implements NetworkManager, NetworkService, M
         return false;
     }
 
+
+
+
+
     /* (non-Javadoc)
      * @see com.cloud.network.NetworkService#listNetworkServices(java.lang.String)
      */
@@ -273,51 +364,66 @@ public class MockNetworkManagerImpl implements NetworkManager, NetworkService, M
         return null;
     }
 
-    /* (non-Javadoc)
-     * @see com.cloud.network.NetworkService#listSupportedNetworkServiceProviders(java.lang.String)
-     */
-    @Override
-    public List<? extends Provider> listSupportedNetworkServiceProviders(String serviceName) {
-        // TODO Auto-generated method stub
-        return null;
-    }
+
+
+
 
     /* (non-Javadoc)
      * @see com.cloud.network.NetworkService#addProviderToPhysicalNetwork(java.lang.Long, java.lang.String, java.lang.Long, java.util.List)
      */
     @Override
-    public PhysicalNetworkServiceProvider addProviderToPhysicalNetwork(Long physicalNetworkId, String providerName, Long destinationPhysicalNetworkId, List<String> enabledServices) {
+    public PhysicalNetworkServiceProvider addProviderToPhysicalNetwork(Long physicalNetworkId, String providerName,
+            Long destinationPhysicalNetworkId, List<String> enabledServices) {
         // TODO Auto-generated method stub
         return null;
     }
 
+
+
+
+
     /* (non-Javadoc)
      * @see com.cloud.network.NetworkService#listNetworkServiceProviders(java.lang.Long, java.lang.String, java.lang.String, java.lang.Long, java.lang.Long)
      */
     @Override
-    public Pair<List<? extends PhysicalNetworkServiceProvider>, Integer> listNetworkServiceProviders(Long physicalNetworkId, String name, String state, Long startIndex, Long pageSize) {
+    public Pair<List<? extends PhysicalNetworkServiceProvider>, Integer> listNetworkServiceProviders(
+            Long physicalNetworkId, String name, String state, Long startIndex, Long pageSize) {
         // TODO Auto-generated method stub
         return null;
     }
 
+
+
+
+
     /* (non-Javadoc)
      * @see com.cloud.network.NetworkService#updateNetworkServiceProvider(java.lang.Long, java.lang.String, java.util.List)
      */
     @Override
-    public PhysicalNetworkServiceProvider updateNetworkServiceProvider(Long id, String state, List<String> enabledServices) {
+    public PhysicalNetworkServiceProvider updateNetworkServiceProvider(Long id, String state,
+            List<String> enabledServices) {
         // TODO Auto-generated method stub
         return null;
     }
 
+
+
+
+
     /* (non-Javadoc)
      * @see com.cloud.network.NetworkService#deleteNetworkServiceProvider(java.lang.Long)
      */
     @Override
-    public boolean deleteNetworkServiceProvider(Long id) throws ConcurrentOperationException, ResourceUnavailableException {
+    public boolean deleteNetworkServiceProvider(Long id) throws ConcurrentOperationException,
+            ResourceUnavailableException {
         // TODO Auto-generated method stub
         return false;
     }
 
+
+
+
+
     /* (non-Javadoc)
      * @see com.cloud.network.NetworkService#getPhysicalNetwork(java.lang.Long)
      */
@@ -327,6 +433,10 @@ public class MockNetworkManagerImpl implements NetworkManager, NetworkService, M
         return null;
     }
 
+
+
+
+
     /* (non-Javadoc)
      * @see com.cloud.network.NetworkService#getCreatedPhysicalNetwork(java.lang.Long)
      */
@@ -336,6 +446,10 @@ public class MockNetworkManagerImpl implements NetworkManager, NetworkService, M
         return null;
     }
 
+
+
+
+
     /* (non-Javadoc)
      * @see com.cloud.network.NetworkService#getPhysicalNetworkServiceProvider(java.lang.Long)
      */
@@ -345,6 +459,10 @@ public class MockNetworkManagerImpl implements NetworkManager, NetworkService, M
         return null;
     }
 
+
+
+
+
     /* (non-Javadoc)
      * @see com.cloud.network.NetworkService#getCreatedPhysicalNetworkServiceProvider(java.lang.Long)
      */
@@ -354,6 +472,10 @@ public class MockNetworkManagerImpl implements NetworkManager, NetworkService, M
         return null;
     }
 
+
+
+
+
     /* (non-Javadoc)
      * @see com.cloud.network.NetworkService#findPhysicalNetworkId(long, java.lang.String, com.cloud.network.Networks.TrafficType)
      */
@@ -363,15 +485,24 @@ public class MockNetworkManagerImpl implements NetworkManager, NetworkService, M
         return 0;
     }
 
+
+
+
+
     /* (non-Javadoc)
      * @see com.cloud.network.NetworkService#addTrafficTypeToPhysicalNetwork(java.lang.Long, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String)
      */
     @Override
-    public PhysicalNetworkTrafficType addTrafficTypeToPhysicalNetwork(Long physicalNetworkId, String trafficType, String xenLabel, String kvmLabel, String vmwareLabel, String simulatorLabel, String vlan) {
+    public PhysicalNetworkTrafficType addTrafficTypeToPhysicalNetwork(Long physicalNetworkId, String trafficType,
+            String xenLabel, String kvmLabel, String vmwareLabel, String simulatorLabel, String vlan) {
         // TODO Auto-generated method stub
         return null;
     }
 
+
+
+
+
     /* (non-Javadoc)
      * @see com.cloud.network.NetworkService#getPhysicalNetworkTrafficType(java.lang.Long)
      */
@@ -381,15 +512,24 @@ public class MockNetworkManagerImpl implements NetworkManager, NetworkService, M
         return null;
     }
 
+
+
+
+
     /* (non-Javadoc)
      * @see com.cloud.network.NetworkService#updatePhysicalNetworkTrafficType(java.lang.Long, java.lang.String, java.lang.String, java.lang.String)
      */
     @Override
-    public PhysicalNetworkTrafficType updatePhysicalNetworkTrafficType(Long id, String xenLabel, String kvmLabel, String vmwareLabel) {
+    public PhysicalNetworkTrafficType updatePhysicalNetworkTrafficType(Long id, String xenLabel, String kvmLabel,
+            String vmwareLabel) {
         // TODO Auto-generated method stub
         return null;
     }
 
+
+
+
+
     /* (non-Javadoc)
      * @see com.cloud.network.NetworkService#deletePhysicalNetworkTrafficType(java.lang.Long)
      */
@@ -399,6 +539,10 @@ public class MockNetworkManagerImpl implements NetworkManager, NetworkService, M
         return false;
     }
 
+
+
+
+
     /* (non-Javadoc)
      * @see com.cloud.network.NetworkService#listTrafficTypes(java.lang.Long)
      */
@@ -408,14 +552,9 @@ public class MockNetworkManagerImpl implements NetworkManager, NetworkService, M
         return null;
     }
 
-    /* (non-Javadoc)
-     * @see com.cloud.network.NetworkService#getDefaultPhysicalNetworkByZoneAndTrafficType(long, com.cloud.network.Networks.TrafficType)
-     */
-    @Override
-    public PhysicalNetwork getDefaultPhysicalNetworkByZoneAndTrafficType(long zoneId, TrafficType trafficType) {
-        // TODO Auto-generated method stub
-        return null;
-    }
+
+
+
 
     /* (non-Javadoc)
      * @see com.cloud.network.NetworkService#getExclusiveGuestNetwork(long)
@@ -426,6 +565,10 @@ public class MockNetworkManagerImpl implements NetworkManager, NetworkService, M
         return null;
     }
 
+
+
+
+
     /* (non-Javadoc)
      * @see com.cloud.network.NetworkService#listTrafficTypeImplementor(com.cloud.api.commands.ListTrafficTypeImplementorsCmd)
      */
@@ -435,6 +578,10 @@ public class MockNetworkManagerImpl implements NetworkManager, NetworkService, M
         return null;
     }
 
+
+
+
+
     /* (non-Javadoc)
      * @see com.cloud.network.NetworkService#getIsolatedNetworksWithSourceNATOwnedByAccountInZone(long, com.cloud.user.Account)
      */
@@ -444,61 +591,53 @@ public class MockNetworkManagerImpl implements NetworkManager, NetworkService, M
         return null;
     }
 
+
+
+
+
     /* (non-Javadoc)
-     * @see com.cloud.network.NetworkService#listNetworksByVpc(long)
+     * @see com.cloud.network.NetworkService#associateIPToNetwork(long, long)
      */
     @Override
-    public List<? extends Network> listNetworksByVpc(long vpcId) {
+    public IpAddress associateIPToNetwork(long ipId, long networkId) throws InsufficientAddressCapacityException,
+            ResourceAllocationException, ResourceUnavailableException, ConcurrentOperationException {
         // TODO Auto-generated method stub
         return null;
     }
 
+
+
+
+
     /* (non-Javadoc)
-     * @see com.cloud.network.NetworkService#isVmPartOfNetwork(long, long)
+     * @see com.cloud.network.NetworkService#createPrivateNetwork(java.lang.String, java.lang.String, long, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, long, java.lang.Long)
      */
     @Override
-    public boolean isVmPartOfNetwork(long vmId, long ntwkId) {
+    public Network createPrivateNetwork(String networkName, String displayText, long physicalNetworkId, String vlan,
+            String startIp, String endIP, String gateway, String netmask, long networkOwnerId, Long vpcId)
+            throws ResourceAllocationException, ConcurrentOperationException, InsufficientCapacityException {
         // TODO Auto-generated method stub
-        return false;
+        return null;
     }
 
-    /* (non-Javadoc)
-     * @see com.cloud.network.NetworkService#associateIPToNetwork(long, long)
-     */
-    @Override
-    public IpAddress associateIPToNetwork(long ipId, long networkId) throws InsufficientAddressCapacityException, ResourceAllocationException, ResourceUnavailableException, ConcurrentOperationException {
-        // TODO Auto-generated method stub
-        return null;
-    }
 
-    /* (non-Javadoc)
-     * @see com.cloud.network.NetworkService#createPrivateNetwork(java.lang.String, java.lang.String, long, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, long, java.lang.Long)
-     */
-    @Override
-    public Network createPrivateNetwork(String networkName, String displayText, long physicalNetworkId, String vlan, String startIp, String endIP, String gateway, String netmask, long networkOwnerId, Long vpcId)
-            throws ResourceAllocationException, ConcurrentOperationException, InsufficientCapacityException {
-        // TODO Auto-generated method stub
-        return null;
-    }
 
-    /* (non-Javadoc)
-     * @see com.cloud.network.NetworkService#canUseForDeploy(com.cloud.network.Network)
-     */
-    @Override
-    public boolean canUseForDeploy(Network network) {
-        // TODO Auto-generated method stub
-        return false;
-    }
+
 
     /* (non-Javadoc)
      * @see com.cloud.network.NetworkManager#assignPublicIpAddress(long, java.lang.Long, com.cloud.user.Account, com.cloud.dc.Vlan.VlanType, java.lang.Long, java.lang.String, boolean)
      */
     @Override
-    public PublicIp assignPublicIpAddress(long dcId, Long podId, Account owner, VlanType type, Long networkId, String requestedIp, boolean isSystem) throws InsufficientAddressCapacityException {
+    public PublicIp assignPublicIpAddress(long dcId, Long podId, Account owner, VlanType type, Long networkId,
+            String requestedIp, boolean isSystem) throws InsufficientAddressCapacityException {
         // TODO Auto-generated method stub
         return null;
     }
 
+
+
+
+
     /* (non-Javadoc)
      * @see com.cloud.network.NetworkManager#disassociatePublicIpAddress(long, long, com.cloud.user.Account)
      */
@@ -508,71 +647,82 @@ public class MockNetworkManagerImpl implements NetworkManager, NetworkService, M
         return false;
     }
 
-    /* (non-Javadoc)
-     * @see com.cloud.network.NetworkManager#listPublicIpsAssignedToGuestNtwk(long, long, java.lang.Boolean)
-     */
-    @Override
-    public List<IPAddressVO> listPublicIpsAssignedToGuestNtwk(long accountId, long associatedNetworkId, Boolean sourceNat) {
-        // TODO Auto-generated method stub
-        return null;
-    }
+
+
+
 
     /* (non-Javadoc)
      * @see com.cloud.network.NetworkManager#setupNetwork(com.cloud.user.Account, com.cloud.offerings.NetworkOfferingVO, com.cloud.deploy.DeploymentPlan, java.lang.String, java.lang.String, boolean)
      */
     @Override
-    public List<NetworkVO> setupNetwork(Account owner, NetworkOfferingVO offering, DeploymentPlan plan, String name, String displayText, boolean isDefault) throws ConcurrentOperationException {
+    public List<NetworkVO> setupNetwork(Account owner, NetworkOfferingVO offering, DeploymentPlan plan, String name,
+            String displayText, boolean isDefault) throws ConcurrentOperationException {
         // TODO Auto-generated method stub
         return null;
     }
 
+
+
+
+
     /* (non-Javadoc)
      * @see com.cloud.network.NetworkManager#setupNetwork(com.cloud.user.Account, com.cloud.offerings.NetworkOfferingVO, com.cloud.network.Network, com.cloud.deploy.DeploymentPlan, java.lang.String, java.lang.String, boolean, java.lang.Long, com.cloud.acl.ControlledEntity.ACLType, java.lang.Boolean, java.lang.Long)
      */
     @Override
-    public List<NetworkVO> setupNetwork(Account owner, NetworkOfferingVO offering, Network predefined, DeploymentPlan plan, String name, String displayText, boolean errorIfAlreadySetup, Long domainId, ACLType aclType,
-            Boolean subdomainAccess, Long vpcId) throws ConcurrentOperationException {
+    public List<NetworkVO> setupNetwork(Account owner, NetworkOfferingVO offering, Network predefined,
+            DeploymentPlan plan, String name, String displayText, boolean errorIfAlreadySetup, Long domainId,
+            ACLType aclType, Boolean subdomainAccess, Long vpcId) throws ConcurrentOperationException {
         // TODO Auto-generated method stub
         return null;
     }
 
-    /* (non-Javadoc)
-     * @see com.cloud.network.NetworkManager#getSystemAccountNetworkOfferings(java.lang.String[])
-     */
-    @Override
-    public List<NetworkOfferingVO> getSystemAccountNetworkOfferings(String... offeringNames) {
-        // TODO Auto-generated method stub
-        return null;
-    }
+
+
+
 
     /* (non-Javadoc)
      * @see com.cloud.network.NetworkManager#allocate(com.cloud.vm.VirtualMachineProfile, java.util.List)
      */
     @Override
-    public void allocate(VirtualMachineProfile<? extends VMInstanceVO> vm, List<Pair<NetworkVO, NicProfile>> networks) throws InsufficientCapacityException, ConcurrentOperationException {
+    public void allocate(VirtualMachineProfile<? extends VMInstanceVO> vm, List<Pair<NetworkVO, NicProfile>> networks)
+            throws InsufficientCapacityException, ConcurrentOperationException {
         // TODO Auto-generated method stub
         
     }
 
+
+
+
+
     /* (non-Javadoc)
      * @see com.cloud.network.NetworkManager#prepare(com.cloud.vm.VirtualMachineProfile, com.cloud.deploy.DeployDestination, com.cloud.vm.ReservationContext)
      */
     @Override
-    public void prepare(VirtualMachineProfile<? extends VMInstanceVO> profile, DeployDestination dest, ReservationContext context) throws InsufficientCapacityException, ConcurrentOperationException,
+    public void prepare(VirtualMachineProfile<? extends VMInstanceVO> profile, DeployDestination dest,
+            ReservationContext context) throws InsufficientCapacityException, ConcurrentOperationException,
             ResourceUnavailableException {
         // TODO Auto-generated method stub
         
     }
 
+
+
+
+
     /* (non-Javadoc)
      * @see com.cloud.network.NetworkManager#release(com.cloud.vm.VirtualMachineProfile, boolean)
      */
     @Override
-    public void release(VirtualMachineProfile<? extends VMInstanceVO> vmProfile, boolean forced) throws ConcurrentOperationException, ResourceUnavailableException {
+    public void release(VirtualMachineProfile<? extends VMInstanceVO> vmProfile, boolean forced)
+            throws ConcurrentOperationException, ResourceUnavailableException {
         // TODO Auto-generated method stub
         
     }
 
+
+
+
+
     /* (non-Javadoc)
      * @see com.cloud.network.NetworkManager#cleanupNics(com.cloud.vm.VirtualMachineProfile)
      */
@@ -582,6 +732,10 @@ public class MockNetworkManagerImpl implements NetworkManager, NetworkService, M
         
     }
 
+
+
+
+
     /* (non-Javadoc)
      * @see com.cloud.network.NetworkManager#expungeNics(com.cloud.vm.VirtualMachineProfile)
      */
@@ -591,14 +745,9 @@ public class MockNetworkManagerImpl implements NetworkManager, NetworkService, M
         
     }
 
-    /* (non-Javadoc)
-     * @see com.cloud.network.NetworkManager#getNics(long)
-     */
-    @Override
-    public List<? extends Nic> getNics(long vmId) {
-        // TODO Auto-generated method stub
-        return null;
-    }
+
+
+
 
     /* (non-Javadoc)
      * @see com.cloud.network.NetworkManager#getNicProfiles(com.cloud.vm.VirtualMachine)
@@ -609,61 +758,38 @@ public class MockNetworkManagerImpl implements NetworkManager, NetworkService, M
         return null;
     }
 
-    /* (non-Javadoc)
-     * @see com.cloud.network.NetworkManager#getNextAvailableMacAddressInNetwork(long)
-     */
-    @Override
-    public String getNextAvailableMacAddressInNetwork(long networkConfigurationId) throws InsufficientAddressCapacityException {
-        // TODO Auto-generated method stub
-        return null;
-    }
+
+
 
 
     /* (non-Javadoc)
-     * @see com.cloud.network.NetworkManager#validateRule(com.cloud.network.rules.FirewallRule)
+     * @see com.cloud.network.NetworkManager#applyRules(java.util.List, com.cloud.network.rules.FirewallRule.Purpose, com.cloud.network.NetworkRuleApplier, boolean)
      */
     @Override
-    public boolean validateRule(FirewallRule rule) {
+    public boolean applyRules(List<? extends FirewallRule> rules, Purpose purpose, NetworkRuleApplier applier,
+            boolean continueOnError) throws ResourceUnavailableException {
         // TODO Auto-generated method stub
         return false;
     }
 
-    /* (non-Javadoc)
-     * @see com.cloud.network.NetworkManager#getPublicIpAddress(long)
-     */
-    @Override
-    public PublicIpAddress getPublicIpAddress(long ipAddressId) {
-        // TODO Auto-generated method stub
-        return null;
-    }
 
-    /* (non-Javadoc)
-     * @see com.cloud.network.NetworkManager#listPodVlans(long)
-     */
-    @Override
-    public List<? extends Vlan> listPodVlans(long podId) {
-        // TODO Auto-generated method stub
-        return null;
-    }
+
+
 
     /* (non-Javadoc)
      * @see com.cloud.network.NetworkManager#implementNetwork(long, com.cloud.deploy.DeployDestination, com.cloud.vm.ReservationContext)
      */
     @Override
-    public Pair<NetworkGuru, NetworkVO> implementNetwork(long networkId, DeployDestination dest, ReservationContext context) throws ConcurrentOperationException, ResourceUnavailableException,
+    public Pair<NetworkGuru, NetworkVO> implementNetwork(long networkId, DeployDestination dest,
+            ReservationContext context) throws ConcurrentOperationException, ResourceUnavailableException,
             InsufficientCapacityException {
         // TODO Auto-generated method stub
         return null;
     }
 
-    /* (non-Javadoc)
-     * @see com.cloud.network.NetworkManager#listNetworksUsedByVm(long, boolean)
-     */
-    @Override
-    public List<NetworkVO> listNetworksUsedByVm(long vmId, boolean isSystem) {
-        // TODO Auto-generated method stub
-        return null;
-    }
+
+
+
 
     /* (non-Javadoc)
      * @see com.cloud.network.NetworkManager#prepareNicForMigration(com.cloud.vm.VirtualMachineProfile, com.cloud.deploy.DeployDestination)
@@ -674,6 +800,10 @@ public class MockNetworkManagerImpl implements NetworkManager, NetworkService, M
         
     }
 
+
+
+
+
     /* (non-Javadoc)
      * @see com.cloud.network.NetworkManager#shutdownNetwork(long, com.cloud.vm.ReservationContext, boolean)
      */
@@ -683,6 +813,10 @@ public class MockNetworkManagerImpl implements NetworkManager, NetworkService, M
         return false;
     }
 
+
+
+
+
     /* (non-Javadoc)
      * @see com.cloud.network.NetworkManager#destroyNetwork(long, com.cloud.vm.ReservationContext)
      */
@@ -692,816 +826,414 @@ public class MockNetworkManagerImpl implements NetworkManager, NetworkService, M
         return false;
     }
 
+
+
+
+
     /* (non-Javadoc)
      * @see com.cloud.network.NetworkManager#createGuestNetwork(long, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, com.cloud.user.Account, java.lang.Long, com.cloud.network.PhysicalNetwork, long, com.cloud.acl.ControlledEntity.ACLType, java.lang.Boolean, java.lang.Long)
      */
     @Override
-    public Network createGuestNetwork(long networkOfferingId, String name, String displayText, String gateway, String cidr, String vlanId, String networkDomain, Account owner, Long domainId,
-            PhysicalNetwork physicalNetwork, long zoneId, ACLType aclType, Boolean subdomainAccess, Long vpcId) throws ConcurrentOperationException, InsufficientCapacityException, ResourceAllocationException {
+    public Network createGuestNetwork(long networkOfferingId, String name, String displayText, String gateway,
+            String cidr, String vlanId, String networkDomain, Account owner, Long domainId,
+            PhysicalNetwork physicalNetwork, long zoneId, ACLType aclType, Boolean subdomainAccess, Long vpcId)
+            throws ConcurrentOperationException, InsufficientCapacityException, ResourceAllocationException {
         // TODO Auto-generated method stub
         return null;
     }
 
+
+
+
+
     /* (non-Javadoc)
      * @see com.cloud.network.NetworkManager#associateIpAddressListToAccount(long, long, long, java.lang.Long, com.cloud.network.Network)
      */
     @Override
-    public boolean associateIpAddressListToAccount(long userId, long accountId, long zoneId, Long vlanId, Network guestNetwork) throws InsufficientCapacityException, ConcurrentOperationException,
+    public boolean associateIpAddressListToAccount(long userId, long accountId, long zoneId, Long vlanId,
+            Network guestNetwork) throws InsufficientCapacityException, ConcurrentOperationException,
             ResourceUnavailableException, ResourceAllocationException {
         // TODO Auto-generated method stub
         return false;
     }
 
+
+
+
+
     /* (non-Javadoc)
-     * @see com.cloud.network.NetworkManager#getNicInNetwork(long, long)
+     * @see com.cloud.network.NetworkManager#getPasswordResetProvider(com.cloud.network.Network)
      */
     @Override
-    public Nic getNicInNetwork(long vmId, long networkId) {
+    public UserDataServiceProvider getPasswordResetProvider(Network network) {
         // TODO Auto-generated method stub
         return null;
     }
 
+
+
+
+
     /* (non-Javadoc)
-     * @see com.cloud.network.NetworkManager#getNicsForTraffic(long, com.cloud.network.Networks.TrafficType)
+     * @see com.cloud.network.NetworkManager#applyIpAssociations(com.cloud.network.Network, boolean)
      */
     @Override
-    public List<? extends Nic> getNicsForTraffic(long vmId, TrafficType type) {
+    public boolean applyIpAssociations(Network network, boolean continueOnError) throws ResourceUnavailableException {
         // TODO Auto-generated method stub
-        return null;
+        return false;
     }
 
+
+
+
+
     /* (non-Javadoc)
-     * @see com.cloud.network.NetworkManager#getDefaultNetworkForVm(long)
+     * @see com.cloud.network.NetworkManager#applyIpAssociations(com.cloud.network.Network, boolean, boolean, java.util.List)
      */
     @Override
-    public Network getDefaultNetworkForVm(long vmId) {
+    public boolean applyIpAssociations(Network network, boolean rulesRevoked, boolean continueOnError,
+            List<PublicIp> publicIps) throws ResourceUnavailableException {
         // TODO Auto-generated method stub
-        return null;
+        return false;
     }
 
+
+
+
+
     /* (non-Javadoc)
-     * @see com.cloud.network.NetworkManager#getDefaultNic(long)
+     * @see com.cloud.network.NetworkManager#startNetwork(long, com.cloud.deploy.DeployDestination, com.cloud.vm.ReservationContext)
      */
     @Override
-    public Nic getDefaultNic(long vmId) {
+    public boolean startNetwork(long networkId, DeployDestination dest, ReservationContext context)
+            throws ConcurrentOperationException, ResourceUnavailableException, InsufficientCapacityException {
         // TODO Auto-generated method stub
-        return null;
+        return false;
     }
 
+
+
+
+
     /* (non-Javadoc)
-     * @see com.cloud.network.NetworkManager#getPasswordResetElements()
+     * @see com.cloud.network.NetworkManager#markIpAsUnavailable(long)
      */
     @Override
-    public UserDataServiceProvider getPasswordResetProvider(Network network) {
+    public IPAddressVO markIpAsUnavailable(long addrId) {
         // TODO Auto-generated method stub
         return null;
     }
 
-    @Override
-    public UserDataServiceProvider getUserDataUpdateProvider(Network network) {
-        // TODO Auto-generated method stub
-        return null;
-    }
 
-    /* (non-Javadoc)
-     * @see com.cloud.network.NetworkManager#networkIsConfiguredForExternalNetworking(long, long)
-     */
-    @Override
-    public boolean networkIsConfiguredForExternalNetworking(long zoneId, long networkId) {
-        // TODO Auto-generated method stub
-        return false;
-    }
+
+
 
     /* (non-Javadoc)
-     * @see com.cloud.network.NetworkManager#getNetworkServiceCapabilities(long, com.cloud.network.Network.Service)
+     * @see com.cloud.network.NetworkManager#acquireGuestIpAddress(com.cloud.network.Network, java.lang.String)
      */
     @Override
-    public Map<Capability, String> getNetworkServiceCapabilities(long networkId, Service service) {
+    public String acquireGuestIpAddress(Network network, String requestedIp) {
         // TODO Auto-generated method stub
         return null;
     }
 
+
+
+
+
     /* (non-Javadoc)
-     * @see com.cloud.network.NetworkManager#applyIpAssociations(com.cloud.network.Network, boolean)
+     * @see com.cloud.network.NetworkManager#applyStaticNats(java.util.List, boolean)
      */
     @Override
-    public boolean applyIpAssociations(Network network, boolean continueOnError) throws ResourceUnavailableException {
+    public boolean applyStaticNats(List<? extends StaticNat> staticNats, boolean continueOnError)
+            throws ResourceUnavailableException {
         // TODO Auto-generated method stub
         return false;
     }
 
+
+
+
+
     /* (non-Javadoc)
-     * @see com.cloud.network.NetworkManager#areServicesSupportedByNetworkOffering(long, com.cloud.network.Network.Service[])
+     * @see com.cloud.network.NetworkManager#reallocate(com.cloud.vm.VirtualMachineProfile, com.cloud.deploy.DataCenterDeployment)
      */
     @Override
-    public boolean areServicesSupportedByNetworkOffering(long networkOfferingId, Service... services) {
-        return (_ntwkOfferingSrvcDao.areServicesSupportedByNetworkOffering(networkOfferingId, services));
+    public boolean reallocate(VirtualMachineProfile<? extends VMInstanceVO> vm, DataCenterDeployment dest)
+            throws InsufficientCapacityException, ConcurrentOperationException {
+        // TODO Auto-generated method stub
+        return false;
     }
 
+
+
+
+
     /* (non-Javadoc)
-     * @see com.cloud.network.NetworkManager#getNetworkWithSecurityGroupEnabled(java.lang.Long)
+     * @see com.cloud.network.NetworkManager#assignSystemIp(long, com.cloud.user.Account, boolean, boolean)
      */
     @Override
-    public NetworkVO getNetworkWithSecurityGroupEnabled(Long zoneId) {
+    public IpAddress assignSystemIp(long networkId, Account owner, boolean forElasticLb, boolean forElasticIp)
+            throws InsufficientAddressCapacityException {
         // TODO Auto-generated method stub
         return null;
     }
 
+
+
+
+
     /* (non-Javadoc)
-     * @see com.cloud.network.NetworkManager#startNetwork(long, com.cloud.deploy.DeployDestination, com.cloud.vm.ReservationContext)
+     * @see com.cloud.network.NetworkManager#handleSystemIpRelease(com.cloud.network.IpAddress)
      */
     @Override
-    public boolean startNetwork(long networkId, DeployDestination dest, ReservationContext context) throws ConcurrentOperationException, ResourceUnavailableException, InsufficientCapacityException {
+    public boolean handleSystemIpRelease(IpAddress ip) {
         // TODO Auto-generated method stub
         return false;
     }
 
+
+
+
+
     /* (non-Javadoc)
-     * @see com.cloud.network.NetworkManager#getIpOfNetworkElementInVirtualNetwork(long, long)
+     * @see com.cloud.network.NetworkManager#allocateDirectIp(com.cloud.vm.NicProfile, com.cloud.dc.DataCenter, com.cloud.vm.VirtualMachineProfile, com.cloud.network.Network, java.lang.String)
      */
     @Override
-    public String getIpOfNetworkElementInVirtualNetwork(long accountId, long dataCenterId) {
+    public void allocateDirectIp(NicProfile nic, DataCenter dc, VirtualMachineProfile<? extends VirtualMachine> vm,
+            Network network, String requestedIp) throws InsufficientVirtualNetworkCapcityException,
+            InsufficientAddressCapacityException {
         // TODO Auto-generated method stub
-        return null;
+        
     }
 
+
+
+
+
     /* (non-Javadoc)
-     * @see com.cloud.network.NetworkManager#listNetworksForAccount(long, long, com.cloud.network.Network.GuestType)
+     * @see com.cloud.network.NetworkManager#assignSourceNatIpAddressToGuestNetwork(com.cloud.user.Account, com.cloud.network.Network)
      */
     @Override
-    public List<NetworkVO> listNetworksForAccount(long accountId, long zoneId, GuestType type) {
+    public PublicIp assignSourceNatIpAddressToGuestNetwork(Account owner, Network guestNetwork)
+            throws InsufficientAddressCapacityException, ConcurrentOperationException {
         // TODO Auto-generated method stub
         return null;
     }
 
+
+
+
+
     /* (non-Javadoc)
-     * @see com.cloud.network.NetworkManager#listAllNetworksInAllZonesByType(com.cloud.network.Network.GuestType)
+     * @see com.cloud.network.NetworkManager#allocateNic(com.cloud.vm.NicProfile, com.cloud.network.Network, java.lang.Boolean, int, com.cloud.vm.VirtualMachineProfile)
      */
     @Override
-    public List<NetworkVO> listAllNetworksInAllZonesByType(GuestType type) {
+    public Pair<NicProfile, Integer> allocateNic(NicProfile requested, Network network, Boolean isDefaultNic,
+            int deviceId, VirtualMachineProfile<? extends VMInstanceVO> vm)
+            throws InsufficientVirtualNetworkCapcityException, InsufficientAddressCapacityException,
+            ConcurrentOperationException {
         // TODO Auto-generated method stub
         return null;
     }
 
+
+
+
+
     /* (non-Javadoc)
-     * @see com.cloud.network.NetworkManager#markIpAsUnavailable(long)
+     * @see com.cloud.network.NetworkManager#prepareNic(com.cloud.vm.VirtualMachineProfile, com.cloud.deploy.DeployDestination, com.cloud.vm.ReservationContext, long, com.cloud.network.NetworkVO)
      */
     @Override
-    public IPAddressVO markIpAsUnavailable(long addrId) {
+    public NicProfile prepareNic(VirtualMachineProfile<? extends VMInstanceVO> vmProfile, DeployDestination dest,
+            ReservationContext context, long nicId, NetworkVO network)
+            throws InsufficientVirtualNetworkCapcityException, InsufficientAddressCapacityException,
+            ConcurrentOperationException, InsufficientCapacityException, ResourceUnavailableException {
         // TODO Auto-generated method stub
         return null;
     }
 
+
+
+
+
     /* (non-Javadoc)
-     * @see com.cloud.network.NetworkManager#acquireGuestIpAddress(com.cloud.network.Network, java.lang.String)
+     * @see com.cloud.network.NetworkManager#removeNic(com.cloud.vm.VirtualMachineProfile, com.cloud.vm.Nic)
      */
     @Override
-    public String acquireGuestIpAddress(Network network, String requestedIp) {
+    public void removeNic(VirtualMachineProfile<? extends VMInstanceVO> vm, Nic nic) {
         // TODO Auto-generated method stub
-        return null;
+        
     }
 
+
+
+
+
     /* (non-Javadoc)
-     * @see com.cloud.network.NetworkManager#getGlobalGuestDomainSuffix()
+     * @see com.cloud.network.NetworkManager#associateIPToGuestNetwork(long, long, boolean)
      */
     @Override
-    public String getGlobalGuestDomainSuffix() {
+    public IPAddressVO associateIPToGuestNetwork(long ipAddrId, long networkId, boolean releaseOnFailure)
+            throws ResourceAllocationException, ResourceUnavailableException, InsufficientAddressCapacityException,
+            ConcurrentOperationException {
         // TODO Auto-generated method stub
         return null;
     }
 
+
+
+
+
     /* (non-Javadoc)
-     * @see com.cloud.network.NetworkManager#getStartIpAddress(long)
+     * @see com.cloud.network.NetworkManager#setupDns(com.cloud.network.Network, com.cloud.network.Network.Provider)
      */
     @Override
-    public String getStartIpAddress(long networkId) {
+    public boolean setupDns(Network network, Provider provider) {
         // TODO Auto-generated method stub
-        return null;
+        return false;
     }
 
+
+
+
+
     /* (non-Javadoc)
-     * @see com.cloud.network.NetworkManager#applyStaticNats(java.util.List, boolean)
+     * @see com.cloud.network.NetworkManager#releaseNic(com.cloud.vm.VirtualMachineProfile, com.cloud.vm.Nic)
      */
     @Override
-    public boolean applyStaticNats(List<? extends StaticNat> staticNats, boolean continueOnError) throws ResourceUnavailableException {
+    public void releaseNic(VirtualMachineProfile<? extends VMInstanceVO> vmProfile, Nic nic)
+            throws ConcurrentOperationException, ResourceUnavailableException {
         // TODO Auto-generated method stub
-        return false;
+        
     }
 
-    /* (non-Javadoc)
-     * @see com.cloud.network.NetworkManager#getIpInNetwork(long, long)
-     */
-    @Override
-    public String getIpInNetwork(long vmId, long networkId) {
-        // TODO Auto-generated method stub
-        return null;
-    }
 
-    /* (non-Javadoc)
-     * @see com.cloud.network.NetworkManager#getIpInNetworkIncludingRemoved(long, long)
-     */
-    @Override
-    public String getIpInNetworkIncludingRemoved(long vmId, long networkId) {
-        // TODO Auto-generated method stub
-        return null;
-    }
 
-    /* (non-Javadoc)
-     * @see com.cloud.network.NetworkManager#getPodIdForVlan(long)
-     */
-    @Override
-    public Long getPodIdForVlan(long vlanDbId) {
-        // TODO Auto-generated method stub
-        return null;
-    }
 
-    /* (non-Javadoc)
-     * @see com.cloud.network.NetworkManager#listNetworkOfferingsForUpgrade(long)
-     */
-    @Override
-    public List<Long> listNetworkOfferingsForUpgrade(long networkId) {
-        // TODO Auto-generated method stub
-        return null;
-    }
 
     /* (non-Javadoc)
-     * @see com.cloud.network.NetworkManager#isSecurityGroupSupportedInNetwork(com.cloud.network.Network)
-     */
-    @Override
-    public boolean isSecurityGroupSupportedInNetwork(Network network) {
-        // TODO Auto-generated method stub
-        return false;
-    }
-
-    /* (non-Javadoc)
-     * @see com.cloud.network.NetworkManager#isProviderSupportServiceInNetwork(long, com.cloud.network.Network.Service, com.cloud.network.Network.Provider)
-     */
-    @Override
-    public boolean isProviderSupportServiceInNetwork(long networkId, Service service, Provider provider) {
-        // TODO Auto-generated method stub
-        return false;
-    }
-
-    /* (non-Javadoc)
-     * @see com.cloud.network.NetworkManager#isProviderEnabledInPhysicalNetwork(long, java.lang.String)
-     */
-    @Override
-    public boolean isProviderEnabledInPhysicalNetwork(long physicalNetowrkId, String providerName) {
-        // TODO Auto-generated method stub
-        return false;
-    }
-
-    /* (non-Javadoc)
-     * @see com.cloud.network.NetworkManager#getNetworkTag(com.cloud.hypervisor.Hypervisor.HypervisorType, com.cloud.network.Network)
-     */
-    @Override
-    public String getNetworkTag(HypervisorType hType, Network network) {
-        // TODO Auto-generated method stub
-        return null;
-    }
-
-    /* (non-Javadoc)
-     * @see com.cloud.network.NetworkManager#getElementServices(com.cloud.network.Network.Provider)
-     */
-    @Override
-    public List<Service> getElementServices(Provider provider) {
-        // TODO Auto-generated method stub
-        return null;
-    }
-
-    /* (non-Javadoc)
-     * @see com.cloud.network.NetworkManager#canElementEnableIndividualServices(com.cloud.network.Network.Provider)
-     */
-    @Override
-    public boolean canElementEnableIndividualServices(Provider provider) {
-        // TODO Auto-generated method stub
-        return false;
-    }
-
-    /* (non-Javadoc)
-     * @see com.cloud.network.NetworkManager#areServicesSupportedInNetwork(long, com.cloud.network.Network.Service[])
-     */
-    @Override
-    public boolean areServicesSupportedInNetwork(long networkId, Service... services) {
-        return (_ntwkSrvcDao.areServicesSupportedInNetwork(networkId, services));
-    }
-
-    /* (non-Javadoc)
-     * @see com.cloud.network.NetworkManager#isNetworkSystem(com.cloud.network.Network)
-     */
-    @Override
-    public boolean isNetworkSystem(Network network) {
-        // TODO Auto-generated method stub
-        return false;
-    }
-
-    /* (non-Javadoc)
-     * @see com.cloud.network.NetworkManager#reallocate(com.cloud.vm.VirtualMachineProfile, com.cloud.deploy.DataCenterDeployment)
-     */
-    @Override
-    public boolean reallocate(VirtualMachineProfile<? extends VMInstanceVO> vm, DataCenterDeployment dest) throws InsufficientCapacityException, ConcurrentOperationException {
-        // TODO Auto-generated method stub
-        return false;
-    }
-
-    /* (non-Javadoc)
-     * @see com.cloud.network.NetworkManager#getNetworkOfferingServiceCapabilities(com.cloud.offering.NetworkOffering, com.cloud.network.Network.Service)
+     * @see com.cloud.network.NetworkManager#createNicForVm(com.cloud.network.Network, com.cloud.vm.NicProfile, com.cloud.vm.ReservationContext, com.cloud.vm.VirtualMachineProfileImpl, boolean)
      */
     @Override
-    public Map<Capability, String> getNetworkOfferingServiceCapabilities(NetworkOffering offering, Service service) {
+    public NicProfile createNicForVm(Network network, NicProfile requested, ReservationContext context,
+            VirtualMachineProfileImpl<VMInstanceVO> vmProfile, boolean prepare)
+            throws InsufficientVirtualNetworkCapcityException, InsufficientAddressCapacityException,
+            ConcurrentOperationException, InsufficientCapacityException, ResourceUnavailableException {
         // TODO Auto-generated method stub
         return null;
     }
 
-    /* (non-Javadoc)
-     * @see com.cloud.network.NetworkManager#getPhysicalNetworkId(com.cloud.network.Network)
-     */
-    @Override
-    public Long getPhysicalNetworkId(Network network) {
-        // TODO Auto-generated method stub
-        return null;
-    }
 
-    /* (non-Javadoc)
-     * @see com.cloud.network.NetworkManager#getAllowSubdomainAccessGlobal()
-     */
-    @Override
-    public boolean getAllowSubdomainAccessGlobal() {
-        // TODO Auto-generated method stub
-        return false;
-    }
 
-    /* (non-Javadoc)
-     * @see com.cloud.network.NetworkManager#isProviderForNetwork(com.cloud.network.Network.Provider, long)
-     */
-    @Override
-    public boolean isProviderForNetwork(Provider provider, long networkId) {
-        // TODO Auto-generated method stub
-        return false;
-    }
-
-    /* (non-Javadoc)
-     * @see com.cloud.network.NetworkManager#isProviderForNetworkOffering(com.cloud.network.Network.Provider, long)
-     */
-    @Override
-    public boolean isProviderForNetworkOffering(Provider provider, long networkOfferingId) {
-        // TODO Auto-generated method stub
-        return false;
-    }
 
-    /* (non-Javadoc)
-     * @see com.cloud.network.NetworkManager#canProviderSupportServices(java.util.Map)
-     */
-    @Override
-    public void canProviderSupportServices(Map<Provider, Set<Service>> providersMap) {
-        // TODO Auto-generated method stub
-        
-    }
 
     /* (non-Javadoc)
-     * @see com.cloud.network.NetworkManager#getPhysicalNetworkInfo(long, com.cloud.hypervisor.Hypervisor.HypervisorType)
+     * @see com.cloud.network.NetworkManager#assignVpnGatewayIpAddress(long, com.cloud.user.Account, long)
      */
     @Override
-    public List<PhysicalNetworkSetupInfo> getPhysicalNetworkInfo(long dcId, HypervisorType hypervisorType) {
+    public PublicIp assignVpnGatewayIpAddress(long dcId, Account owner, long vpcId)
+            throws InsufficientAddressCapacityException, ConcurrentOperationException {
         // TODO Auto-generated method stub
         return null;
     }
 
-    /* (non-Javadoc)
-     * @see com.cloud.network.NetworkManager#canAddDefaultSecurityGroup()
-     */
-    @Override
-    public boolean canAddDefaultSecurityGroup() {
-        // TODO Auto-generated method stub
-        return false;
-    }
 
-    /* (non-Javadoc)
-     * @see com.cloud.network.NetworkManager#listNetworkOfferingServices(long)
-     */
-    @Override
-    public List<Service> listNetworkOfferingServices(long networkOfferingId) {
-        List<Service> supportedSvcs = new ArrayList<Service>();
-        if (networkOfferingId != 2) {
-            supportedSvcs.add(Service.SourceNat);
-        }
-        return supportedSvcs;
-    }
 
-    /* (non-Javadoc)
-     * @see com.cloud.network.NetworkManager#areServicesEnabledInZone(long, com.cloud.offering.NetworkOffering, java.util.List)
-     */
-    @Override
-    public boolean areServicesEnabledInZone(long zoneId, NetworkOffering offering, List<Service> services) {
-        // TODO Auto-generated method stub
-        return false;
-    }
 
-    /* (non-Javadoc)
-     * @see com.cloud.network.NetworkManager#getIpToServices(java.util.List, boolean, boolean)
-     */
-    @Override
-    public Map<PublicIp, Set<Service>> getIpToServices(List<PublicIp> publicIps, boolean rulesRevoked, boolean includingFirewall) {
-        // TODO Auto-generated method stub
-        return null;
-    }
-
-    /* (non-Javadoc)
-     * @see com.cloud.network.NetworkManager#getProviderToIpList(com.cloud.network.Network, java.util.Map)
-     */
-    @Override
-    public Map<Provider, ArrayList<PublicIp>> getProviderToIpList(Network network, Map<PublicIp, Set<Service>> ipToServices) {
-        // TODO Auto-generated method stub
-        return null;
-    }
 
     /* (non-Javadoc)
-     * @see com.cloud.network.NetworkManager#checkIpForService(com.cloud.network.IPAddressVO, com.cloud.network.Network.Service, java.lang.Long)
-     */
-    @Override
-    public boolean checkIpForService(IPAddressVO ip, Service service, Long networkId) {
-        // TODO Auto-generated method stub
-        return false;
-    }
-
-    /* (non-Javadoc)
-     * @see com.cloud.network.NetworkManager#checkCapabilityForProvider(java.util.Set, com.cloud.network.Network.Service, com.cloud.network.Network.Capability, java.lang.String)
+     * @see com.cloud.network.NetworkManager#markPublicIpAsAllocated(com.cloud.network.IPAddressVO)
      */
     @Override
-    public void checkCapabilityForProvider(Set<Provider> providers, Service service, Capability cap, String capValue) {
+    public void markPublicIpAsAllocated(IPAddressVO addr) {
         // TODO Auto-generated method stub
         
     }
 
-    /* (non-Javadoc)
-     * @see com.cloud.network.NetworkManager#getDefaultUniqueProviderForService(java.lang.String)
-     */
-    @Override
-    public Provider getDefaultUniqueProviderForService(String serviceName) {
-        // TODO Auto-generated method stub
-        return null;
-    }
 
-    /* (non-Javadoc)
-     * @see com.cloud.network.NetworkManager#assignSystemIp(long, com.cloud.user.Account, boolean, boolean)
-     */
-    @Override
-    public IpAddress assignSystemIp(long networkId, Account owner, boolean forElasticLb, boolean forElasticIp) throws InsufficientAddressCapacityException {
-        // TODO Auto-generated method stub
-        return null;
-    }
-
-    /* (non-Javadoc)
-     * @see com.cloud.network.NetworkManager#handleSystemIpRelease(com.cloud.network.IpAddress)
-     */
-    @Override
-    public boolean handleSystemIpRelease(IpAddress ip) {
-        // TODO Auto-generated method stub
-        return false;
-    }
-
-    /* (non-Javadoc)
-     * @see com.cloud.network.NetworkManager#checkNetworkPermissions(com.cloud.user.Account, com.cloud.network.Network)
-     */
-    @Override
-    public void checkNetworkPermissions(Account owner, Network network) {
-        // TODO Auto-generated method stub
-        
-    }
-
-    /* (non-Javadoc)
-     * @see com.cloud.network.NetworkManager#allocateDirectIp(com.cloud.vm.NicProfile, com.cloud.dc.DataCenter, com.cloud.vm.VirtualMachineProfile, com.cloud.network.Network, java.lang.String)
-     */
-    @Override
-    public void allocateDirectIp(NicProfile nic, DataCenter dc, VirtualMachineProfile<? extends VirtualMachine> vm, Network network, String requestedIp) throws InsufficientVirtualNetworkCapcityException,
-            InsufficientAddressCapacityException {
-        // TODO Auto-generated method stub
-        
-    }
 
-    /* (non-Javadoc)
-     * @see com.cloud.network.NetworkManager#getDefaultManagementTrafficLabel(long, com.cloud.hypervisor.Hypervisor.HypervisorType)
-     */
-    @Override
-    public String getDefaultManagementTrafficLabel(long zoneId, HypervisorType hypervisorType) {
-        // TODO Auto-generated method stub
-        return null;
-    }
 
-    /* (non-Javadoc)
-     * @see com.cloud.network.NetworkManager#getDefaultStorageTrafficLabel(long, com.cloud.hypervisor.Hypervisor.HypervisorType)
-     */
-    @Override
-    public String getDefaultStorageTrafficLabel(long zoneId, HypervisorType hypervisorType) {
-        // TODO Auto-generated method stub
-        return null;
-    }
 
     /* (non-Javadoc)
-     * @see com.cloud.network.NetworkManager#getDefaultPublicTrafficLabel(long, com.cloud.hypervisor.Hypervisor.HypervisorType)
+     * @see com.cloud.network.NetworkManager#assignDedicateIpAddress(com.cloud.user.Account, java.lang.Long, java.lang.Long, long, boolean)
      */
     @Override
-    public String getDefaultPublicTrafficLabel(long dcId, HypervisorType vmware) {
+    public PublicIp assignDedicateIpAddress(Account owner, Long guestNtwkId, Long vpcId, long dcId, boolean isSourceNat)
+            throws ConcurrentOperationException, InsufficientAddressCapacityException {
         // TODO Auto-generated method stub
         return null;
     }
 
-    /* (non-Javadoc)
-     * @see com.cloud.network.NetworkManager#getDefaultGuestTrafficLabel(long, com.cloud.hypervisor.Hypervisor.HypervisorType)
-     */
-    @Override
-    public String getDefaultGuestTrafficLabel(long dcId, HypervisorType vmware) {
-        // TODO Auto-generated method stub
-        return null;
-    }
 
-    /* (non-Javadoc)
-     * @see com.cloud.network.NetworkManager#getElementImplementingProvider(java.lang.String)
-     */
-    @Override
-    public NetworkElement getElementImplementingProvider(String providerName) {
-        return new MockVpcVirtualRouterElement();
-    }
 
-    /* (non-Javadoc)
-     * @see com.cloud.network.NetworkManager#assignSourceNatIpAddressToGuestNetwork(com.cloud.user.Account, com.cloud.network.Network)
-     */
-    @Override
-    public PublicIp assignSourceNatIpAddressToGuestNetwork(Account owner, Network guestNetwork) throws InsufficientAddressCapacityException, ConcurrentOperationException {
-        // TODO Auto-generated method stub
-        return null;
-    }
 
-    /* (non-Javadoc)
-     * @see com.cloud.network.NetworkManager#getAccountNetworkDomain(long, long)
-     */
-    @Override
-    public String getAccountNetworkDomain(long accountId, long zoneId) {
-        // TODO Auto-generated method stub
-        return null;
-    }
 
     /* (non-Javadoc)
-     * @see com.cloud.network.NetworkManager#getDefaultNetworkDomain()
+     * @see com.cloud.network.NetworkManager#convertNetworkToNetworkProfile(long)
      */
     @Override
-    public String getDefaultNetworkDomain() {
+    public NetworkProfile convertNetworkToNetworkProfile(long networkId) {
         // TODO Auto-generated method stub
         return null;
     }
 
-    /* (non-Javadoc)
-     * @see com.cloud.network.NetworkManager#getNtwkOffDistinctProviders(long)
-     */
-    @Override
-    public List<Provider> getNtwkOffDistinctProviders(long ntwkOffId) {
-        List<Provider> providers = new ArrayList<Provider>();
-        providers.add(Provider.VPCVirtualRouter);
-        return providers;
-    }
 
-    /* (non-Javadoc)
-     * @see com.cloud.network.NetworkManager#allocateNic(com.cloud.vm.NicProfile, com.cloud.network.Network, java.lang.Boolean, int, com.cloud.vm.VirtualMachineProfile)
-     */
-    @Override
-    public Pair<NicProfile, Integer> allocateNic(NicProfile requested, Network network, Boolean isDefaultNic, int deviceId, VirtualMachineProfile<? extends VMInstanceVO> vm)
-            throws InsufficientVirtualNetworkCapcityException, InsufficientAddressCapacityException, ConcurrentOperationException {
-        // TODO Auto-generated method stub
-        return null;
-    }
 
-    /* (non-Javadoc)
-     * @see com.cloud.network.NetworkManager#prepareNic(com.cloud.vm.VirtualMachineProfile, com.cloud.deploy.DeployDestination, com.cloud.vm.ReservationContext, long, com.cloud.network.NetworkVO)
-     */
-    @Override
-    public NicProfile prepareNic(VirtualMachineProfile<? extends VMInstanceVO> vmProfile, DeployDestination dest, ReservationContext context, long nicId, NetworkVO network)
-            throws InsufficientVirtualNetworkCapcityException, InsufficientAddressCapacityException, ConcurrentOperationException, InsufficientCapacityException, ResourceUnavailableException {
-        // TODO Auto-generated method stub
-        return null;
-    }
 
-    /* (non-Javadoc)
-     * @see com.cloud.network.NetworkManager#removeNic(com.cloud.vm.VirtualMachineProfile, com.cloud.vm.Nic)
-     */
-    @Override
-    public void removeNic(VirtualMachineProfile<? extends VMInstanceVO> vm, Nic nic) {
-        // TODO Auto-generated method stub
-        
-    }
 
     /* (non-Javadoc)
-     * @see com.cloud.network.NetworkManager#listPublicIpsAssignedToAccount(long, long, java.lang.Boolean)
+     * @see com.cloud.network.NetworkManager#getNetworkLockTimeout()
      */
     @Override
-    public List<IPAddressVO> listPublicIpsAssignedToAccount(long accountId, long dcId, Boolean sourceNat) {
+    public int getNetworkLockTimeout() {
         // TODO Auto-generated method stub
-        return null;
+        return 0;
     }
 
-    /* (non-Javadoc)
-     * @see com.cloud.network.NetworkManager#associateIPToGuestNetwork(long, long, boolean)
-     */
-    @Override
-    public IPAddressVO associateIPToGuestNetwork(long ipAddrId, long networkId, boolean releaseOnFailure) throws ResourceAllocationException, ResourceUnavailableException, InsufficientAddressCapacityException,
-            ConcurrentOperationException {
-        // TODO Auto-generated method stub
-        return null;
-    }
 
-    /* (non-Javadoc)
-     * @see com.cloud.network.NetworkManager#getNicProfile(com.cloud.vm.VirtualMachine, long, java.lang.String)
-     */
-    @Override
-    public NicProfile getNicProfile(VirtualMachine vm, long networkId, String broadcastUri) {
-        // TODO Auto-generated method stub
-        return null;
-    }
 
-    /* (non-Javadoc)
-     * @see com.cloud.network.NetworkManager#setupDns(com.cloud.network.Network, com.cloud.network.Network.Provider)
-     */
-    @Override
-    public boolean setupDns(Network network, Provider provider) {
-        // TODO Auto-generated method stub
-        return false;
-    }
 
-    /* (non-Javadoc)
-     * @see com.cloud.network.NetworkManager#releaseNic(com.cloud.vm.VirtualMachineProfile, com.cloud.vm.Nic)
-     */
-    @Override
-    public void releaseNic(VirtualMachineProfile<? extends VMInstanceVO> vmProfile, Nic nic) throws ConcurrentOperationException, ResourceUnavailableException {
-        // TODO Auto-generated method stub
-        
-    }
 
     /* (non-Javadoc)
-     * @see com.cloud.network.NetworkManager#getPhysicalNtwksSupportingTrafficType(long, com.cloud.network.Networks.TrafficType)
-     */
-    @Override
-    public List<? extends PhysicalNetwork> getPhysicalNtwksSupportingTrafficType(long zoneId, TrafficType trafficType) {
-        // TODO Auto-generated method stub
-        return null;
-    }
-
-    /* (non-Javadoc)
-     * @see com.cloud.network.NetworkManager#isPrivateGateway(com.cloud.vm.Nic)
+     * @see com.cloud.network.NetworkManager#cleanupIpResources(long, long, com.cloud.user.Account)
      */
     @Override
-    public boolean isPrivateGateway(Nic guestNic) {
+    public boolean cleanupIpResources(long addrId, long userId, Account caller) {
         // TODO Auto-generated method stub
         return false;
     }
 
-    /* (non-Javadoc)
-     * @see com.cloud.network.NetworkManager#createNicForVm(com.cloud.network.Network, com.cloud.vm.NicProfile, com.cloud.vm.ReservationContext, com.cloud.vm.VirtualMachineProfileImpl, boolean)
-     */
-    @Override
-    public NicProfile createNicForVm(Network network, NicProfile requested, ReservationContext context, VirtualMachineProfileImpl<VMInstanceVO> vmProfile, boolean prepare)
-            throws InsufficientVirtualNetworkCapcityException, InsufficientAddressCapacityException, ConcurrentOperationException, InsufficientCapacityException, ResourceUnavailableException {
-        // TODO Auto-generated method stub
-        return null;
-    }
 
-    /* (non-Javadoc)
-     * @see com.cloud.network.NetworkManager#assignVpnGatewayIpAddress(long, com.cloud.user.Account, long)
-     */
-    @Override
-    public PublicIp assignVpnGatewayIpAddress(long dcId, Account owner, long vpcId) throws InsufficientAddressCapacityException, ConcurrentOperationException {
-        // TODO Auto-generated method stub
-        return null;
-    }
-
-    /* (non-Javadoc)
-     * @see com.cloud.network.NetworkManager#markPublicIpAsAllocated(com.cloud.network.IPAddressVO)
-     */
-    @Override
-    public void markPublicIpAsAllocated(IPAddressVO addr) {
-        // TODO Auto-generated method stub
-        
-    }
-
-    /* (non-Javadoc)
-     * @see com.cloud.network.NetworkManager#assignDedicateIpAddress(com.cloud.user.Account, java.lang.Long, java.lang.Long, long, boolean)
-     */
-    @Override
-    public PublicIp assignDedicateIpAddress(Account owner, Long guestNtwkId, Long vpcId, long dcId, boolean isSourceNat) throws ConcurrentOperationException, InsufficientAddressCapacityException {
-        // TODO Auto-generated method stub
-        return null;
-    }
 
-    /* (non-Javadoc)
-     * @see com.cloud.utils.component.Manager#configure(java.lang.String, java.util.Map)
-     */
-    @Override
-    public boolean configure(String name, Map<String, Object> params) throws ConfigurationException {
-        // TODO Auto-generated method stub
-        return true;
-    }
 
-    /* (non-Javadoc)
-     * @see com.cloud.utils.component.Manager#start()
-     */
-    @Override
-    public boolean start() {
-        for (NetworkElement element : _networkElements) {
-            Provider implementedProvider = element.getProvider();
-            if (implementedProvider != null) {
-                if (s_providerToNetworkElementMap.containsKey(implementedProvider.getName())) {
-                    s_logger.error("Cannot start MapNetworkManager: Provider <-> NetworkElement must be a one-to-one map, " +
-                            "multiple NetworkElements found for Provider: " + implementedProvider.getName());
-                    return false;
-                }
-                s_providerToNetworkElementMap.put(implementedProvider.getName(), element.getName());
-            }
-        }
-        return true;
-    }
 
     /* (non-Javadoc)
-     * @see com.cloud.utils.component.Manager#stop()
+     * @see com.cloud.network.NetworkManager#restartNetwork(java.lang.Long, com.cloud.user.Account, com.cloud.user.User, boolean)
      */
     @Override
-    public boolean stop() {
+    public boolean restartNetwork(Long networkId, Account callerAccount, User callerUser, boolean cleanup)
+            throws ConcurrentOperationException, ResourceUnavailableException, InsufficientCapacityException {
         // TODO Auto-generated method stub
-        return true;
+        return false;
     }
 
-    /* (non-Javadoc)
-     * @see com.cloud.utils.component.Manager#getName()
-     */
-    @Override
-    public String getName() {
-        // TODO Auto-generated method stub
-        return null;
-    }
 
-    /* (non-Javadoc)
-     * @see com.cloud.network.NetworkService#allocateIP(com.cloud.user.Account, boolean, long)
-     */
-    @Override
-    public IpAddress allocateIP(Account ipOwner, long zoneId, Long networkId) throws ResourceAllocationException, InsufficientAddressCapacityException, ConcurrentOperationException {
-        // TODO Auto-generated method stub
-        return null;
-    }
 
 
-    /* (non-Javadoc)
-     * @see com.cloud.network.NetworkManager#getNetworkLockTimeout()
-     */
-    @Override
-    public int getNetworkLockTimeout() {
-        // TODO Auto-generated method stub
-        return 0;
-    }
 
     /* (non-Javadoc)
-     * @see com.cloud.network.NetworkManager#applyRules(java.util.List, com.cloud.network.rules.FirewallRule.Purpose, com.cloud.network.NetworkRuleApplier, boolean)
+     * @see com.cloud.network.NetworkManager#shutdownNetworkElementsAndResources(com.cloud.vm.ReservationContext, boolean, com.cloud.network.NetworkVO)
      */
     @Override
-    public boolean applyRules(List<? extends FirewallRule> rules, Purpose purpose, NetworkRuleApplier applier,
-            boolean continueOnError) throws ResourceUnavailableException {
+    public boolean shutdownNetworkElementsAndResources(ReservationContext context, boolean b, NetworkVO network) {
         // TODO Auto-generated method stub
         return false;
     }
 
-    /* (non-Javadoc)
-     * @see com.cloud.network.NetworkManager#applyIpAssociations(com.cloud.network.Network, boolean, boolean, java.util.List)
-     */
-    @Override
-    public boolean applyIpAssociations(Network network, boolean rulesRevoked, boolean continueOnError,
-            List<PublicIp> publicIps) throws ResourceUnavailableException {
-        // TODO Auto-generated method stub
-        return false;
-    }
 
-    /* (non-Javadoc)
-     * @see com.cloud.network.NetworkManager#cleanupIpResources(long, long, com.cloud.user.Account)
-     */
-    @Override
-    public boolean cleanupIpResources(long addrId, long userId, Account caller) {
-        // TODO Auto-generated method stub
-        return false;
-    }
 
-    /* (non-Javadoc)
-     * @see com.cloud.network.NetworkManager#restartNetwork(java.lang.Long, com.cloud.user.Account, com.cloud.user.User, boolean)
-     */
-    @Override
-    public boolean restartNetwork(Long networkId, Account callerAccount, User callerUser, boolean cleanup)
-            throws ConcurrentOperationException, ResourceUnavailableException, InsufficientCapacityException {
-        // TODO Auto-generated method stub
-        return false;
-    }
 
-    /* (non-Javadoc)
-     * @see com.cloud.network.NetworkManager#shutdownNetworkElementsAndResources(com.cloud.vm.ReservationContext, boolean, com.cloud.network.NetworkVO)
-     */
-    @Override
-    public boolean shutdownNetworkElementsAndResources(ReservationContext context, boolean b, NetworkVO network) {
-        // TODO Auto-generated method stub
-        return false;
-    }
 
     /* (non-Javadoc)
      * @see com.cloud.network.NetworkManager#implementNetworkElementsAndResources(com.cloud.deploy.DeployDestination, com.cloud.vm.ReservationContext, com.cloud.network.NetworkVO, com.cloud.offerings.NetworkOfferingVO)
@@ -1514,6 +1246,10 @@ public class MockNetworkManagerImpl implements NetworkManager, NetworkService, M
         
     }
 
+
+
+
+
     /* (non-Javadoc)
      * @see com.cloud.network.NetworkManager#allocateIp(com.cloud.user.Account, boolean, com.cloud.user.Account, com.cloud.dc.DataCenter)
      */
@@ -1524,6 +1260,10 @@ public class MockNetworkManagerImpl implements NetworkManager, NetworkService, M
         return null;
     }
 
+
+
+
+
     /* (non-Javadoc)
      * @see com.cloud.network.NetworkManager#finalizeServicesAndProvidersForNetwork(com.cloud.offering.NetworkOffering, java.lang.Long)
      */
@@ -1533,4 +1273,6 @@ public class MockNetworkManagerImpl implements NetworkManager, NetworkService, M
         return null;
     }
 
+    
+
 }


Mime
View raw message