You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ya...@apache.org on 2012/07/10 23:47:57 UTC

git commit: CS-15512: Fix delete vpn connection

Updated Branches:
  refs/heads/vpc c2f9417de -> ade3ae4e3


CS-15512: Fix delete vpn connection


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

Branch: refs/heads/vpc
Commit: ade3ae4e3cc1e5d256a76c17f62f0580f90babaa
Parents: c2f9417
Author: Sheng Yang <sh...@citrix.com>
Authored: Tue Jul 10 10:57:04 2012 -0700
Committer: Sheng Yang <sh...@citrix.com>
Committed: Tue Jul 10 14:47:50 2012 -0700

----------------------------------------------------------------------
 .../cloud/api/commands/DeleteVpnConnectionCmd.java |    4 ++--
 .../api/commands/DeleteVpnCustomerGatewayCmd.java  |    4 ++--
 .../cloud/api/commands/DeleteVpnGatewayCmd.java    |    4 ++--
 .../com/cloud/network/vpn/Site2SiteVpnService.java |    6 +++---
 .../cloud/network/vpn/Site2SiteVpnManagerImpl.java |   12 ++++++------
 5 files changed, 15 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/ade3ae4e/api/src/com/cloud/api/commands/DeleteVpnConnectionCmd.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/commands/DeleteVpnConnectionCmd.java b/api/src/com/cloud/api/commands/DeleteVpnConnectionCmd.java
index 8b13f47..d08e952 100644
--- a/api/src/com/cloud/api/commands/DeleteVpnConnectionCmd.java
+++ b/api/src/com/cloud/api/commands/DeleteVpnConnectionCmd.java
@@ -100,8 +100,8 @@ public class DeleteVpnConnectionCmd extends BaseAsyncCmd {
     @Override
     public void execute(){
         try {
-            Site2SiteVpnConnection result = _s2sVpnService.deleteVpnConnection(this);
-            if (result != null) {
+            boolean result = _s2sVpnService.deleteVpnConnection(this);
+            if (result) {
                 SuccessResponse response = new SuccessResponse(getCommandName());
                 this.setResponseObject(response);
             } else {

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/ade3ae4e/api/src/com/cloud/api/commands/DeleteVpnCustomerGatewayCmd.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/commands/DeleteVpnCustomerGatewayCmd.java b/api/src/com/cloud/api/commands/DeleteVpnCustomerGatewayCmd.java
index a244be0..705e62c 100644
--- a/api/src/com/cloud/api/commands/DeleteVpnCustomerGatewayCmd.java
+++ b/api/src/com/cloud/api/commands/DeleteVpnCustomerGatewayCmd.java
@@ -98,8 +98,8 @@ public class DeleteVpnCustomerGatewayCmd extends BaseAsyncCmd {
 	
     @Override
     public void execute(){
-        Site2SiteCustomerGateway result = _s2sVpnService.deleteCustomerGateway(this);
-        if (result != null) {
+        boolean result = _s2sVpnService.deleteCustomerGateway(this);
+        if (result) {
             SuccessResponse response = new SuccessResponse(getCommandName());
             this.setResponseObject(response);
         } else {

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/ade3ae4e/api/src/com/cloud/api/commands/DeleteVpnGatewayCmd.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/commands/DeleteVpnGatewayCmd.java b/api/src/com/cloud/api/commands/DeleteVpnGatewayCmd.java
index 2c9c209..34ee1a0 100644
--- a/api/src/com/cloud/api/commands/DeleteVpnGatewayCmd.java
+++ b/api/src/com/cloud/api/commands/DeleteVpnGatewayCmd.java
@@ -100,8 +100,8 @@ public class DeleteVpnGatewayCmd extends BaseAsyncCmd {
 	
     @Override
     public void execute(){
-        Site2SiteVpnGateway result = _s2sVpnService.deleteVpnGateway(this);
-        if (result != null) {
+        boolean result = _s2sVpnService.deleteVpnGateway(this);
+        if (result) {
             SuccessResponse response = new SuccessResponse(getCommandName());
             this.setResponseObject(response);
         } else {

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/ade3ae4e/api/src/com/cloud/network/vpn/Site2SiteVpnService.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/network/vpn/Site2SiteVpnService.java b/api/src/com/cloud/network/vpn/Site2SiteVpnService.java
index f3f188d..9a97d97 100644
--- a/api/src/com/cloud/network/vpn/Site2SiteVpnService.java
+++ b/api/src/com/cloud/network/vpn/Site2SiteVpnService.java
@@ -38,9 +38,9 @@ public interface Site2SiteVpnService {
     Site2SiteVpnConnection startVpnConnection(long id) throws ResourceUnavailableException;
     IpAddress getVpnGatewayIp(Long vpnGatewayId);
     Site2SiteVpnConnection createVpnConnection(CreateVpnConnectionCmd cmd) throws NetworkRuleConflictException;
-    Site2SiteCustomerGateway deleteCustomerGateway(DeleteVpnCustomerGatewayCmd deleteVpnCustomerGatewayCmd);
-    Site2SiteVpnGateway deleteVpnGateway(DeleteVpnGatewayCmd deleteVpnGatewayCmd);
-    Site2SiteVpnConnection deleteVpnConnection(DeleteVpnConnectionCmd deleteVpnConnectionCmd) throws ResourceUnavailableException;
+    boolean deleteCustomerGateway(DeleteVpnCustomerGatewayCmd deleteVpnCustomerGatewayCmd);
+    boolean deleteVpnGateway(DeleteVpnGatewayCmd deleteVpnGatewayCmd);
+    boolean deleteVpnConnection(DeleteVpnConnectionCmd deleteVpnConnectionCmd) throws ResourceUnavailableException;
     Site2SiteVpnConnection resetVpnConnection(ResetVpnConnectionCmd resetVpnConnectionCmd) throws ResourceUnavailableException;
     List<Site2SiteCustomerGateway> searchForCustomerGateways(ListVpnCustomerGatewaysCmd listVpnCustomerGatewaysCmd);
     List<Site2SiteVpnGateway> searchForVpnGateways(ListVpnGatewaysCmd listVpnGatewaysCmd);

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/ade3ae4e/server/src/com/cloud/network/vpn/Site2SiteVpnManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/vpn/Site2SiteVpnManagerImpl.java b/server/src/com/cloud/network/vpn/Site2SiteVpnManagerImpl.java
index 6b4187e..cbae645 100644
--- a/server/src/com/cloud/network/vpn/Site2SiteVpnManagerImpl.java
+++ b/server/src/com/cloud/network/vpn/Site2SiteVpnManagerImpl.java
@@ -183,25 +183,25 @@ public class Site2SiteVpnManagerImpl implements Site2SiteVpnService, Manager {
     }
 
     @Override
-    public Site2SiteCustomerGateway deleteCustomerGateway(DeleteVpnCustomerGatewayCmd cmd) {
+    public boolean deleteCustomerGateway(DeleteVpnCustomerGatewayCmd cmd) {
         Long id = cmd.getId();
         Site2SiteCustomerGateway customerGateway = _customerGatewayDao.findById(id);
         if (customerGateway == null) {
             throw new InvalidParameterValueException("Fail to find customer gateway with " + id + " !");
         }
         _customerGatewayDao.remove(id);
-        return customerGateway;
+        return true;
     }
 
     @Override
-    public Site2SiteVpnGateway deleteVpnGateway(DeleteVpnGatewayCmd cmd) {
+    public boolean deleteVpnGateway(DeleteVpnGatewayCmd cmd) {
         Long id = cmd.getId();
         Site2SiteVpnGateway vpnGateway = _vpnGatewayDao.findById(id);
         if (vpnGateway == null) {
             throw new InvalidParameterValueException("Fail to find vpn gateway with " + id + " !");
         }
         _vpnGatewayDao.remove(id);
-        return vpnGateway;
+        return true;
     }
 
     @Override
@@ -252,7 +252,7 @@ public class Site2SiteVpnManagerImpl implements Site2SiteVpnService, Manager {
     }
 
     @Override
-    public Site2SiteVpnConnection deleteVpnConnection(DeleteVpnConnectionCmd cmd) throws ResourceUnavailableException {
+    public boolean deleteVpnConnection(DeleteVpnConnectionCmd cmd) throws ResourceUnavailableException {
         Long id = cmd.getId();
         Site2SiteVpnConnectionVO conn = _vpnConnectionDao.findById(id);
         if (conn == null) {
@@ -262,7 +262,7 @@ public class Site2SiteVpnManagerImpl implements Site2SiteVpnService, Manager {
             stopVpnConnection(id);
         }
         _vpnConnectionDao.remove(id);
-        return conn;
+        return true;
     }
 
     private void stopVpnConnection(Long id) throws ResourceUnavailableException {