incubator-cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From h...@apache.org
Subject [2/50] [abbrv] git commit: network-refactor: fix license issues Fix build after merge of network-refactor
Date Mon, 21 Jan 2013 11:18:51 GMT
network-refactor: fix license issues
Fix build after merge of network-refactor


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

Branch: refs/heads/cloud-agent-with-openvswitch
Commit: d9e36ac37b7b69bd90ff8e1792bffd8a0fff4dc9
Parents: 4d4fb9c
Author: Chiradeep Vittal <chiradeep@apache.org>
Authored: Wed Jan 16 19:18:15 2013 -0800
Committer: Chiradeep Vittal <chiradeep@apache.org>
Committed: Wed Jan 16 19:25:23 2013 -0800

----------------------------------------------------------------------
 .../configuration/ConfigurationManagerImpl.java    |    2 +-
 .../ExternalLoadBalancerDeviceManagerImpl.java     |    4 +-
 .../src/com/cloud/network/NetworkServiceImpl.java  |   61 ++++--------
 .../network/lb/LoadBalancingRulesManagerImpl.java  |    2 +-
 .../com/cloud/network/MockFirewallManagerImpl.java |   21 ++++-
 .../com/cloud/network/MockNetworkManagerImpl.java  |   51 ++++------
 .../com/cloud/network/MockRulesManagerImpl.java    |   19 ++++-
 .../vpn/MockRemoteAccessVPNServiceProvider.java    |   16 +++
 .../com/cloud/network/vpn/RemoteAccessVpnTest.java |   16 +++
 .../cloud/resource/MockResourceManagerImpl.java    |   20 ++---
 .../test/com/cloud/vpc/MockNetworkManagerImpl.java |   79 +++++++++++----
 .../vpc/MockVpcVirtualNetworkApplianceManager.java |    3 +-
 server/test/com/cloud/vpc/Site2SiteVpnTest.java    |   16 +++
 13 files changed, 196 insertions(+), 114 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/d9e36ac3/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
index feef2b2..df6642a 100755
--- a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
+++ b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
@@ -3256,7 +3256,7 @@ public class ConfigurationManagerImpl implements ConfigurationManager,
Configura
                 
                 String inlineMode = lbServiceCapabilityMap.get(Capability.InlineMode);
                 if (inlineMode != null) {
-                    _networkMgr.checkCapabilityForProvider(serviceProviderMap.get(Service.Lb),
Service.Lb, Capability.InlineMode, inlineMode);
+                    _networkModel.checkCapabilityForProvider(serviceProviderMap.get(Service.Lb),
Service.Lb, Capability.InlineMode, inlineMode);
                     inline = inlineMode.contains("true");
                 } else {
                     inline = false;

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/d9e36ac3/server/src/com/cloud/network/ExternalLoadBalancerDeviceManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/ExternalLoadBalancerDeviceManagerImpl.java b/server/src/com/cloud/network/ExternalLoadBalancerDeviceManagerImpl.java
index 718f130..275401c 100644
--- a/server/src/com/cloud/network/ExternalLoadBalancerDeviceManagerImpl.java
+++ b/server/src/com/cloud/network/ExternalLoadBalancerDeviceManagerImpl.java
@@ -745,7 +745,7 @@ public abstract class ExternalLoadBalancerDeviceManagerImpl extends AdapterBase
     };
     
     private MappingNic getLoadBalancingIpNic(DataCenterVO zone, Network network, long sourceIpId,
boolean revoked, String existedGuestIp) throws ResourceUnavailableException {
-        String srcIp = _networkMgr.getIp(sourceIpId).getAddress().addr();
+        String srcIp = _networkModel.getIp(sourceIpId).getAddress().addr();
         InlineLoadBalancerNicMapVO mapping = _inlineLoadBalancerNicMapDao.findByPublicIpAddress(srcIp);
         NicVO loadBalancingIpNic = null;
         MappingNic nic = new MappingNic();
@@ -1096,7 +1096,7 @@ public abstract class ExternalLoadBalancerDeviceManagerImpl extends
AdapterBase
             return null;
         }
 
-        NetworkElement element = _networkMgr.getElementImplementingProvider(providers.get(0).getName());
+        NetworkElement element = _networkModel.getElementImplementingProvider(providers.get(0).getName());
         if (!(element instanceof IpDeployer)) {
             s_logger.error("The firewall provider for network " + network.getName() + " don't
have ability to deploy IP address!");
             return null;

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/d9e36ac3/server/src/com/cloud/network/NetworkServiceImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/NetworkServiceImpl.java b/server/src/com/cloud/network/NetworkServiceImpl.java
index dc8f549..b05aece 100755
--- a/server/src/com/cloud/network/NetworkServiceImpl.java
+++ b/server/src/com/cloud/network/NetworkServiceImpl.java
@@ -34,12 +34,13 @@ import javax.naming.ConfigurationException;
 
 import org.apache.log4j.Logger;
 
-import com.cloud.acl.ControlledEntity.ACLType;
-import com.cloud.acl.SecurityChecker.AccessType;
-import com.cloud.api.commands.CreateNetworkCmd;
-import com.cloud.api.commands.ListNetworksCmd;
-import com.cloud.api.commands.ListTrafficTypeImplementorsCmd;
-import com.cloud.api.commands.RestartNetworkCmd;
+import org.apache.cloudstack.acl.ControlledEntity.ACLType;
+import org.apache.cloudstack.acl.SecurityChecker.AccessType;
+import org.apache.cloudstack.api.command.admin.usage.ListTrafficTypeImplementorsCmd;
+import org.apache.cloudstack.api.command.user.network.CreateNetworkCmd;
+import org.apache.cloudstack.api.command.user.network.ListNetworksCmd;
+import org.apache.cloudstack.api.command.user.network.RestartNetworkCmd;
+
 import com.cloud.configuration.Config;
 import com.cloud.configuration.ConfigurationManager;
 import com.cloud.configuration.dao.ConfigurationDao;
@@ -419,50 +420,20 @@ public class NetworkServiceImpl implements  NetworkService, Manager
{
         return _networksDao.listSourceNATEnabledNetworks(owner.getId(), zoneId, Network.GuestType.Isolated);
     }
 
+    
+    
+
     @Override
     @ActionEvent(eventType = EventTypes.EVENT_NET_IP_ASSIGN, eventDescription = "allocating
Ip", create = true)
-    public IpAddress allocateIP(Account ipOwner, long zoneId, Long networkId)
-            throws ResourceAllocationException, InsufficientAddressCapacityException, ConcurrentOperationException
{
-
-        if (networkId != null) {
-            Network network = _networksDao.findById(networkId);
-            if (network == null) {
-                throw new InvalidParameterValueException("Invalid network id is given");
-            }
-            if (network.getGuestType() == Network.GuestType.Shared) {
-                DataCenter zone = _configMgr.getZone(zoneId);
-                if (zone == null) {
-                    throw new InvalidParameterValueException("Invalid zone Id is given");
-                }
-
-                // if shared network in the advanced zone, then check the caller against
the network for 'AccessType.UseNetwork'
-                if (isSharedNetworkOfferingWithServices(network.getNetworkOfferingId()) &&
zone.getNetworkType() == NetworkType.Advanced) {
-                    Account caller = UserContext.current().getCaller();
-                    long callerUserId = UserContext.current().getCallerUserId();
-                    _accountMgr.checkAccess(caller, AccessType.UseNetwork, false, network);
-                    if (s_logger.isDebugEnabled()) {
-                        s_logger.debug("Associate IP address called by the user " + callerUserId
+ " account " + ipOwner.getId());
-                    }
-                    return _networkMgr.allocateIp(ipOwner, false, caller, zone);
-                } else {
-                    throw new InvalidParameterValueException("Associate IP address can only
be called on the shared networks in the advanced zone" +
-                            " with Firewall/Source Nat/Static Nat/Port Forwarding/Load balancing
services enabled");
-                }
-            }
-        }
-
-        return allocateIP(ipOwner, false,  zoneId);
-    }
-
-    protected IpAddress allocateIP(Account ipOwner, boolean isSystem, long zoneId) 
+    public IpAddress allocateIP(Account ipOwner, boolean isSystem, long zoneId) 
             throws ResourceAllocationException, InsufficientAddressCapacityException, ConcurrentOperationException
{
         Account caller = UserContext.current().getCaller();
         // check permissions
         _accountMgr.checkAccess(caller, null, false, ipOwner);
-        
+        long callerUserId = UserContext.current().getCallerUserId();
         DataCenter zone = _configMgr.getZone(zoneId);
         
-        return _networkMgr.allocateIp(ipOwner, isSystem, caller, zone);
+        return _networkMgr.allocateIp(ipOwner, isSystem, caller, callerUserId, zone);
     }
 
     @Override
@@ -2905,4 +2876,10 @@ public class NetworkServiceImpl implements  NetworkService, Manager
{
         return null;
     }
 
+
+    @Override
+    public Network getNetwork(String networkUuid) {
+       return _networksDao.findByUuid(networkUuid);
+    }
+
 }

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/d9e36ac3/server/src/com/cloud/network/lb/LoadBalancingRulesManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/lb/LoadBalancingRulesManagerImpl.java b/server/src/com/cloud/network/lb/LoadBalancingRulesManagerImpl.java
index 0fefb2d..c771597 100755
--- a/server/src/com/cloud/network/lb/LoadBalancingRulesManagerImpl.java
+++ b/server/src/com/cloud/network/lb/LoadBalancingRulesManagerImpl.java
@@ -1083,7 +1083,7 @@ public class LoadBalancingRulesManagerImpl<Type> implements LoadBalancingRulesMa
 
         // verify rule is supported by Lb provider of the network
         LoadBalancingRule loadBalancing = new LoadBalancingRule(newRule, new ArrayList<LbDestination>(),
new ArrayList<LbStickinessPolicy>());
-        if (!_networkMgr.validateRule(loadBalancing)) {
+        if (validateRule(loadBalancing)) {
             throw new InvalidParameterValueException("LB service provider cannot support
this rule");
         }
         

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/d9e36ac3/server/test/com/cloud/network/MockFirewallManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/network/MockFirewallManagerImpl.java b/server/test/com/cloud/network/MockFirewallManagerImpl.java
index 0d388f2..1a79acf 100644
--- a/server/test/com/cloud/network/MockFirewallManagerImpl.java
+++ b/server/test/com/cloud/network/MockFirewallManagerImpl.java
@@ -1,3 +1,19 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+// 
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
 package com.cloud.network;
 
 import java.util.List;
@@ -6,7 +22,8 @@ import java.util.Map;
 import javax.ejb.Local;
 import javax.naming.ConfigurationException;
 
-import com.cloud.api.commands.ListFirewallRulesCmd;
+import org.apache.cloudstack.api.command.user.firewall.ListFirewallRulesCmd;
+
 import com.cloud.exception.NetworkRuleConflictException;
 import com.cloud.exception.ResourceUnavailableException;
 import com.cloud.network.firewall.FirewallService;
@@ -180,4 +197,6 @@ public class MockFirewallManagerImpl implements FirewallManager,
 
 	}
 
+ 
+
 }

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/d9e36ac3/server/test/com/cloud/network/MockNetworkManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/network/MockNetworkManagerImpl.java b/server/test/com/cloud/network/MockNetworkManagerImpl.java
index 408cfd0..ef5b9c9 100755
--- a/server/test/com/cloud/network/MockNetworkManagerImpl.java
+++ b/server/test/com/cloud/network/MockNetworkManagerImpl.java
@@ -16,13 +16,20 @@
 // under the License.
 package com.cloud.network;
 
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import javax.ejb.Local;
+import javax.naming.ConfigurationException;
+
 import org.apache.cloudstack.acl.ControlledEntity.ACLType;
 import org.apache.cloudstack.api.command.admin.usage.ListTrafficTypeImplementorsCmd;
 import org.apache.cloudstack.api.command.user.network.CreateNetworkCmd;
 import org.apache.cloudstack.api.command.user.network.ListNetworksCmd;
 import org.apache.cloudstack.api.command.user.network.RestartNetworkCmd;
+
 import com.cloud.dc.DataCenter;
-import com.cloud.dc.Vlan;
 import com.cloud.dc.Vlan.VlanType;
 import com.cloud.deploy.DataCenterDeployment;
 import com.cloud.deploy.DeployDestination;
@@ -33,17 +40,11 @@ import com.cloud.exception.InsufficientCapacityException;
 import com.cloud.exception.InsufficientVirtualNetworkCapcityException;
 import com.cloud.exception.ResourceAllocationException;
 import com.cloud.exception.ResourceUnavailableException;
-import com.cloud.hypervisor.Hypervisor.HypervisorType;
-import com.cloud.network.Network.Capability;
-import com.cloud.network.Network.GuestType;
 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.element.LoadBalancingServiceProvider;
-import com.cloud.network.element.NetworkElement;
-import com.cloud.network.element.RemoteAccessVPNServiceProvider;
-import com.cloud.network.element.Site2SiteVpnServiceProvider;
 import com.cloud.network.element.StaticNatServiceProvider;
 import com.cloud.network.element.UserDataServiceProvider;
 import com.cloud.network.guru.NetworkGuru;
@@ -439,20 +440,7 @@ public class MockNetworkManagerImpl implements NetworkManager, Manager,
NetworkS
         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)
      */
@@ -516,7 +504,7 @@ public class MockNetworkManagerImpl implements NetworkManager, Manager,
NetworkS
      * @see com.cloud.network.NetworkManager#allocateIp(com.cloud.user.Account, boolean,
com.cloud.user.Account, com.cloud.dc.DataCenter)
      */
     @Override
-    public IpAddress allocateIp(Account ipOwner, boolean isSystem, Account caller, DataCenter
zone)
+    public IpAddress allocateIp(Account ipOwner, boolean isSystem, Account caller, long callerId,
DataCenter zone)
             throws ConcurrentOperationException, ResourceAllocationException, InsufficientAddressCapacityException
{
         // TODO Auto-generated method stub
         return null;
@@ -559,15 +547,6 @@ public class MockNetworkManagerImpl implements NetworkManager, Manager,
NetworkS
         return null;
     }
 
-    /* (non-Javadoc)
-     * @see com.cloud.network.NetworkService#allocateIP(com.cloud.user.Account, long, java.lang.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.NetworkService#restartNetwork(com.cloud.api.commands.RestartNetworkCmd,
boolean)
@@ -829,4 +808,14 @@ public class MockNetworkManagerImpl implements NetworkManager, Manager,
NetworkS
         // 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, boolean isSystem, long zoneId) throws ResourceAllocationException,
+            InsufficientAddressCapacityException, ConcurrentOperationException {
+        // TODO Auto-generated method stub
+        return null;
+    }
 }

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/d9e36ac3/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
index fb5be2b..3687e9c 100644
--- a/server/test/com/cloud/network/MockRulesManagerImpl.java
+++ b/server/test/com/cloud/network/MockRulesManagerImpl.java
@@ -1,3 +1,19 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+// 
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
 package com.cloud.network;
 
 import java.util.List;
@@ -6,7 +22,8 @@ import java.util.Map;
 import javax.ejb.Local;
 import javax.naming.ConfigurationException;
 
-import com.cloud.api.commands.ListPortForwardingRulesCmd;
+import org.apache.cloudstack.api.command.user.firewall.ListPortForwardingRulesCmd;
+
 import com.cloud.exception.InsufficientAddressCapacityException;
 import com.cloud.exception.NetworkRuleConflictException;
 import com.cloud.exception.ResourceUnavailableException;

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/d9e36ac3/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
index ddccc2b..1a01681 100644
--- a/server/test/com/cloud/network/vpn/MockRemoteAccessVPNServiceProvider.java
+++ b/server/test/com/cloud/network/vpn/MockRemoteAccessVPNServiceProvider.java
@@ -1,3 +1,19 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
 package com.cloud.network.vpn;
 
 import java.util.List;

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/d9e36ac3/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
index 25d52e7..b691d2a 100644
--- a/server/test/com/cloud/network/vpn/RemoteAccessVpnTest.java
+++ b/server/test/com/cloud/network/vpn/RemoteAccessVpnTest.java
@@ -1,3 +1,19 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
 package com.cloud.network.vpn;
 
 import java.util.ArrayList;

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/d9e36ac3/server/test/com/cloud/resource/MockResourceManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/resource/MockResourceManagerImpl.java b/server/test/com/cloud/resource/MockResourceManagerImpl.java
index 19356b3..e94cdea 100644
--- a/server/test/com/cloud/resource/MockResourceManagerImpl.java
+++ b/server/test/com/cloud/resource/MockResourceManagerImpl.java
@@ -24,21 +24,15 @@ import java.util.Set;
 import javax.ejb.Local;
 import javax.naming.ConfigurationException;
 
+import org.apache.cloudstack.api.command.admin.cluster.AddClusterCmd;
+import org.apache.cloudstack.api.command.admin.cluster.DeleteClusterCmd;
+import org.apache.cloudstack.api.command.admin.host.*;
+import org.apache.cloudstack.api.command.admin.storage.*;
+import org.apache.cloudstack.api.command.admin.swift.*;
+
 import com.cloud.agent.api.StartupCommand;
 import com.cloud.agent.api.StartupRoutingCommand;
-import com.cloud.api.commands.AddClusterCmd;
-import com.cloud.api.commands.AddHostCmd;
-import com.cloud.api.commands.AddS3Cmd;
-import com.cloud.api.commands.AddSecondaryStorageCmd;
-import com.cloud.api.commands.AddSwiftCmd;
-import com.cloud.api.commands.CancelMaintenanceCmd;
-import com.cloud.api.commands.DeleteClusterCmd;
-import com.cloud.api.commands.ListS3sCmd;
-import com.cloud.api.commands.ListSwiftsCmd;
-import com.cloud.api.commands.PrepareForMaintenanceCmd;
-import com.cloud.api.commands.ReconnectHostCmd;
-import com.cloud.api.commands.UpdateHostCmd;
-import com.cloud.api.commands.UpdateHostPasswordCmd;
+
 import com.cloud.dc.DataCenterVO;
 import com.cloud.dc.HostPodVO;
 import com.cloud.dc.PodCluster;

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/d9e36ac3/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 78d2ea2..b4e1794 100644
--- a/server/test/com/cloud/vpc/MockNetworkManagerImpl.java
+++ b/server/test/com/cloud/vpc/MockNetworkManagerImpl.java
@@ -16,23 +16,52 @@
 // under the License.
 package com.cloud.vpc;
 
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.ejb.Local;
+import javax.naming.ConfigurationException;
+
+import org.apache.cloudstack.acl.ControlledEntity.ACLType;
+import org.apache.cloudstack.api.command.admin.usage.ListTrafficTypeImplementorsCmd;
+import org.apache.cloudstack.api.command.user.network.CreateNetworkCmd;
+import org.apache.cloudstack.api.command.user.network.ListNetworksCmd;
+import org.apache.cloudstack.api.command.user.network.RestartNetworkCmd;
+import org.apache.log4j.Logger;
+
 import com.cloud.dc.DataCenter;
-import com.cloud.dc.Vlan;
 import com.cloud.dc.Vlan.VlanType;
 import com.cloud.deploy.DataCenterDeployment;
 import com.cloud.deploy.DeployDestination;
 import com.cloud.deploy.DeploymentPlan;
-import com.cloud.exception.*;
-import com.cloud.hypervisor.Hypervisor.HypervisorType;
-import com.cloud.network.*;
-import com.cloud.network.Network.Capability;
-import com.cloud.network.Network.GuestType;
+import com.cloud.exception.ConcurrentOperationException;
+import com.cloud.exception.InsufficientAddressCapacityException;
+import com.cloud.exception.InsufficientCapacityException;
+import com.cloud.exception.InsufficientVirtualNetworkCapcityException;
+import com.cloud.exception.ResourceAllocationException;
+import com.cloud.exception.ResourceUnavailableException;
+import com.cloud.network.IPAddressVO;
+import com.cloud.network.IpAddress;
+import com.cloud.network.Network;
 import com.cloud.network.Network.Provider;
 import com.cloud.network.Network.Service;
+import com.cloud.network.NetworkManager;
+import com.cloud.network.NetworkProfile;
+import com.cloud.network.NetworkRuleApplier;
+import com.cloud.network.NetworkService;
+import com.cloud.network.NetworkVO;
 import com.cloud.network.Networks.TrafficType;
+import com.cloud.network.PhysicalNetwork;
+import com.cloud.network.PhysicalNetworkServiceProvider;
+import com.cloud.network.PhysicalNetworkTrafficType;
+import com.cloud.network.PublicIpAddress;
 import com.cloud.network.addr.PublicIp;
 import com.cloud.network.dao.NetworkServiceMapDao;
-import com.cloud.network.element.*;
+import com.cloud.network.element.LoadBalancingServiceProvider;
+import com.cloud.network.element.NetworkElement;
+import com.cloud.network.element.StaticNatServiceProvider;
+import com.cloud.network.element.UserDataServiceProvider;
 import com.cloud.network.guru.NetworkGuru;
 import com.cloud.network.rules.FirewallRule;
 import com.cloud.network.rules.FirewallRule.Purpose;
@@ -47,18 +76,13 @@ import com.cloud.utils.Pair;
 import com.cloud.utils.component.Adapters;
 import com.cloud.utils.component.Inject;
 import com.cloud.utils.component.Manager;
-import com.cloud.vm.*;
-import com.cloud.vpc.dao.MockVpcVirtualRouterElement;
-import org.apache.cloudstack.acl.ControlledEntity.ACLType;
-import org.apache.cloudstack.api.command.admin.usage.ListTrafficTypeImplementorsCmd;
-import org.apache.cloudstack.api.command.user.network.CreateNetworkCmd;
-import org.apache.cloudstack.api.command.user.network.ListNetworksCmd;
-import org.apache.cloudstack.api.command.user.network.RestartNetworkCmd;
-import org.apache.log4j.Logger;
-
-import javax.ejb.Local;
-import javax.naming.ConfigurationException;
-import java.util.*;
+import com.cloud.vm.Nic;
+import com.cloud.vm.NicProfile;
+import com.cloud.vm.ReservationContext;
+import com.cloud.vm.VMInstanceVO;
+import com.cloud.vm.VirtualMachine;
+import com.cloud.vm.VirtualMachineProfile;
+import com.cloud.vm.VirtualMachineProfileImpl;
 
 @Local(value = { NetworkManager.class, NetworkService.class })
 public class MockNetworkManagerImpl implements NetworkManager, NetworkService, Manager{
@@ -155,7 +179,7 @@ public class MockNetworkManagerImpl implements NetworkManager, NetworkService,
M
      * @see com.cloud.network.NetworkService#allocateIP(com.cloud.user.Account, long, java.lang.Long)
      */
     @Override
-    public IpAddress allocateIP(Account ipOwner, long zoneId, Long networkId) throws ResourceAllocationException,
+    public IpAddress allocateIP(Account ipOwner, boolean isSystem, long networkId) throws
ResourceAllocationException,
             InsufficientAddressCapacityException, ConcurrentOperationException {
         // TODO Auto-generated method stub
         return null;
@@ -1240,7 +1264,7 @@ public class MockNetworkManagerImpl implements NetworkManager, NetworkService,
M
      * @see com.cloud.network.NetworkManager#allocateIp(com.cloud.user.Account, boolean,
com.cloud.user.Account, com.cloud.dc.DataCenter)
      */
     @Override
-    public IpAddress allocateIp(Account ipOwner, boolean isSystem, Account caller, DataCenter
zone)
+    public IpAddress allocateIp(Account ipOwner, boolean isSystem, Account caller, long callerId,
DataCenter zone)
             throws ConcurrentOperationException, ResourceAllocationException, InsufficientAddressCapacityException
{
         // TODO Auto-generated method stub
         return null;
@@ -1288,4 +1312,17 @@ public class MockNetworkManagerImpl implements NetworkManager, NetworkService,
M
         // TODO Auto-generated method stub
         return null;
     }
+
+
+
+
+
+    /* (non-Javadoc)
+     * @see com.cloud.network.NetworkService#getNetwork(java.lang.String)
+     */
+    @Override
+    public Network getNetwork(String networkUuid) {
+        // TODO Auto-generated method stub
+        return null;
+    }
 }

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/d9e36ac3/server/test/com/cloud/vpc/MockVpcVirtualNetworkApplianceManager.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/vpc/MockVpcVirtualNetworkApplianceManager.java b/server/test/com/cloud/vpc/MockVpcVirtualNetworkApplianceManager.java
index 8716a2b..65ee33a 100644
--- a/server/test/com/cloud/vpc/MockVpcVirtualNetworkApplianceManager.java
+++ b/server/test/com/cloud/vpc/MockVpcVirtualNetworkApplianceManager.java
@@ -23,7 +23,8 @@ import java.util.Map;
 import javax.ejb.Local;
 import javax.naming.ConfigurationException;
 
-import com.cloud.api.commands.UpgradeRouterCmd;
+import org.apache.cloudstack.api.command.admin.router.UpgradeRouterCmd;
+
 import com.cloud.deploy.DeployDestination;
 import com.cloud.exception.ConcurrentOperationException;
 import com.cloud.exception.InsufficientCapacityException;

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/d9e36ac3/server/test/com/cloud/vpc/Site2SiteVpnTest.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/vpc/Site2SiteVpnTest.java b/server/test/com/cloud/vpc/Site2SiteVpnTest.java
index 57117b1..dd6a4fa 100644
--- a/server/test/com/cloud/vpc/Site2SiteVpnTest.java
+++ b/server/test/com/cloud/vpc/Site2SiteVpnTest.java
@@ -1,3 +1,19 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
 package com.cloud.vpc;
 
 import java.util.ArrayList;


Mime
View raw message