|
16 | 16 | // under the License. |
17 | 17 | package com.cloud.network; |
18 | 18 |
|
| 19 | +import java.util.ArrayList; |
| 20 | +import java.util.List; |
| 21 | +import java.util.Map; |
| 22 | +import java.util.Set; |
| 23 | + |
| 24 | +import javax.ejb.Local; |
| 25 | +import javax.naming.ConfigurationException; |
| 26 | + |
19 | 27 | import com.cloud.acl.ControlledEntity.ACLType; |
20 | 28 | import com.cloud.api.commands.CreateNetworkCmd; |
21 | 29 | import com.cloud.api.commands.ListNetworksCmd; |
|
27 | 35 | import com.cloud.deploy.DataCenterDeployment; |
28 | 36 | import com.cloud.deploy.DeployDestination; |
29 | 37 | import com.cloud.deploy.DeploymentPlan; |
30 | | -import com.cloud.exception.*; |
| 38 | +import com.cloud.exception.ConcurrentOperationException; |
| 39 | +import com.cloud.exception.InsufficientAddressCapacityException; |
| 40 | +import com.cloud.exception.InsufficientCapacityException; |
| 41 | +import com.cloud.exception.InsufficientVirtualNetworkCapcityException; |
| 42 | +import com.cloud.exception.ResourceAllocationException; |
| 43 | +import com.cloud.exception.ResourceUnavailableException; |
31 | 44 | import com.cloud.hypervisor.Hypervisor.HypervisorType; |
32 | 45 | import com.cloud.network.Network.Capability; |
33 | 46 | import com.cloud.network.Network.GuestType; |
|
36 | 49 | import com.cloud.network.Networks.TrafficType; |
37 | 50 | import com.cloud.network.addr.PublicIp; |
38 | 51 | import com.cloud.network.element.NetworkElement; |
39 | | -import com.cloud.network.element.RemoteAccessVPNServiceProvider; |
40 | | -import com.cloud.network.element.Site2SiteVpnServiceProvider; |
41 | 52 | import com.cloud.network.element.UserDataServiceProvider; |
42 | 53 | import com.cloud.network.guru.NetworkGuru; |
43 | 54 | import com.cloud.network.rules.FirewallRule; |
| 55 | +import com.cloud.network.rules.FirewallRule.Purpose; |
44 | 56 | import com.cloud.network.rules.StaticNat; |
45 | 57 | import com.cloud.offering.NetworkOffering; |
46 | 58 | import com.cloud.offerings.NetworkOfferingVO; |
47 | 59 | import com.cloud.user.Account; |
48 | 60 | import com.cloud.user.User; |
49 | 61 | import com.cloud.utils.Pair; |
50 | 62 | import com.cloud.utils.component.Manager; |
51 | | -import com.cloud.vm.*; |
52 | | - |
53 | | -import javax.ejb.Local; |
54 | | -import javax.naming.ConfigurationException; |
55 | | -import java.util.ArrayList; |
56 | | -import java.util.List; |
57 | | -import java.util.Map; |
58 | | -import java.util.Set; |
| 63 | +import com.cloud.vm.Nic; |
| 64 | +import com.cloud.vm.NicProfile; |
| 65 | +import com.cloud.vm.ReservationContext; |
| 66 | +import com.cloud.vm.VMInstanceVO; |
| 67 | +import com.cloud.vm.VirtualMachine; |
| 68 | +import com.cloud.vm.VirtualMachineProfile; |
| 69 | +import com.cloud.vm.VirtualMachineProfileImpl; |
59 | 70 |
|
60 | 71 | @Local(value = { NetworkManager.class, NetworkService.class }) |
61 | 72 | public class MockNetworkManagerImpl implements NetworkManager, Manager, NetworkService { |
@@ -254,12 +265,7 @@ public String getNextAvailableMacAddressInNetwork(long networkConfigurationId) t |
254 | 265 | return null; |
255 | 266 | } |
256 | 267 |
|
257 | | - @Override |
258 | | - public boolean applyRules(List<? extends FirewallRule> rules, boolean continueOnError) throws ResourceUnavailableException { |
259 | | - // TODO Auto-generated method stub |
260 | | - return false; |
261 | | - } |
262 | | - |
| 268 | + |
263 | 269 | @Override |
264 | 270 | public PublicIpAddress getPublicIpAddress(long ipAddressId) { |
265 | 271 | // TODO Auto-generated method stub |
@@ -411,10 +417,7 @@ public Map<Service, Set<Provider>> getNetworkOfferingServiceProvidersMap(long ne |
411 | 417 | return null; |
412 | 418 | } |
413 | 419 |
|
414 | | - @Override |
415 | | - public List<? extends RemoteAccessVPNServiceProvider> getRemoteAccessVpnElements() { |
416 | | - return null; |
417 | | - } |
| 420 | + |
418 | 421 |
|
419 | 422 | @Override |
420 | 423 | public boolean isProviderSupportServiceInNetwork(long networkId, Service service, Provider provider) { |
@@ -994,15 +997,7 @@ public Network updateGuestNetwork(long networkId, String name, String displayTex |
994 | 997 | return null; |
995 | 998 | } |
996 | 999 |
|
997 | | - /* (non-Javadoc) |
998 | | -<<<<<<< HEAD |
999 | | - * @see com.cloud.network.NetworkManager#getSite2SiteVpnElements() |
1000 | | - */ |
1001 | | - @Override |
1002 | | - public List<? extends Site2SiteVpnServiceProvider> getSite2SiteVpnElements() { |
1003 | | - // TODO Auto-generated method stub |
1004 | | - return null; |
1005 | | - } |
| 1000 | + |
1006 | 1001 |
|
1007 | 1002 | /* (non-Javadoc) |
1008 | 1003 | * @see com.cloud.network.NetworkManager#isPrivateGateway(com.cloud.vm.Nic) |
@@ -1135,4 +1130,82 @@ public int getNetworkLockTimeout() { |
1135 | 1130 | // TODO Auto-generated method stub |
1136 | 1131 | return 0; |
1137 | 1132 | } |
| 1133 | + |
| 1134 | + /* (non-Javadoc) |
| 1135 | + * @see com.cloud.network.NetworkManager#applyRules(java.util.List, com.cloud.network.rules.FirewallRule.Purpose, com.cloud.network.NetworkRuleApplier, boolean) |
| 1136 | + */ |
| 1137 | + @Override |
| 1138 | + public boolean applyRules(List<? extends FirewallRule> rules, Purpose purpose, NetworkRuleApplier applier, |
| 1139 | + boolean continueOnError) throws ResourceUnavailableException { |
| 1140 | + // TODO Auto-generated method stub |
| 1141 | + return false; |
| 1142 | + } |
| 1143 | + |
| 1144 | + /* (non-Javadoc) |
| 1145 | + * @see com.cloud.network.NetworkManager#applyIpAssociations(com.cloud.network.Network, boolean, boolean, java.util.List) |
| 1146 | + */ |
| 1147 | + @Override |
| 1148 | + public boolean applyIpAssociations(Network network, boolean rulesRevoked, boolean continueOnError, |
| 1149 | + List<PublicIp> publicIps) throws ResourceUnavailableException { |
| 1150 | + // TODO Auto-generated method stub |
| 1151 | + return false; |
| 1152 | + } |
| 1153 | + |
| 1154 | + /* (non-Javadoc) |
| 1155 | + * @see com.cloud.network.NetworkManager#cleanupIpResources(long, long, com.cloud.user.Account) |
| 1156 | + */ |
| 1157 | + @Override |
| 1158 | + public boolean cleanupIpResources(long addrId, long userId, Account caller) { |
| 1159 | + // TODO Auto-generated method stub |
| 1160 | + return false; |
| 1161 | + } |
| 1162 | + |
| 1163 | + /* (non-Javadoc) |
| 1164 | + * @see com.cloud.network.NetworkManager#restartNetwork(java.lang.Long, com.cloud.user.Account, com.cloud.user.User, boolean) |
| 1165 | + */ |
| 1166 | + @Override |
| 1167 | + public boolean restartNetwork(Long networkId, Account callerAccount, User callerUser, boolean cleanup) |
| 1168 | + throws ConcurrentOperationException, ResourceUnavailableException, InsufficientCapacityException { |
| 1169 | + // TODO Auto-generated method stub |
| 1170 | + return false; |
| 1171 | + } |
| 1172 | + |
| 1173 | + /* (non-Javadoc) |
| 1174 | + * @see com.cloud.network.NetworkManager#shutdownNetworkElementsAndResources(com.cloud.vm.ReservationContext, boolean, com.cloud.network.NetworkVO) |
| 1175 | + */ |
| 1176 | + @Override |
| 1177 | + public boolean shutdownNetworkElementsAndResources(ReservationContext context, boolean b, NetworkVO network) { |
| 1178 | + // TODO Auto-generated method stub |
| 1179 | + return false; |
| 1180 | + } |
| 1181 | + |
| 1182 | + /* (non-Javadoc) |
| 1183 | + * @see com.cloud.network.NetworkManager#implementNetworkElementsAndResources(com.cloud.deploy.DeployDestination, com.cloud.vm.ReservationContext, com.cloud.network.NetworkVO, com.cloud.offerings.NetworkOfferingVO) |
| 1184 | + */ |
| 1185 | + @Override |
| 1186 | + public void implementNetworkElementsAndResources(DeployDestination dest, ReservationContext context, |
| 1187 | + NetworkVO network, NetworkOfferingVO findById) throws ConcurrentOperationException, |
| 1188 | + InsufficientAddressCapacityException, ResourceUnavailableException, InsufficientCapacityException { |
| 1189 | + // TODO Auto-generated method stub |
| 1190 | + |
| 1191 | + } |
| 1192 | + |
| 1193 | + /* (non-Javadoc) |
| 1194 | + * @see com.cloud.network.NetworkManager#allocateIp(com.cloud.user.Account, boolean, com.cloud.user.Account, com.cloud.dc.DataCenter) |
| 1195 | + */ |
| 1196 | + @Override |
| 1197 | + public IpAddress allocateIp(Account ipOwner, boolean isSystem, Account caller, DataCenter zone) |
| 1198 | + throws ConcurrentOperationException, ResourceAllocationException, InsufficientAddressCapacityException { |
| 1199 | + // TODO Auto-generated method stub |
| 1200 | + return null; |
| 1201 | + } |
| 1202 | + |
| 1203 | + /* (non-Javadoc) |
| 1204 | + * @see com.cloud.network.NetworkManager#finalizeServicesAndProvidersForNetwork(com.cloud.offering.NetworkOffering, java.lang.Long) |
| 1205 | + */ |
| 1206 | + @Override |
| 1207 | + public Map<String, String> finalizeServicesAndProvidersForNetwork(NetworkOffering offering, Long physicalNetworkId) { |
| 1208 | + // TODO Auto-generated method stub |
| 1209 | + return null; |
| 1210 | + } |
1138 | 1211 | } |
0 commit comments