cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From h...@apache.org
Subject [1/2] git commit: updated refs/heads/sdnextensions to 3056b1a
Date Mon, 07 Oct 2013 11:58:46 GMT
Updated Branches:
  refs/heads/sdnextensions 0d6125f36 -> 3056b1a9f


Review 13499 - [GSoC] Add staticNat support to GRE controller

Signed-off-by: Hugo Trippaers <htrippaers@schubergphilis.com>


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

Branch: refs/heads/sdnextensions
Commit: a0a818317ff8742d84eff15f9fb15e7028590534
Parents: 0d6125f
Author: Nguyen Anh Tu <ng.tuna@gmail.com>
Authored: Mon Oct 7 13:46:44 2013 +0200
Committer: Hugo Trippaers <htrippaers@schubergphilis.com>
Committed: Mon Oct 7 13:46:44 2013 +0200

----------------------------------------------------------------------
 .../cloud/api/response/OvsDeviceResponse.java   |  65 -------
 .../cloud/network/commands/AddOvsDeviceCmd.java | 116 ------------
 .../network/commands/DeleteOvsDeviceCmd.java    | 110 ------------
 .../network/commands/ListOvsDevicesCmd.java     | 114 ------------
 .../com/cloud/network/element/OvsElement.java   |  81 ++++++---
 .../ovs/src/com/cloud/network/ovs/OvsApi.java   |  78 ---------
 .../com/cloud/network/ovs/OvsApiException.java  |  35 ----
 .../network/ovs/OvsCreateGreTunnelAnswer.java   |  81 ---------
 .../network/ovs/OvsCreateGreTunnelCommand.java  |  54 ------
 .../network/ovs/OvsCreateTunnelAnswer.java      |  86 ---------
 .../network/ovs/OvsCreateTunnelCommand.java     |  69 --------
 .../cloud/network/ovs/OvsDeleteFlowCommand.java |  36 ----
 .../network/ovs/OvsDestroyBridgeCommand.java    |  45 -----
 .../network/ovs/OvsDestroyTunnelCommand.java    |  50 ------
 .../network/ovs/OvsFetchInterfaceAnswer.java    |  59 -------
 .../network/ovs/OvsFetchInterfaceCommand.java   |  38 ----
 .../network/ovs/OvsSetTagAndFlowAnswer.java     |  40 -----
 .../network/ovs/OvsSetTagAndFlowCommand.java    |  60 -------
 .../network/ovs/OvsSetupBridgeCommand.java      |  50 ------
 .../cloud/network/ovs/StartupOvsCommand.java    |  27 ---
 .../com/cloud/network/ovs/dao/OvsDeviceDao.java |  26 ---
 .../cloud/network/ovs/dao/OvsDeviceDaoImpl.java |  49 ------
 .../com/cloud/network/ovs/dao/OvsDeviceVO.java  |  88 ----------
 .../com/cloud/network/resource/OvsResource.java | 175 -------------------
 .../network/element/VirtualRouterElement.java   |  53 ++----
 25 files changed, 77 insertions(+), 1608 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a0a81831/plugins/network-elements/ovs/src/com/cloud/api/response/OvsDeviceResponse.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/ovs/src/com/cloud/api/response/OvsDeviceResponse.java b/plugins/network-elements/ovs/src/com/cloud/api/response/OvsDeviceResponse.java
deleted file mode 100644
index c0901b2..0000000
--- a/plugins/network-elements/ovs/src/com/cloud/api/response/OvsDeviceResponse.java
+++ /dev/null
@@ -1,65 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-package com.cloud.api.response;
-
-import org.apache.cloudstack.api.ApiConstants;
-import org.apache.cloudstack.api.BaseResponse;
-import org.apache.cloudstack.api.EntityReference;
-
-import com.cloud.network.ovs.dao.OvsDeviceVO;
-import com.cloud.serializer.Param;
-import com.google.gson.annotations.SerializedName;
-
-@EntityReference(value = OvsDeviceVO.class)
-public class OvsDeviceResponse extends BaseResponse {
-
-	@SerializedName(ApiConstants.OVS_DEVICE_ID)
-	@Param(description = "device id of the Ovs")
-	private String id;
-
-	@SerializedName(ApiConstants.PHYSICAL_NETWORK_ID)
-	@Param(description = "the physical network to which this device belongs to")
-	private String physicalNetworkId;
-
-	@SerializedName(ApiConstants.OVS_DEVICE_NAME)
-	@Param(description = "device name")
-	private String deviceName;
-
-	@SerializedName(ApiConstants.HOST_NAME)
-	@Param(description = "the controller Ip address")
-	private String hostName;
-
-	public String getId() {
-		return this.id;
-	}
-
-	public void setId(String vnsDeviceId) {
-		this.id = vnsDeviceId;
-	}
-
-	public void setPhysicalNetworkId(String physicalNetworkId) {
-		this.physicalNetworkId = physicalNetworkId;
-	}
-
-	public void setDeviceName(String deviceName) {
-		this.deviceName = deviceName;
-	}
-
-	public void setHostName(String hostName) {
-		this.hostName = hostName;
-	}
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a0a81831/plugins/network-elements/ovs/src/com/cloud/network/commands/AddOvsDeviceCmd.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/ovs/src/com/cloud/network/commands/AddOvsDeviceCmd.java b/plugins/network-elements/ovs/src/com/cloud/network/commands/AddOvsDeviceCmd.java
deleted file mode 100644
index 1abc324..0000000
--- a/plugins/network-elements/ovs/src/com/cloud/network/commands/AddOvsDeviceCmd.java
+++ /dev/null
@@ -1,116 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-package com.cloud.network.commands;
-
-import javax.inject.Inject;
-
-import org.apache.cloudstack.api.APICommand;
-import org.apache.cloudstack.api.ApiConstants;
-import org.apache.cloudstack.api.ApiErrorCode;
-import org.apache.cloudstack.api.BaseAsyncCmd;
-import org.apache.cloudstack.api.Parameter;
-import org.apache.cloudstack.api.ServerApiException;
-import org.apache.cloudstack.api.response.PhysicalNetworkResponse;
-
-import com.cloud.api.response.OvsDeviceResponse;
-import com.cloud.event.EventTypes;
-import com.cloud.exception.ConcurrentOperationException;
-import com.cloud.exception.InsufficientCapacityException;
-import com.cloud.exception.InvalidParameterValueException;
-import com.cloud.exception.NetworkRuleConflictException;
-import com.cloud.exception.ResourceAllocationException;
-import com.cloud.exception.ResourceUnavailableException;
-import com.cloud.network.element.OvsElementService;
-import com.cloud.network.ovs.dao.OvsDeviceVO;
-import com.cloud.user.UserContext;
-import com.cloud.utils.exception.CloudRuntimeException;
-
-@APICommand(name = "addDevice", responseObject = OvsDeviceResponse.class, description = "Adds a Ovs controller device")
-public class AddOvsDeviceCmd extends BaseAsyncCmd {
-	private static final String s_name = "adddeviceresponse";
-	@Inject
-	OvsElementService _ovsElementService;
-
-	// ///////////////////////////////////////////////////
-	// ////////////// API parameters /////////////////////
-	// ///////////////////////////////////////////////////
-
-	@Parameter(name = ApiConstants.PHYSICAL_NETWORK_ID, type = CommandType.UUID, entityType = PhysicalNetworkResponse.class, required = true, description = "the Physical Network ID")
-	private Long physicalNetworkId;
-
-	@Parameter(name = ApiConstants.HOST_NAME, type = CommandType.STRING, required = true, description = "Hostname of ip address of the BigSwitch VNS Controller.")
-	private String host;
-
-	// ///////////////////////////////////////////////////
-	// ///////////////// Accessors ///////////////////////
-	// ///////////////////////////////////////////////////
-
-	public Long getPhysicalNetworkId() {
-		return physicalNetworkId;
-	}
-
-	public String getHost() {
-		return host;
-	}
-
-	// ///////////////////////////////////////////////////
-	// ///////////// API Implementation///////////////////
-	// ///////////////////////////////////////////////////
-	@Override
-	public void execute() throws ResourceUnavailableException,
-			InsufficientCapacityException, ServerApiException,
-			ConcurrentOperationException, ResourceAllocationException,
-			NetworkRuleConflictException {
-		try {
-			OvsDeviceVO ovsDeviceVO = _ovsElementService.addOvsDevice(this);
-			if (ovsDeviceVO != null) {
-				OvsDeviceResponse response = _ovsElementService
-						.createOvsDeviceResponse(ovsDeviceVO);
-				response.setObjectName("ovsdevice");
-				response.setResponseName(getCommandName());
-				this.setResponseObject(response);
-			}
-		} catch (InvalidParameterValueException invalidParamExcp) {
-			throw new ServerApiException(ApiErrorCode.PARAM_ERROR,
-					invalidParamExcp.getMessage());
-		} catch (CloudRuntimeException runtimeExcp) {
-			throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR,
-					runtimeExcp.getMessage());
-		}
-	}
-
-	@Override
-	public String getEventType() {
-		return EventTypes.EVENT_EXTERNAL_OVS_CONTROLLER_ADD;
-	}
-
-	@Override
-	public String getEventDescription() {
-		return "Adding an Ovs Controller";
-	}
-
-	@Override
-	public String getCommandName() {
-		return s_name;
-	}
-
-	@Override
-	public long getEntityOwnerId() {
-		return UserContext.current().getCaller().getId();
-	}
-
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a0a81831/plugins/network-elements/ovs/src/com/cloud/network/commands/DeleteOvsDeviceCmd.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/ovs/src/com/cloud/network/commands/DeleteOvsDeviceCmd.java b/plugins/network-elements/ovs/src/com/cloud/network/commands/DeleteOvsDeviceCmd.java
deleted file mode 100644
index 87eedfb..0000000
--- a/plugins/network-elements/ovs/src/com/cloud/network/commands/DeleteOvsDeviceCmd.java
+++ /dev/null
@@ -1,110 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-package com.cloud.network.commands;
-
-import javax.inject.Inject;
-
-import org.apache.cloudstack.api.APICommand;
-import org.apache.cloudstack.api.ApiConstants;
-import org.apache.cloudstack.api.ApiErrorCode;
-import org.apache.cloudstack.api.BaseAsyncCmd;
-import org.apache.cloudstack.api.Parameter;
-import org.apache.cloudstack.api.ServerApiException;
-import org.apache.cloudstack.api.response.SuccessResponse;
-
-import com.cloud.api.response.OvsDeviceResponse;
-import com.cloud.event.EventTypes;
-import com.cloud.exception.ConcurrentOperationException;
-import com.cloud.exception.InsufficientCapacityException;
-import com.cloud.exception.InvalidParameterValueException;
-import com.cloud.exception.NetworkRuleConflictException;
-import com.cloud.exception.ResourceAllocationException;
-import com.cloud.exception.ResourceUnavailableException;
-import com.cloud.network.element.OvsElementService;
-import com.cloud.user.UserContext;
-import com.cloud.utils.exception.CloudRuntimeException;
-
-@APICommand(name = "deleteOvsDevice", responseObject = SuccessResponse.class, description = " delete a ovs device")
-public class DeleteOvsDeviceCmd extends BaseAsyncCmd {
-	private static final String s_name = "deleteovsdeviceresponse";
-	@Inject
-	OvsElementService _ovsElementService;
-
-	// ///////////////////////////////////////////////////
-	// ////////////// API parameters /////////////////////
-	// ///////////////////////////////////////////////////
-
-	@Parameter(name = ApiConstants.OVS_DEVICE_ID, type = CommandType.UUID, entityType = OvsDeviceResponse.class, required = true, description = "Ovs device ID")
-	private Long ovsDeviceId;
-
-	// ///////////////////////////////////////////////////
-	// ///////////////// Accessors ///////////////////////
-	// ///////////////////////////////////////////////////
-
-	public Long getOvsDeviceId() {
-		return ovsDeviceId;
-	}
-
-	// ///////////////////////////////////////////////////
-	// ///////////// API Implementation///////////////////
-	// ///////////////////////////////////////////////////
-	@Override
-	public void execute() throws ResourceUnavailableException,
-			InsufficientCapacityException, ServerApiException,
-			ConcurrentOperationException, ResourceAllocationException,
-			NetworkRuleConflictException {
-		try {
-			boolean result = _ovsElementService.deleteOvsDevice(this);
-			if (result) {
-				SuccessResponse response = new SuccessResponse(getCommandName());
-				response.setResponseName(getCommandName());
-				this.setResponseObject(response);
-			} else {
-				throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR,
-						"Failed to delete Ovs device.");
-			}
-
-		} catch (InvalidParameterValueException invalidParamExcp) {
-			throw new ServerApiException(ApiErrorCode.PARAM_ERROR,
-					invalidParamExcp.getMessage());
-		} catch (CloudRuntimeException runtimeExcp) {
-			throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR,
-					runtimeExcp.getMessage());
-		}
-	}
-
-	@Override
-	public String getEventType() {
-		return EventTypes.EVENT_EXTERNAL_OVS_CONTROLLER_DELETE;
-	}
-
-	@Override
-	public String getEventDescription() {
-		return "Deleting Ovs Controller";
-	}
-
-	@Override
-	public String getCommandName() {
-		return s_name;
-	}
-
-	@Override
-	public long getEntityOwnerId() {
-		return UserContext.current().getCaller().getId();
-	}
-
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a0a81831/plugins/network-elements/ovs/src/com/cloud/network/commands/ListOvsDevicesCmd.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/ovs/src/com/cloud/network/commands/ListOvsDevicesCmd.java b/plugins/network-elements/ovs/src/com/cloud/network/commands/ListOvsDevicesCmd.java
deleted file mode 100644
index 2adb33a..0000000
--- a/plugins/network-elements/ovs/src/com/cloud/network/commands/ListOvsDevicesCmd.java
+++ /dev/null
@@ -1,114 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-package com.cloud.network.commands;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.inject.Inject;
-
-import org.apache.cloudstack.api.APICommand;
-import org.apache.cloudstack.api.ApiConstants;
-import org.apache.cloudstack.api.ApiErrorCode;
-import org.apache.cloudstack.api.BaseListCmd;
-import org.apache.cloudstack.api.Parameter;
-import org.apache.cloudstack.api.ServerApiException;
-import org.apache.cloudstack.api.response.ListResponse;
-import org.apache.cloudstack.api.response.PhysicalNetworkResponse;
-import org.apache.log4j.Logger;
-
-import com.cloud.api.response.OvsDeviceResponse;
-import com.cloud.exception.ConcurrentOperationException;
-import com.cloud.exception.InsufficientCapacityException;
-import com.cloud.exception.InvalidParameterValueException;
-import com.cloud.exception.NetworkRuleConflictException;
-import com.cloud.exception.ResourceAllocationException;
-import com.cloud.exception.ResourceUnavailableException;
-import com.cloud.network.element.OvsElementService;
-import com.cloud.network.ovs.dao.OvsDeviceVO;
-import com.cloud.utils.exception.CloudRuntimeException;
-
-@APICommand(name = "listOvsDevices", responseObject = OvsDeviceResponse.class, description = "Lists Ovs devices")
-public class ListOvsDevicesCmd extends BaseListCmd {
-	public static final Logger s_logger = Logger
-			.getLogger(ListOvsDevicesCmd.class.getName());
-	private static final String s_name = "listovsdeviceresponse";
-	@Inject
-	OvsElementService _ovsElementService;
-
-	// ///////////////////////////////////////////////////
-	// ////////////// API parameters /////////////////////
-	// ///////////////////////////////////////////////////
-
-	@Parameter(name = ApiConstants.PHYSICAL_NETWORK_ID, type = CommandType.UUID, entityType = PhysicalNetworkResponse.class, description = "the Physical Network ID")
-	private Long physicalNetworkId;
-
-	@Parameter(name = ApiConstants.OVS_DEVICE_ID, type = CommandType.UUID, entityType = OvsDeviceResponse.class, description = "ovs device ID")
-	private Long ovsDeviceId;
-
-	// ///////////////////////////////////////////////////
-	// ///////////////// Accessors ///////////////////////
-	// ///////////////////////////////////////////////////
-
-	public Long getOvsDeviceId() {
-		return ovsDeviceId;
-	}
-
-	public Long getPhysicalNetworkId() {
-		return physicalNetworkId;
-	}
-
-	// ///////////////////////////////////////////////////
-	// ///////////// API Implementation///////////////////
-	// ///////////////////////////////////////////////////
-	@Override
-	public void execute() throws ResourceUnavailableException,
-			InsufficientCapacityException, ServerApiException,
-			ConcurrentOperationException, ResourceAllocationException,
-			NetworkRuleConflictException {
-		try {
-			List<OvsDeviceVO> ovsDevices = _ovsElementService
-					.listOvsDevices(this);
-			ListResponse<OvsDeviceResponse> response = new ListResponse<OvsDeviceResponse>();
-			List<OvsDeviceResponse> ovsDevicesResponse = new ArrayList<OvsDeviceResponse>();
-
-			if (ovsDevices != null && !ovsDevices.isEmpty()) {
-				for (OvsDeviceVO ovsDeviceVO : ovsDevices) {
-					OvsDeviceResponse ovsDeviceResponse = _ovsElementService
-							.createOvsDeviceResponse(ovsDeviceVO);
-					ovsDevicesResponse.add(ovsDeviceResponse);
-				}
-			}
-
-			response.setResponses(ovsDevicesResponse);
-			response.setResponseName(getCommandName());
-			this.setResponseObject(response);
-		} catch (InvalidParameterValueException invalidParamExcp) {
-			throw new ServerApiException(ApiErrorCode.PARAM_ERROR,
-					invalidParamExcp.getMessage());
-		} catch (CloudRuntimeException runtimeExcp) {
-			throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR,
-					runtimeExcp.getMessage());
-		}
-	}
-
-	@Override
-	public String getCommandName() {
-		return s_name;
-	}
-
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a0a81831/plugins/network-elements/ovs/src/com/cloud/network/element/OvsElement.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/ovs/src/com/cloud/network/element/OvsElement.java b/plugins/network-elements/ovs/src/com/cloud/network/element/OvsElement.java
index 3824669..c7c6484 100644
--- a/plugins/network-elements/ovs/src/com/cloud/network/element/OvsElement.java
+++ b/plugins/network-elements/ovs/src/com/cloud/network/element/OvsElement.java
@@ -47,6 +47,8 @@ import com.cloud.network.PhysicalNetworkServiceProvider;
 import com.cloud.network.PublicIpAddress;
 import com.cloud.network.dao.NetworkServiceMapDao;
 import com.cloud.network.ovs.OvsTunnelManager;
+import com.cloud.network.router.VirtualRouter.Role;
+import com.cloud.network.router.VpcVirtualNetworkApplianceManager;
 import com.cloud.network.rules.PortForwardingRule;
 import com.cloud.network.rules.StaticNat;
 import com.cloud.offering.NetworkOffering;
@@ -55,10 +57,12 @@ import com.cloud.resource.ResourceStateAdapter;
 import com.cloud.resource.ServerResource;
 import com.cloud.resource.UnableDeleteHostException;
 import com.cloud.utils.component.AdapterBase;
+import com.cloud.vm.DomainRouterVO;
 import com.cloud.vm.NicProfile;
 import com.cloud.vm.ReservationContext;
 import com.cloud.vm.VirtualMachine;
 import com.cloud.vm.VirtualMachineProfile;
+import com.cloud.vm.dao.DomainRouterDao;
 
 @Local(value = { NetworkElement.class, ConnectivityProvider.class,
 		SourceNatServiceProvider.class, StaticNatServiceProvider.class,
@@ -75,6 +79,10 @@ public class OvsElement extends AdapterBase implements NetworkElement,
 	NetworkServiceMapDao _ntwkSrvcDao;
 	@Inject
 	ResourceManager _resourceMgr;
+	@Inject
+	DomainRouterDao _routerDao;
+	@Inject
+	VpcVirtualNetworkApplianceManager _routerMgr;
 
 	private static final Logger s_logger = Logger.getLogger(OvsElement.class);
 	private static final Map<Service, Map<Capability, String>> capabilities = setCapabilities();
@@ -132,8 +140,6 @@ public class OvsElement extends AdapterBase implements NetworkElement,
 		if (!canHandle(network, Service.Connectivity)) {
 			return false;
 		}
-		// TODO: implement SourceNat immediately when we code L3 services
-
 		return true;
 	}
 
@@ -223,12 +229,12 @@ public class OvsElement extends AdapterBase implements NetworkElement,
 			return false;
 		}
 
-		if ((services.contains(Service.PortForwarding) || services
-				.contains(Service.StaticNat))
-				&& !services.contains(Service.SourceNat)) {
-			s_logger.warn("Unable to provide StaticNat and/or PortForwarding without the SourceNat service");
-			return false;
-		}
+		// if ((services.contains(Service.PortForwarding) || services
+		// .contains(Service.StaticNat))
+		// && !services.contains(Service.SourceNat)) {
+		// s_logger.warn("Unable to provide StaticNat and/or PortForwarding without the SourceNat service");
+		// return false;
+		// }
 		return true;
 	}
 
@@ -239,22 +245,22 @@ public class OvsElement extends AdapterBase implements NetworkElement,
 		capabilities.put(Service.Connectivity, null);
 
 		// TODO: we need L3 support for coding L3 services in next period
-		// // L3 Support : Generic?
+		// L3 Support : Generic?
 		// capabilities.put(Service.Gateway, null);
-		//
-		// // L3 Support : SourceNat
+
+		// L3 Support : SourceNat
 		// Map<Capability, String> sourceNatCapabilities = new
 		// HashMap<Capability, String>();
 		// sourceNatCapabilities.put(Capability.SupportedSourceNatTypes,
 		// "peraccount");
 		// sourceNatCapabilities.put(Capability.RedundantRouter, "false");
 		// capabilities.put(Service.SourceNat, sourceNatCapabilities);
-		//
-		// // L3 Support : Port Forwarding
+
+		// L3 Support : Port Forwarding
 		// capabilities.put(Service.PortForwarding, null);
-		//
-		// // L3 support : StaticNat
-		// capabilities.put(Service.StaticNat, null);
+
+		// L3 support : StaticNat
+		capabilities.put(Service.StaticNat, null);
 
 		return capabilities;
 	}
@@ -294,24 +300,53 @@ public class OvsElement extends AdapterBase implements NetworkElement,
 	// TODO: Adding L3 services below
 	@Override
 	public IpDeployer getIpDeployer(Network network) {
-		// TODO Auto-generated method stub
-		return null;
+		return this;
 	}
 
 	@Override
 	public boolean applyIps(Network network,
 			List<? extends PublicIpAddress> ipAddress, Set<Service> services)
 			throws ResourceUnavailableException {
-		// TODO Auto-generated method stub
-		return false;
+		boolean canHandle = true;
+		for (Service service : services) {
+			// check if Ovs can handle services except SourceNat
+			if (!canHandle(network, service) && service != Service.SourceNat) {
+				canHandle = false;
+				break;
+			}
+		}
+		if (canHandle) {
+			List<DomainRouterVO> routers = _routerDao.listByNetworkAndRole(
+					network.getId(), Role.VIRTUAL_ROUTER);
+			if (routers == null || routers.isEmpty()) {
+				s_logger.debug("Virtual router element doesn't need to associate ip addresses on the backend; virtual "
+						+ "router doesn't exist in the network "
+						+ network.getId());
+				return true;
+			}
+
+			return _routerMgr.associatePublicIP(network, ipAddress, routers);
+		} else {
+			return false;
+		}
 	}
 
 	@Override
-	public boolean applyStaticNats(Network config,
+	public boolean applyStaticNats(Network network,
 			List<? extends StaticNat> rules)
 			throws ResourceUnavailableException {
-		// TODO Auto-generated method stub
-		return false;
+		if (!canHandle(network, Service.StaticNat)) {
+			return false;
+		}
+		List<DomainRouterVO> routers = _routerDao.listByNetworkAndRole(
+				network.getId(), Role.VIRTUAL_ROUTER);
+		if (routers == null || routers.isEmpty()) {
+			s_logger.debug("Ovs element doesn't need to apply static nat on the backend; virtual "
+					+ "router doesn't exist in the network " + network.getId());
+			return true;
+		}
+
+		return _routerMgr.applyStaticNats(network, rules, routers);
 	}
 
 	@Override

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a0a81831/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsApi.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsApi.java b/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsApi.java
deleted file mode 100644
index b533312..0000000
--- a/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsApi.java
+++ /dev/null
@@ -1,78 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-package com.cloud.network.ovs;
-
-import java.net.MalformedURLException;
-import java.net.URL;
-
-import org.apache.commons.httpclient.HttpClient;
-import org.apache.commons.httpclient.HttpMethod;
-import org.apache.commons.httpclient.MultiThreadedHttpConnectionManager;
-import org.apache.commons.httpclient.cookie.CookiePolicy;
-import org.apache.commons.httpclient.methods.DeleteMethod;
-import org.apache.commons.httpclient.methods.GetMethod;
-import org.apache.commons.httpclient.methods.PostMethod;
-import org.apache.commons.httpclient.methods.PutMethod;
-import org.apache.log4j.Logger;
-
-public class OvsApi {
-	private static final Logger s_logger = Logger.getLogger(OvsApi.class);
-	private final static String _protocol = "http";
-	private final static MultiThreadedHttpConnectionManager s_httpClientManager = new MultiThreadedHttpConnectionManager();
-
-	private String _host;
-
-	private final HttpClient _client;
-
-	protected HttpClient createHttpClient() {
-		return new HttpClient(s_httpClientManager);
-	}
-
-	protected HttpMethod createMethod(String type, String uri, int port)
-			throws OvsApiException {
-		String url;
-		try {
-			url = new URL(_protocol, _host, port, uri).toString();
-		} catch (MalformedURLException e) {
-			s_logger.error("Unable to build Ovs API URL", e);
-			throw new OvsApiException("Unable to Ovs API URL", e);
-		}
-
-		if ("post".equalsIgnoreCase(type)) {
-			return new PostMethod(url);
-		} else if ("get".equalsIgnoreCase(type)) {
-			return new GetMethod(url);
-		} else if ("delete".equalsIgnoreCase(type)) {
-			return new DeleteMethod(url);
-		} else if ("put".equalsIgnoreCase(type)) {
-			return new PutMethod(url);
-		} else {
-			throw new OvsApiException("Requesting unknown method type");
-		}
-	}
-
-	public OvsApi() {
-		_client = createHttpClient();
-		_client.getParams().setCookiePolicy(CookiePolicy.BROWSER_COMPATIBILITY);
-	}
-
-	public void setControllerAddress(String address) {
-		this._host = address;
-	}
-
-	// TODO: implement requests
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a0a81831/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsApiException.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsApiException.java b/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsApiException.java
deleted file mode 100644
index 20603e0..0000000
--- a/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsApiException.java
+++ /dev/null
@@ -1,35 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-package com.cloud.network.ovs;
-
-public class OvsApiException extends Exception {
-
-	public OvsApiException() {
-	}
-
-	public OvsApiException(String message) {
-		super(message);
-	}
-
-	public OvsApiException(Throwable cause) {
-		super(cause);
-	}
-
-	public OvsApiException(String message, Throwable cause) {
-		super(message, cause);
-	}
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a0a81831/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsCreateGreTunnelAnswer.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsCreateGreTunnelAnswer.java b/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsCreateGreTunnelAnswer.java
deleted file mode 100644
index 5f0f8c1..0000000
--- a/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsCreateGreTunnelAnswer.java
+++ /dev/null
@@ -1,81 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-package com.cloud.network.ovs;
-
-import com.cloud.agent.api.Answer;
-import com.cloud.agent.api.Command;
-
-public class OvsCreateGreTunnelAnswer extends Answer {
-    String hostIp;
-    String remoteIp;
-    String bridge;
-    String key;
-    long from;
-    long to;
-    int port;
-
-    public OvsCreateGreTunnelAnswer(Command cmd, boolean success, String details) {
-        super(cmd, success, details);
-    }
-
-    public OvsCreateGreTunnelAnswer(Command cmd, boolean success,
-            String details, String hostIp, String bridge) {
-        super(cmd, success, details);
-        OvsCreateGreTunnelCommand c = (OvsCreateGreTunnelCommand) cmd;
-        this.hostIp = hostIp;
-        this.bridge = bridge;
-        this.remoteIp = c.getRemoteIp();
-        this.key = c.getKey();
-        this.port = -1;
-        this.from = c.getFrom();
-        this.to = c.getTo();
-    }
-
-    public OvsCreateGreTunnelAnswer(Command cmd, boolean success,
-            String details, String hostIp, String bridge, int port) {
-        this(cmd, success, details, hostIp, bridge);
-        this.port = port;
-    }
-
-    public String getHostIp() {
-        return hostIp;
-    }
-
-    public String getRemoteIp() {
-        return remoteIp;
-    }
-
-    public String getBridge() {
-        return bridge;
-    }
-
-    public String getKey() {
-        return key;
-    }
-
-    public long getFrom() {
-        return from;
-    }
-
-    public long getTo() {
-        return to;
-    }
-
-    public int getPort() {
-        return port;
-    }
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a0a81831/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsCreateGreTunnelCommand.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsCreateGreTunnelCommand.java b/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsCreateGreTunnelCommand.java
deleted file mode 100644
index e2cd2d8..0000000
--- a/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsCreateGreTunnelCommand.java
+++ /dev/null
@@ -1,54 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-package com.cloud.network.ovs;
-
-import com.cloud.agent.api.Command;
-
-public class OvsCreateGreTunnelCommand extends Command {
-    String remoteIp;
-    String key;
-    long from;
-    long to;
-
-    @Override
-    public boolean executeInSequence() {
-        return true;
-    }
-
-    public OvsCreateGreTunnelCommand(String remoteIp, String key, long from, long to) {
-        this.remoteIp = remoteIp;
-        this.key = key;
-        this.from = from;
-        this.to = to;
-    }
-
-    public String getRemoteIp() {
-        return remoteIp;
-    }
-
-    public String getKey() {
-        return key;
-    }
-
-    public long getFrom() {
-        return from;
-    }
-
-    public long getTo() {
-        return to;
-    }
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a0a81831/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsCreateTunnelAnswer.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsCreateTunnelAnswer.java b/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsCreateTunnelAnswer.java
deleted file mode 100644
index fc2eb8a..0000000
--- a/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsCreateTunnelAnswer.java
+++ /dev/null
@@ -1,86 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-package com.cloud.network.ovs;
-
-import com.cloud.agent.api.Answer;
-import com.cloud.agent.api.Command;
-
-public class OvsCreateTunnelAnswer extends Answer {
-    Long from;
-    Long to;
-    long networkId;
-    String inPortName;
-    
-    //for debug info
-    String fromIp;
-    String toIp;
-    int key;
-    String bridge;
-    
-    public OvsCreateTunnelAnswer(Command cmd, boolean success, String details, String bridge) {
-        super(cmd, success, details);
-        OvsCreateTunnelCommand c = (OvsCreateTunnelCommand)cmd;
-        from = c.getFrom();
-        to = c.getTo();
-        networkId = c.getNetworkId();
-        inPortName = "[]";
-        fromIp = c.getFromIp();
-        toIp = c.getRemoteIp();
-        key = c.getKey();
-        this.bridge = bridge;
-    }
-    
-    public OvsCreateTunnelAnswer(Command cmd, boolean success, String details, String inPortName, String bridge) {
-        this(cmd, success, details, bridge);
-        this.inPortName = inPortName;
-    }
-    
-    
-    public Long getFrom() {
-        return from;
-    }
-    
-    public Long getTo() {
-        return to;
-    }
-    
-    public long getNetworkId() {
-        return networkId;
-    }
-    
-    public String getInPortName() {
-        return inPortName;
-    }
-    
-    public String getFromIp() {
-        return fromIp;
-    }
-    
-    public String getToIp() {
-        return toIp;
-    }
-    
-    public int getKey() {
-        return key;
-    }
-    
-    public String getBridge() {
-        return bridge;
-    }
-}
-
-

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a0a81831/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsCreateTunnelCommand.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsCreateTunnelCommand.java b/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsCreateTunnelCommand.java
deleted file mode 100644
index 1ececa0..0000000
--- a/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsCreateTunnelCommand.java
+++ /dev/null
@@ -1,69 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-package com.cloud.network.ovs;
-
-import com.cloud.agent.api.Command;
-
-public class OvsCreateTunnelCommand extends Command {
-    Integer key;
-    String remoteIp;
-    Long from;
-    Long to;
-    long networkId;
-
-    // for debug info
-    String fromIp;
-
-    @Override
-    public boolean executeInSequence() {
-        return true;
-    }
-
-    public OvsCreateTunnelCommand(String remoteIp, Integer key, Long from, Long to, long networkId, String fromIp) {
-        this.remoteIp = remoteIp;
-        this.key = key;
-        this.from = from;
-        this.to = to;
-        this.networkId = networkId;
-        this.fromIp = fromIp;
-    }
-
-    public Integer getKey() {
-        return key;
-    }
-
-    public String getRemoteIp() {
-        return remoteIp;
-    }
-
-    public Long getFrom() {
-        return from;
-    }
-
-    public Long getTo() {
-        return to;
-    }
-
-    public long getNetworkId() {
-        return networkId;
-    }
-
-    public String getFromIp() {
-        return fromIp;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a0a81831/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsDeleteFlowCommand.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsDeleteFlowCommand.java b/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsDeleteFlowCommand.java
deleted file mode 100644
index 2a6d5d7..0000000
--- a/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsDeleteFlowCommand.java
+++ /dev/null
@@ -1,36 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-package com.cloud.network.ovs;
-
-import com.cloud.agent.api.Command;
-
-public class OvsDeleteFlowCommand extends Command {
-    String vmName;
-
-    @Override
-    public boolean executeInSequence() {
-        return true;
-    }
-
-    public String getVmName() {
-        return vmName;
-    }
-
-    public OvsDeleteFlowCommand(String vmName) {
-        this.vmName = vmName;
-    }
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a0a81831/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsDestroyBridgeCommand.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsDestroyBridgeCommand.java b/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsDestroyBridgeCommand.java
deleted file mode 100644
index 8be5586..0000000
--- a/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsDestroyBridgeCommand.java
+++ /dev/null
@@ -1,45 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-
-package com.cloud.network.ovs;
-
-import com.cloud.agent.api.Command;
-
-public class OvsDestroyBridgeCommand extends Command {
-
-    Long networkId;
-    Integer key;
-    
-    public OvsDestroyBridgeCommand(Long networkId, Integer key) {
-        this.networkId = networkId;
-        this.key = key;
-    }
-    
-    public Long getNetworkId() {
-        return networkId;
-    }
-    
-    public Integer getKey() {
-    	return key;
-    }
-    
-	@Override
-	public boolean executeInSequence() {
-		return true;
-	}
-
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a0a81831/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsDestroyTunnelCommand.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsDestroyTunnelCommand.java b/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsDestroyTunnelCommand.java
deleted file mode 100644
index 4594d99..0000000
--- a/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsDestroyTunnelCommand.java
+++ /dev/null
@@ -1,50 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-package com.cloud.network.ovs;
-
-import com.cloud.agent.api.Command;
-
-public class OvsDestroyTunnelCommand extends Command {
-    
-	Long networkId;
-	Integer key;
-    String inPortName;
-    
-    public OvsDestroyTunnelCommand(Long networkId, Integer key, String inPortName) {
-        this.networkId = networkId;
-        this.inPortName = inPortName;
-        this.key = key;
-    }
-    
-    public Long getNetworkId() {
-        return networkId;
-    }
-    
-    public String getInPortName() {
-        return inPortName;
-    }
-    
-    public Integer getKey() {
-    	return key;
-    }
-    
-    @Override
-    public boolean executeInSequence() {
-        return true;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a0a81831/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsFetchInterfaceAnswer.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsFetchInterfaceAnswer.java b/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsFetchInterfaceAnswer.java
deleted file mode 100644
index 1ee6606..0000000
--- a/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsFetchInterfaceAnswer.java
+++ /dev/null
@@ -1,59 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-
-
-package com.cloud.network.ovs;
-
-import com.cloud.agent.api.Answer;
-import com.cloud.agent.api.Command;
-
-public class OvsFetchInterfaceAnswer extends Answer {
-	String ip;
-    String netmask;
-    String mac;
-    String label;
-
-    public OvsFetchInterfaceAnswer(Command cmd, boolean success, String details) {
-        super(cmd, success, details);
-        this.label = ((OvsFetchInterfaceCommand)cmd).getLabel();
-    }
-
-    public OvsFetchInterfaceAnswer(Command cmd, boolean success,
-            String details, String ip, String netmask, String mac) {
-        super(cmd, success, details);
-        this.ip = ip;
-        this.netmask = netmask;
-        this.mac = mac;
-        this.label = ((OvsFetchInterfaceCommand)cmd).getLabel();
-    }
-
-    public String getIp() {
-        return ip;
-    }
-
-    public String getNetmask() {
-        return netmask;
-    }
-
-    public String getMac() {
-        return mac;
-    }
-
-    public String getLabel() {
-    	return label;
-    }
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a0a81831/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsFetchInterfaceCommand.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsFetchInterfaceCommand.java b/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsFetchInterfaceCommand.java
deleted file mode 100644
index c27daf0..0000000
--- a/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsFetchInterfaceCommand.java
+++ /dev/null
@@ -1,38 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-
-package com.cloud.network.ovs;
-
-import com.cloud.agent.api.Command;
-
-public class OvsFetchInterfaceCommand extends Command {
-    String label;
-
-    @Override
-    public boolean executeInSequence() {
-        return true;
-    }
-
-    public OvsFetchInterfaceCommand(String label) {
-        this.label = label;
-    }
-
-    public String getLabel() {
-        return label;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a0a81831/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsSetTagAndFlowAnswer.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsSetTagAndFlowAnswer.java b/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsSetTagAndFlowAnswer.java
deleted file mode 100644
index ba16839..0000000
--- a/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsSetTagAndFlowAnswer.java
+++ /dev/null
@@ -1,40 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-package com.cloud.network.ovs;
-
-import com.cloud.agent.api.Answer;
-import com.cloud.agent.api.Command;
-
-public class OvsSetTagAndFlowAnswer extends Answer {
-    Long vmId;
-    Long seqno;
-
-    public OvsSetTagAndFlowAnswer(Command cmd, boolean success, String details) {
-        super(cmd, success, details);
-        OvsSetTagAndFlowCommand c = (OvsSetTagAndFlowCommand) cmd;
-        this.vmId = c.getVmId();
-        this.seqno = Long.parseLong(c.getSeqNo());
-    }
-
-    public Long getVmId() {
-        return vmId;
-    }
-
-    public Long getSeqNo() {
-        return seqno;
-    }
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a0a81831/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsSetTagAndFlowCommand.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsSetTagAndFlowCommand.java b/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsSetTagAndFlowCommand.java
deleted file mode 100644
index 17121a0..0000000
--- a/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsSetTagAndFlowCommand.java
+++ /dev/null
@@ -1,60 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-package com.cloud.network.ovs;
-
-import com.cloud.agent.api.Command;
-
-public class OvsSetTagAndFlowCommand extends Command {
-    String vlans;
-    String vmName;
-    String seqno;
-    String tag;
-    Long vmId;
-
-    @Override
-    public boolean executeInSequence() {
-        return true;
-    }
-
-    public String getSeqNo() {
-        return seqno;
-    }
-
-    public String getVlans() {
-        return vlans;
-    }
-
-    public String getVmName() {
-        return vmName;
-    }
-
-    public Long getVmId() {
-        return vmId;
-    }
-
-    public String getTag() {
-        return tag;
-    }
-
-    public OvsSetTagAndFlowCommand(String vmName, String tag, String vlans, String seqno, Long vmId) {
-        this.vmName = vmName;
-        this.tag = tag;
-        this.vlans = vlans;
-        this.seqno = seqno;
-        this.vmId = vmId;
-    }
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a0a81831/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsSetupBridgeCommand.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsSetupBridgeCommand.java b/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsSetupBridgeCommand.java
deleted file mode 100644
index 29cce15..0000000
--- a/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsSetupBridgeCommand.java
+++ /dev/null
@@ -1,50 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-
-package com.cloud.network.ovs;
-
-import com.cloud.agent.api.Command;
-
-public class OvsSetupBridgeCommand extends Command {
-    Integer key;
-    Long hostId;
-    Long networkId;
-
-    @Override
-    public boolean executeInSequence() {
-        return true;
-    }
-
-    public OvsSetupBridgeCommand(Integer key, Long hostId, Long networkId) {
-        this.key = key;
-        this.hostId = hostId;
-        this.networkId = networkId;
-    }
-
-    public Integer getKey() {
-        return key;
-    }
-
-    public Long getHostId() {
-        return hostId;
-    }
-
-    public Long getNetworkId() {
-    	return networkId;
-    }
-    
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a0a81831/plugins/network-elements/ovs/src/com/cloud/network/ovs/StartupOvsCommand.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/ovs/src/com/cloud/network/ovs/StartupOvsCommand.java b/plugins/network-elements/ovs/src/com/cloud/network/ovs/StartupOvsCommand.java
deleted file mode 100644
index b85331e..0000000
--- a/plugins/network-elements/ovs/src/com/cloud/network/ovs/StartupOvsCommand.java
+++ /dev/null
@@ -1,27 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-package com.cloud.network.ovs;
-
-import com.cloud.agent.api.StartupCommand;
-import com.cloud.host.Host;
-
-public class StartupOvsCommand extends StartupCommand {
-
-	public StartupOvsCommand() {
-		super(Host.Type.L2Networking);
-	}
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a0a81831/plugins/network-elements/ovs/src/com/cloud/network/ovs/dao/OvsDeviceDao.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/ovs/src/com/cloud/network/ovs/dao/OvsDeviceDao.java b/plugins/network-elements/ovs/src/com/cloud/network/ovs/dao/OvsDeviceDao.java
deleted file mode 100644
index 794e45e..0000000
--- a/plugins/network-elements/ovs/src/com/cloud/network/ovs/dao/OvsDeviceDao.java
+++ /dev/null
@@ -1,26 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-package com.cloud.network.ovs.dao;
-
-import java.util.List;
-
-import com.cloud.utils.db.GenericDao;
-
-public interface OvsDeviceDao extends GenericDao<OvsDeviceVO, Long> {
-
-	List<OvsDeviceVO> listByPhysicalNetwork(long physicalNetworkId);
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a0a81831/plugins/network-elements/ovs/src/com/cloud/network/ovs/dao/OvsDeviceDaoImpl.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/ovs/src/com/cloud/network/ovs/dao/OvsDeviceDaoImpl.java b/plugins/network-elements/ovs/src/com/cloud/network/ovs/dao/OvsDeviceDaoImpl.java
deleted file mode 100644
index 11a4d48..0000000
--- a/plugins/network-elements/ovs/src/com/cloud/network/ovs/dao/OvsDeviceDaoImpl.java
+++ /dev/null
@@ -1,49 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-package com.cloud.network.ovs.dao;
-
-import java.util.List;
-
-import javax.ejb.Local;
-
-import org.springframework.stereotype.Component;
-
-import com.cloud.utils.db.GenericDaoBase;
-import com.cloud.utils.db.SearchBuilder;
-import com.cloud.utils.db.SearchCriteria;
-import com.cloud.utils.db.SearchCriteria.Op;
-
-@Component
-@Local(value=OvsDeviceDao.class)
-public class OvsDeviceDaoImpl extends GenericDaoBase<OvsDeviceVO, Long> implements OvsDeviceDao {
-
-	protected final SearchBuilder<OvsDeviceVO> physicalNetworkIdSearch;
-
-	public OvsDeviceDaoImpl() {
-        physicalNetworkIdSearch = createSearchBuilder();
-        physicalNetworkIdSearch.and("physicalNetworkId", physicalNetworkIdSearch.entity().getPhysicalNetworkId(), Op.EQ);
-        physicalNetworkIdSearch.done();
-    }
-
-	@Override
-	public List<OvsDeviceVO> listByPhysicalNetwork(long physicalNetworkId) {
-		SearchCriteria<OvsDeviceVO> sc = physicalNetworkIdSearch.create();
-		sc.setParameters("physicalNetworkId", physicalNetworkId);
-		return search(sc, null);
-	}
-
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a0a81831/plugins/network-elements/ovs/src/com/cloud/network/ovs/dao/OvsDeviceVO.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/ovs/src/com/cloud/network/ovs/dao/OvsDeviceVO.java b/plugins/network-elements/ovs/src/com/cloud/network/ovs/dao/OvsDeviceVO.java
deleted file mode 100644
index cab63f6..0000000
--- a/plugins/network-elements/ovs/src/com/cloud/network/ovs/dao/OvsDeviceVO.java
+++ /dev/null
@@ -1,88 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-package com.cloud.network.ovs.dao;
-
-import java.util.UUID;
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import javax.persistence.Table;
-
-import org.apache.cloudstack.api.InternalIdentity;
-
-@Entity
-@Table(name="ovs_devices")
-public class OvsDeviceVO implements InternalIdentity {
-
-    @Id
-    @GeneratedValue(strategy = GenerationType.IDENTITY)
-    @Column(name="id")
-    private long id;
-
-    @Column(name="uuid")
-    private String uuid;
-
-    @Column(name="host_id")
-    private long hostId;
-
-    @Column(name="physical_network_id")
-    private long physicalNetworkId;
-
-    @Column(name="device_name")
-    private String deviceName;
-
-
-    public OvsDeviceVO() {
-        this.uuid = UUID.randomUUID().toString();
-    }
-
-    public OvsDeviceVO(long hostId, long physicalNetworkId,
-            String deviceName) {
-        super();
-        this.hostId = hostId;
-        this.physicalNetworkId = physicalNetworkId;
-        this.deviceName = deviceName;
-        this.uuid = UUID.randomUUID().toString();
-    }
-
-    public long getId() {
-        return id;
-    }
-
-    public String getUuid() {
-        return uuid;
-    }
-
-    public void setUuid(String uuid) {
-        this.uuid = uuid;
-    }
-
-    public long getPhysicalNetworkId() {
-        return physicalNetworkId;
-    }
-
-    public long getHostId() {
-        return hostId;
-    }
-
-    public String getDeviceName() {
-        return deviceName;
-    }
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a0a81831/plugins/network-elements/ovs/src/com/cloud/network/resource/OvsResource.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/ovs/src/com/cloud/network/resource/OvsResource.java b/plugins/network-elements/ovs/src/com/cloud/network/resource/OvsResource.java
deleted file mode 100644
index a94e4f8..0000000
--- a/plugins/network-elements/ovs/src/com/cloud/network/resource/OvsResource.java
+++ /dev/null
@@ -1,175 +0,0 @@
-package com.cloud.network.resource;
-
-import java.util.Map;
-
-import javax.naming.ConfigurationException;
-
-import org.apache.log4j.Logger;
-
-import com.cloud.agent.IAgentControl;
-import com.cloud.agent.api.Answer;
-import com.cloud.agent.api.Command;
-import com.cloud.agent.api.MaintainAnswer;
-import com.cloud.agent.api.MaintainCommand;
-import com.cloud.agent.api.PingCommand;
-import com.cloud.agent.api.ReadyAnswer;
-import com.cloud.agent.api.ReadyCommand;
-import com.cloud.agent.api.StartupCommand;
-import com.cloud.host.Host;
-import com.cloud.host.Host.Type;
-import com.cloud.network.ovs.OvsApi;
-import com.cloud.network.ovs.StartupOvsCommand;
-import com.cloud.resource.ServerResource;
-import com.cloud.utils.component.ManagerBase;
-
-public class OvsResource extends ManagerBase implements ServerResource {
-	private static final Logger s_logger = Logger.getLogger(OvsResource.class);
-
-	private String _name;
-	private String _guid;
-	private String _zoneId;
-	private int _numRetries;
-
-	private OvsApi _ovsApi;
-
-	protected OvsApi createOvsApi() {
-		return new OvsApi();
-	}
-
-	@Override
-	public boolean configure(String name, Map<String, Object> params)
-			throws ConfigurationException {
-		_name = (String) params.get("name");
-		if (_name == null) {
-			throw new ConfigurationException("Unable to find name");
-		}
-
-		_guid = (String) params.get("guid");
-		if (_guid == null) {
-			throw new ConfigurationException("Unable to find the guid");
-		}
-
-		_zoneId = (String) params.get("zoneId");
-		if (_zoneId == null) {
-			throw new ConfigurationException("Unable to find zone");
-		}
-
-		_numRetries = 2;
-
-		String ip = (String) params.get("ip");
-		if (ip == null) {
-			throw new ConfigurationException("Unable to find IP");
-		}
-
-		_ovsApi = createOvsApi();
-		_ovsApi.setControllerAddress(ip);
-
-		return true;
-	}
-
-	@Override
-	public boolean start() {
-		return true;
-	}
-
-	@Override
-	public boolean stop() {
-		return true;
-	}
-
-	@Override
-	public String getName() {
-		return _name;
-	}
-
-	@Override
-	public Type getType() {
-		return Host.Type.L2Networking;
-	}
-
-	@Override
-	public StartupCommand[] initialize() {
-		StartupOvsCommand sc = new StartupOvsCommand();
-		sc.setGuid(_guid);
-		sc.setName(_name);
-		sc.setDataCenter(_zoneId);
-		sc.setPod("");
-		sc.setPrivateIpAddress("");
-		sc.setStorageIpAddress("");
-		sc.setVersion("");
-		return new StartupCommand[] { sc };
-	}
-
-	@Override
-	public PingCommand getCurrentStatus(long id) {
-		// TODO Auto-generated method stub
-		return null;
-	}
-
-	@Override
-	public Answer executeRequest(Command cmd) {
-		return executeRequest(cmd, _numRetries);
-	}
-
-	private Answer executeRequest(ReadyCommand cmd) {
-		return new ReadyAnswer(cmd);
-	}
-
-	private Answer executeRequest(MaintainCommand cmd) {
-		return new MaintainAnswer(cmd);
-	}
-
-	public Answer executeRequest(Command cmd, int numRetries) {
-		if (cmd instanceof ReadyCommand) {
-			return executeRequest((ReadyCommand) cmd);
-		} else if (cmd instanceof MaintainCommand) {
-			return executeRequest((MaintainCommand) cmd);
-		}
-		// TODO: implement services request
-		// else if (cmd instanceof CreateOvsNetworkCommand) {
-		// return executeRequest((CreateOvsNetworkCommand)cmd, numRetries);
-		// }
-		// else if (cmd instanceof DeleteOvsNetworkCommand) {
-		// return executeRequest((DeleteOvsNetworkCommand) cmd, numRetries);
-		// }
-		// else if (cmd instanceof CreateOvsPortCommand) {
-		// return executeRequest((CreateOvsPortCommand) cmd, numRetries);
-		// }
-		// else if (cmd instanceof DeleteOvsPortCommand) {
-		// return executeRequest((DeleteOvsPortCommand) cmd, numRetries);
-		// }
-		// else if (cmd instanceof UpdateOvsPortCommand) {
-		// return executeRequest((UpdateOvsPortCommand) cmd, numRetries);
-		// }
-		s_logger.debug("Received unsupported command " + cmd.toString());
-		return Answer.createUnsupportedCommandAnswer(cmd);
-	}
-
-	@Override
-	public void disconnected() {
-	}
-
-	private Answer retry(Command cmd, int numRetries) {
-		s_logger.warn("Retrying " + cmd.getClass().getSimpleName()
-				+ ". Number of retries remaining: " + numRetries);
-		return executeRequest(cmd, numRetries);
-	}
-
-	private String truncate(String string, int length) {
-		if (string.length() <= length) {
-			return string;
-		} else {
-			return string.substring(0, length);
-		}
-	}
-
-	@Override
-	public IAgentControl getAgentControl() {
-		return null;
-	}
-
-	@Override
-	public void setAgentControl(IAgentControl agentControl) {
-	}
-
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a0a81831/server/src/com/cloud/network/element/VirtualRouterElement.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/element/VirtualRouterElement.java b/server/src/com/cloud/network/element/VirtualRouterElement.java
index ecf6473..fa0d05f 100755
--- a/server/src/com/cloud/network/element/VirtualRouterElement.java
+++ b/server/src/com/cloud/network/element/VirtualRouterElement.java
@@ -32,7 +32,6 @@ import org.apache.cloudstack.api.command.admin.router.ListOvsElementsCmd;
 import org.apache.cloudstack.api.command.admin.router.ListVirtualRouterElementsCmd;
 import org.apache.log4j.Logger;
 
-import com.cloud.agent.api.PvlanSetupCommand;
 import com.cloud.agent.api.to.LoadBalancerTO;
 import com.cloud.configuration.ConfigurationManager;
 import com.cloud.configuration.dao.ConfigurationDao;
@@ -52,7 +51,6 @@ import com.cloud.network.Network.Service;
 import com.cloud.network.NetworkMigrationResponder;
 import com.cloud.network.NetworkModel;
 import com.cloud.network.Networks;
-import com.cloud.network.Networks.BroadcastDomainType;
 import com.cloud.network.Networks.TrafficType;
 import com.cloud.network.OvsProvider;
 import com.cloud.network.PhysicalNetworkServiceProvider;
@@ -91,7 +89,6 @@ import com.cloud.utils.db.SearchCriteriaService;
 import com.cloud.utils.exception.CloudRuntimeException;
 import com.cloud.vm.DomainRouterVO;
 import com.cloud.vm.NicProfile;
-import com.cloud.vm.NicVO;
 import com.cloud.vm.ReservationContext;
 import com.cloud.vm.UserVmManager;
 import com.cloud.vm.UserVmVO;
@@ -102,25 +99,13 @@ import com.cloud.vm.VirtualMachineProfile;
 import com.cloud.vm.dao.DomainRouterDao;
 import com.cloud.vm.dao.UserVmDao;
 import com.google.gson.Gson;
-import org.apache.cloudstack.api.command.admin.router.ConfigureVirtualRouterElementCmd;
-import org.apache.cloudstack.api.command.admin.router.CreateVirtualRouterElementCmd;
-import org.apache.cloudstack.api.command.admin.router.ListVirtualRouterElementsCmd;
-import org.apache.log4j.Logger;
 
-import javax.ejb.Local;
-import javax.inject.Inject;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-@Local(value = {NetworkElement.class, FirewallServiceProvider.class, 
-		        DhcpServiceProvider.class, UserDataServiceProvider.class, 
+@Local(value = {NetworkElement.class, FirewallServiceProvider.class,
+		        DhcpServiceProvider.class, UserDataServiceProvider.class,
 		        StaticNatServiceProvider.class, LoadBalancingServiceProvider.class,
 		        PortForwardingServiceProvider.class, IpDeployer.class,
 		        RemoteAccessVPNServiceProvider.class, NetworkMigrationResponder.class} )
-public class VirtualRouterElement extends AdapterBase implements VirtualRouterElementService, DhcpServiceProvider, 
+public class VirtualRouterElement extends AdapterBase implements VirtualRouterElementService, DhcpServiceProvider,
     UserDataServiceProvider, SourceNatServiceProvider, StaticNatServiceProvider, FirewallServiceProvider,
         LoadBalancingServiceProvider, PortForwardingServiceProvider, RemoteAccessVPNServiceProvider, IpDeployer,
         NetworkMigrationResponder {
@@ -185,7 +170,7 @@ public class VirtualRouterElement extends AdapterBase implements VirtualRouterEl
             }
         } else {
             if (!_networkMgr.isProviderSupportServiceInNetwork(network.getId(), service, getProvider())) {
-                s_logger.trace("Element " + getProvider().getName() + " doesn't support service " + service.getName() 
+                s_logger.trace("Element " + getProvider().getName() + " doesn't support service " + service.getName()
                         + " in the network " + network);
                 return false;
             }
@@ -206,8 +191,8 @@ public class VirtualRouterElement extends AdapterBase implements VirtualRouterEl
         Map<VirtualMachineProfile.Param, Object> params = new HashMap<VirtualMachineProfile.Param, Object>(1);
         params.put(VirtualMachineProfile.Param.ReProgramGuestNetworks, true);
 
-        List<DomainRouterVO> routers = _routerMgr.deployVirtualRouterInGuestNetwork(network, dest, 
-                _accountMgr.getAccount(network.getAccountId()), params, 
+        List<DomainRouterVO> routers = _routerMgr.deployVirtualRouterInGuestNetwork(network, dest,
+                _accountMgr.getAccount(network.getAccountId()), params,
                 offering.getRedundantRouter());
         if ((routers == null) || (routers.size() == 0)) {
             throw new ResourceUnavailableException("Can't find at least one running router!",
@@ -218,7 +203,7 @@ public class VirtualRouterElement extends AdapterBase implements VirtualRouterEl
     }
 
     @Override
-    public boolean prepare(Network network, NicProfile nic, VirtualMachineProfile<? extends VirtualMachine> vm, 
+    public boolean prepare(Network network, NicProfile nic, VirtualMachineProfile<? extends VirtualMachine> vm,
             DeployDestination dest, ReservationContext context)
             throws ConcurrentOperationException, InsufficientCapacityException, ResourceUnavailableException {
         if (vm.getType() != VirtualMachine.Type.User || vm.getHypervisorType() == HypervisorType.BareMetal) {
@@ -1047,18 +1032,18 @@ public class VirtualRouterElement extends AdapterBase implements VirtualRouterEl
 
     @Override
     public boolean verifyServicesCombination(Set<Service> services) {
-        if (!services.contains(Service.SourceNat)) {
-            if (services.contains(Service.StaticNat) || services.contains(Service.Firewall) || services.contains(Service.Lb) || 
-                    services.contains(Service.PortForwarding) || services.contains(Service.Vpn)) {
-                String servicesList = "[";
-                for (Service service : services) {
-                    servicesList += service.getName() + " ";
-                }
-                servicesList += "]";
-                s_logger.warn("Virtual router can't enable services " + servicesList + " without source NAT service");
-                return false;
-            }
-        }
+//        if (!services.contains(Service.SourceNat)) {
+//            if (services.contains(Service.StaticNat) || services.contains(Service.Firewall) || services.contains(Service.Lb) ||
+//                    services.contains(Service.PortForwarding) || services.contains(Service.Vpn)) {
+//                String servicesList = "[";
+//                for (Service service : services) {
+//                    servicesList += service.getName() + " ";
+//                }
+//                servicesList += "]";
+//                s_logger.warn("Virtual router can't enable services " + servicesList + " without source NAT service");
+//                return false;
+//            }
+//        }
         return true;
     }
 


Mime
View raw message