From da78937d302c496d522c40a9548019cdb3545217 Mon Sep 17 00:00:00 2001 From: Alex Huang Date: Tue, 1 Nov 2011 16:57:22 -0700 Subject: [PATCH] Removed some useless methods --- api/src/com/cloud/network/guru/NetworkGuru.java | 11 +++++++---- server/src/com/cloud/network/NetworkManager.java | 8 +------- server/src/com/cloud/network/NetworkManagerImpl.java | 5 +++-- 3 files changed, 11 insertions(+), 13 deletions(-) diff --git a/api/src/com/cloud/network/guru/NetworkGuru.java b/api/src/com/cloud/network/guru/NetworkGuru.java index b2d2842b82f..18364f3db4b 100644 --- a/api/src/com/cloud/network/guru/NetworkGuru.java +++ b/api/src/com/cloud/network/guru/NetworkGuru.java @@ -37,10 +37,13 @@ import com.cloud.vm.VirtualMachine; import com.cloud.vm.VirtualMachineProfile; /** - * NetworkGuru takes a network offering requested and figures - * out the correct network configuration needed to add - * to the account in order to support this network. - * + * NetworkGuru has the following functionalities + * - Issues the ip address for the network that it is responsible for. + * - Designs a virtual network depending on the network offering. + * - Implements the virtual network when a virtual machine requires the network to be started. + * + * NetworkManager is responsible for figuring which NetworkGuru to use when + * networks are created and nics are designed. */ public interface NetworkGuru extends Adapter { /** diff --git a/server/src/com/cloud/network/NetworkManager.java b/server/src/com/cloud/network/NetworkManager.java index be6ea70dc67..04df370752d 100644 --- a/server/src/com/cloud/network/NetworkManager.java +++ b/server/src/com/cloud/network/NetworkManager.java @@ -33,15 +33,13 @@ import com.cloud.network.Network.Provider; import com.cloud.network.Network.Service; import com.cloud.network.Networks.TrafficType; import com.cloud.network.addr.PublicIp; -import com.cloud.network.dao.PhysicalNetworkServiceProviderVO; -import com.cloud.network.element.UserDataServiceProvider; import com.cloud.network.element.RemoteAccessVPNServiceProvider; +import com.cloud.network.element.UserDataServiceProvider; import com.cloud.network.guru.NetworkGuru; import com.cloud.network.rules.FirewallRule; import com.cloud.network.rules.StaticNat; import com.cloud.offerings.NetworkOfferingVO; import com.cloud.user.Account; -import com.cloud.user.AccountVO; import com.cloud.utils.Pair; import com.cloud.vm.Nic; import com.cloud.vm.NicProfile; @@ -131,10 +129,6 @@ public interface NetworkManager extends NetworkService { List getNicProfiles(VirtualMachine vm); - AccountVO getNetworkOwner(long configurationId); - - List getNetworksforOffering(long offeringId, long dataCenterId, long accountId); - String getNextAvailableMacAddressInNetwork(long networkConfigurationId) throws InsufficientAddressCapacityException; boolean applyRules(List rules, boolean continueOnError) throws ResourceUnavailableException; diff --git a/server/src/com/cloud/network/NetworkManagerImpl.java b/server/src/com/cloud/network/NetworkManagerImpl.java index b2a21e61884..c7b8d809453 100755 --- a/server/src/com/cloud/network/NetworkManagerImpl.java +++ b/server/src/com/cloud/network/NetworkManagerImpl.java @@ -1559,7 +1559,7 @@ public class NetworkManagerImpl implements NetworkManager, NetworkService, Manag return releasePublicIpAddress(ipAddressId, userId, caller); } - @Override + @Deprecated // No one is using this method. public AccountVO getNetworkOwner(long networkId) { SearchCriteria sc = AccountsUsingNetworkSearch.create(); sc.setJoinParameters("nc", "config", networkId); @@ -1568,7 +1568,7 @@ public class NetworkManagerImpl implements NetworkManager, NetworkService, Manag return accounts.size() != 0 ? accounts.get(0) : null; } - @Override + @Deprecated // No one is using this method. public List getNetworksforOffering(long offeringId, long dataCenterId, long accountId) { return _networksDao.getNetworksForOffering(offeringId, dataCenterId, accountId); } @@ -4339,6 +4339,7 @@ public class NetworkManagerImpl implements NetworkManager, NetworkService, Manag } + @Override @ActionEvent(eventType = EventTypes.EVENT_TRAFFIC_TYPE_CREATE, eventDescription = "Creating Physical Network TrafficType", async = true) public PhysicalNetworkTrafficType getPhysicalNetworkTrafficType(Long id){ return _pNTrafficTypeDao.findById(id);