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/09 21:05:07 UTC

git commit: CS-15498: Fix delete s2s vpn NPE

Updated Branches:
  refs/heads/vpc a6086dc80 -> f6aea09a1


CS-15498: Fix delete s2s vpn NPE


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

Branch: refs/heads/vpc
Commit: f6aea09a16894077f1c2bc862cc4307831cf3be9
Parents: a6086dc
Author: Sheng Yang <sh...@citrix.com>
Authored: Mon Jul 9 10:35:25 2012 -0700
Committer: Sheng Yang <sh...@citrix.com>
Committed: Mon Jul 9 12:04:57 2012 -0700

----------------------------------------------------------------------
 .../cloud/api/commands/DeleteVpnConnectionCmd.java |    8 +++-----
 .../api/commands/DeleteVpnCustomerGatewayCmd.java  |    8 +++-----
 .../cloud/api/commands/DeleteVpnGatewayCmd.java    |    6 +++---
 3 files changed, 9 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/f6aea09a/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 53cc112..8b13f47 100644
--- a/api/src/com/cloud/api/commands/DeleteVpnConnectionCmd.java
+++ b/api/src/com/cloud/api/commands/DeleteVpnConnectionCmd.java
@@ -16,20 +16,19 @@ import org.apache.log4j.Logger;
 
 import com.cloud.api.ApiConstants;
 import com.cloud.api.BaseAsyncCmd;
-import com.cloud.api.BaseAsyncCreateCmd;
 import com.cloud.api.BaseCmd;
 import com.cloud.api.IdentityMapper;
 import com.cloud.api.Implementation;
 import com.cloud.api.Parameter;
 import com.cloud.api.ServerApiException;
-import com.cloud.api.response.Site2SiteVpnConnectionResponse;
+import com.cloud.api.response.SuccessResponse;
 import com.cloud.event.EventTypes;
 import com.cloud.exception.ResourceUnavailableException;
 import com.cloud.network.Site2SiteVpnConnection;
 import com.cloud.user.Account;
 import com.cloud.user.UserContext;
 
-@Implementation(description="Delete site to site vpn connection", responseObject=Site2SiteVpnConnectionResponse.class)
+@Implementation(description="Delete site to site vpn connection", responseObject=SuccessResponse.class)
 public class DeleteVpnConnectionCmd extends BaseAsyncCmd {
     public static final Logger s_logger = Logger.getLogger(DeleteVpnConnectionCmd.class.getName());
 
@@ -103,8 +102,7 @@ public class DeleteVpnConnectionCmd extends BaseAsyncCmd {
         try {
             Site2SiteVpnConnection result = _s2sVpnService.deleteVpnConnection(this);
             if (result != null) {
-                Site2SiteVpnConnectionResponse response = _responseGenerator.createSite2SiteVpnConnectionResponse(result);
-                response.setResponseName(getCommandName());
+                SuccessResponse response = new SuccessResponse(getCommandName());
                 this.setResponseObject(response);
             } else {
                 throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to delete site to site VPN connection");

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/f6aea09a/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 17528a9..a244be0 100644
--- a/api/src/com/cloud/api/commands/DeleteVpnCustomerGatewayCmd.java
+++ b/api/src/com/cloud/api/commands/DeleteVpnCustomerGatewayCmd.java
@@ -16,19 +16,18 @@ import org.apache.log4j.Logger;
 
 import com.cloud.api.ApiConstants;
 import com.cloud.api.BaseAsyncCmd;
-import com.cloud.api.BaseAsyncCreateCmd;
 import com.cloud.api.BaseCmd;
 import com.cloud.api.IdentityMapper;
 import com.cloud.api.Implementation;
 import com.cloud.api.Parameter;
 import com.cloud.api.ServerApiException;
-import com.cloud.api.response.Site2SiteCustomerGatewayResponse;
+import com.cloud.api.response.SuccessResponse;
 import com.cloud.event.EventTypes;
 import com.cloud.network.Site2SiteCustomerGateway;
 import com.cloud.user.Account;
 import com.cloud.user.UserContext;
 
-@Implementation(description="Delete site to site vpn customer gateway", responseObject=Site2SiteCustomerGatewayResponse.class)
+@Implementation(description="Delete site to site vpn customer gateway", responseObject=SuccessResponse.class)
 public class DeleteVpnCustomerGatewayCmd extends BaseAsyncCmd {
     public static final Logger s_logger = Logger.getLogger(DeleteVpnCustomerGatewayCmd.class.getName());
 
@@ -101,8 +100,7 @@ public class DeleteVpnCustomerGatewayCmd extends BaseAsyncCmd {
     public void execute(){
         Site2SiteCustomerGateway result = _s2sVpnService.deleteCustomerGateway(this);
         if (result != null) {
-            Site2SiteCustomerGatewayResponse response = _responseGenerator.createSite2SiteCustomerGatewayResponse(result);
-            response.setResponseName(getCommandName());
+            SuccessResponse response = new SuccessResponse(getCommandName());
             this.setResponseObject(response);
         } else {
             throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to delete customer VPN gateway");

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/f6aea09a/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 b856969..2c9c209 100644
--- a/api/src/com/cloud/api/commands/DeleteVpnGatewayCmd.java
+++ b/api/src/com/cloud/api/commands/DeleteVpnGatewayCmd.java
@@ -23,12 +23,13 @@ import com.cloud.api.Implementation;
 import com.cloud.api.Parameter;
 import com.cloud.api.ServerApiException;
 import com.cloud.api.response.Site2SiteVpnGatewayResponse;
+import com.cloud.api.response.SuccessResponse;
 import com.cloud.event.EventTypes;
 import com.cloud.network.Site2SiteVpnGateway;
 import com.cloud.user.Account;
 import com.cloud.user.UserContext;
 
-@Implementation(description="Delete site to site vpn gateway", responseObject=Site2SiteVpnGatewayResponse.class)
+@Implementation(description="Delete site to site vpn gateway", responseObject=SuccessResponse.class)
 public class DeleteVpnGatewayCmd extends BaseAsyncCmd {
     public static final Logger s_logger = Logger.getLogger(DeleteVpnGatewayCmd.class.getName());
 
@@ -101,8 +102,7 @@ public class DeleteVpnGatewayCmd extends BaseAsyncCmd {
     public void execute(){
         Site2SiteVpnGateway result = _s2sVpnService.deleteVpnGateway(this);
         if (result != null) {
-            Site2SiteVpnGatewayResponse response = _responseGenerator.createSite2SiteVpnGatewayResponse(result);
-            response.setResponseName(getCommandName());
+            SuccessResponse response = new SuccessResponse(getCommandName());
             this.setResponseObject(response);
         } else {
             throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to delete customer VPN gateway");