cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alena1...@apache.org
Subject git commit: updated refs/heads/master to e2ec094
Date Fri, 21 Feb 2014 23:11:04 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/master 83bef7839 -> e2ec09472


Display flag support for VpnConnection/VpnGateway/RemoteAccessVpn


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

Branch: refs/heads/master
Commit: e2ec09472201dcb751acd02f34ce4ff32b877ede
Parents: 83bef78
Author: Alena Prokharchyk <alena.prokharchyk@citrix.com>
Authored: Fri Feb 21 14:51:22 2014 -0800
Committer: Alena Prokharchyk <alena.prokharchyk@citrix.com>
Committed: Fri Feb 21 14:51:22 2014 -0800

----------------------------------------------------------------------
 api/src/com/cloud/network/RemoteAccessVpn.java  |  2 ++
 .../cloud/network/Site2SiteVpnConnection.java   |  2 ++
 .../com/cloud/network/Site2SiteVpnGateway.java  |  5 ++++-
 .../network/vpn/RemoteAccessVpnService.java     |  4 ++--
 .../cloud/network/vpn/Site2SiteVpnService.java  |  4 ++--
 .../user/vpn/CreateRemoteAccessVpnCmd.java      | 14 ++++++++++---
 .../user/vpn/CreateVpnConnectionCmd.java        | 11 ++++++++--
 .../command/user/vpn/CreateVpnGatewayCmd.java   | 11 ++++++++--
 .../user/vpn/UpdateRemoteAccessVpnCmd.java      | 10 ++++++++-
 .../user/vpn/UpdateVpnConnectionCmd.java        | 10 ++++++++-
 .../command/user/vpn/UpdateVpnGatewayCmd.java   | 10 ++++++++-
 .../api/response/RemoteAccessVpnResponse.java   | 11 ++++++++--
 .../Site2SiteVpnConnectionResponse.java         |  9 ++++++++
 .../response/Site2SiteVpnGatewayResponse.java   | 11 ++++++++--
 .../cloud/network/dao/RemoteAccessVpnVO.java    | 12 +++++++++++
 .../network/dao/Site2SiteVpnConnectionVO.java   | 12 +++++++++++
 .../network/dao/Site2SiteVpnGatewayVO.java      | 12 +++++++++++
 server/src/com/cloud/api/ApiResponseHelper.java |  5 +++--
 .../network/vpn/RemoteAccessVpnManagerImpl.java | 11 ++++++++--
 .../network/vpn/Site2SiteVpnManagerImpl.java    | 22 ++++++++++++++++++--
 .../cloud/vpc/MockSite2SiteVpnManagerImpl.java  |  4 ++--
 setup/db/db/schema-430to440.sql                 |  4 +++-
 22 files changed, 168 insertions(+), 28 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e2ec0947/api/src/com/cloud/network/RemoteAccessVpn.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/network/RemoteAccessVpn.java b/api/src/com/cloud/network/RemoteAccessVpn.java
index d3262b7..4d7e4d4 100644
--- a/api/src/com/cloud/network/RemoteAccessVpn.java
+++ b/api/src/com/cloud/network/RemoteAccessVpn.java
@@ -38,4 +38,6 @@ public interface RemoteAccessVpn extends ControlledEntity, InternalIdentity,
Ide
     Long getVpcId();
 
     State getState();
+
+    boolean isDisplay();
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e2ec0947/api/src/com/cloud/network/Site2SiteVpnConnection.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/network/Site2SiteVpnConnection.java b/api/src/com/cloud/network/Site2SiteVpnConnection.java
index ad1a982..81e8180 100644
--- a/api/src/com/cloud/network/Site2SiteVpnConnection.java
+++ b/api/src/com/cloud/network/Site2SiteVpnConnection.java
@@ -42,4 +42,6 @@ public interface Site2SiteVpnConnection extends ControlledEntity, InternalIdenti
     public Date getRemoved();
 
     public boolean isPassive();
+
+    boolean isDisplay();
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e2ec0947/api/src/com/cloud/network/Site2SiteVpnGateway.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/network/Site2SiteVpnGateway.java b/api/src/com/cloud/network/Site2SiteVpnGateway.java
index b60db3a..bae1259 100644
--- a/api/src/com/cloud/network/Site2SiteVpnGateway.java
+++ b/api/src/com/cloud/network/Site2SiteVpnGateway.java
@@ -1,3 +1,4 @@
+
 // 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
@@ -15,17 +16,19 @@
 // specific language governing permissions and limitations
 // under the License.
 package com.cloud.network;
-
 import java.util.Date;
 
 import org.apache.cloudstack.acl.ControlledEntity;
 import org.apache.cloudstack.api.Identity;
 import org.apache.cloudstack.api.InternalIdentity;
 
+
 public interface Site2SiteVpnGateway extends ControlledEntity, Identity, InternalIdentity
{
     public long getAddrId();
 
     public long getVpcId();
 
     public Date getRemoved();
+
+    boolean isDisplay();
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e2ec0947/api/src/com/cloud/network/vpn/RemoteAccessVpnService.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/network/vpn/RemoteAccessVpnService.java b/api/src/com/cloud/network/vpn/RemoteAccessVpnService.java
index 1183211..acf007b 100644
--- a/api/src/com/cloud/network/vpn/RemoteAccessVpnService.java
+++ b/api/src/com/cloud/network/vpn/RemoteAccessVpnService.java
@@ -31,7 +31,7 @@ import com.cloud.utils.Pair;
 public interface RemoteAccessVpnService {
     static final String RemoteAccessVpnClientIpRangeCK = "remote.access.vpn.client.iprange";
 
-    RemoteAccessVpn createRemoteAccessVpn(long vpnServerAddressId, String ipRange, boolean
openFirewall) throws NetworkRuleConflictException;
+    RemoteAccessVpn createRemoteAccessVpn(long vpnServerAddressId, String ipRange, boolean
openFirewall, Boolean forDisplay) throws NetworkRuleConflictException;
 
     void destroyRemoteAccessVpnForIp(long vpnServerAddressId, Account caller) throws ResourceUnavailableException;
 
@@ -55,6 +55,6 @@ public interface RemoteAccessVpnService {
 
     RemoteAccessVpn getRemoteAccessVpnById(long vpnId);
 
-    RemoteAccessVpn updateRemoteAccessVpn(long id, String customId);
+    RemoteAccessVpn updateRemoteAccessVpn(long id, String customId, Boolean forDisplay);
 
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e2ec0947/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 7b76b3a..abdc756 100644
--- a/api/src/com/cloud/network/vpn/Site2SiteVpnService.java
+++ b/api/src/com/cloud/network/vpn/Site2SiteVpnService.java
@@ -64,7 +64,7 @@ public interface Site2SiteVpnService {
 
     Site2SiteCustomerGateway updateCustomerGateway(UpdateVpnCustomerGatewayCmd updateVpnCustomerGatewayCmd);
 
-    Site2SiteVpnConnection updateVpnConnection(long id, String customId);
+    Site2SiteVpnConnection updateVpnConnection(long id, String customId, Boolean forDisplay);
 
-    Site2SiteVpnGateway updateVpnGateway(Long id, String customId);
+    Site2SiteVpnGateway updateVpnGateway(Long id, String customId, Boolean forDisplay);
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e2ec0947/api/src/org/apache/cloudstack/api/command/user/vpn/CreateRemoteAccessVpnCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/vpn/CreateRemoteAccessVpnCmd.java
b/api/src/org/apache/cloudstack/api/command/user/vpn/CreateRemoteAccessVpnCmd.java
index 9277c49..a5e8d62 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vpn/CreateRemoteAccessVpnCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vpn/CreateRemoteAccessVpnCmd.java
@@ -16,8 +16,7 @@
 // under the License.
 package org.apache.cloudstack.api.command.user.vpn;
 
-import org.apache.log4j.Logger;
-
+import org.apache.cloudstack.acl.RoleType;
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
 import org.apache.cloudstack.api.ApiErrorCode;
@@ -28,6 +27,7 @@ import org.apache.cloudstack.api.ServerApiException;
 import org.apache.cloudstack.api.response.DomainResponse;
 import org.apache.cloudstack.api.response.IPAddressResponse;
 import org.apache.cloudstack.api.response.RemoteAccessVpnResponse;
+import org.apache.log4j.Logger;
 
 import com.cloud.event.EventTypes;
 import com.cloud.exception.InvalidParameterValueException;
@@ -74,10 +74,14 @@ public class CreateRemoteAccessVpnCmd extends BaseAsyncCreateCmd {
                description = "if true, firewall rule for source/end pubic port is automatically
created; if false - firewall rule has to be created explicitely. Has value true by default")
     private Boolean openFirewall;
 
+    @Parameter(name = ApiConstants.FOR_DISPLAY, type = CommandType.BOOLEAN, description =
"an optional field, whether to the display the vpn to the end user or not", since = "4.4",
authorized = {RoleType.Admin})
+    private Boolean display;
+
     /////////////////////////////////////////////////////
     /////////////////// Accessors ///////////////////////
     /////////////////////////////////////////////////////
 
+
     public Long getPublicIpId() {
         return publicIpId;
     }
@@ -139,7 +143,7 @@ public class CreateRemoteAccessVpnCmd extends BaseAsyncCreateCmd {
     @Override
     public void create() {
         try {
-            RemoteAccessVpn vpn = _ravService.createRemoteAccessVpn(publicIpId, ipRange,
getOpenFirewall());
+            RemoteAccessVpn vpn = _ravService.createRemoteAccessVpn(publicIpId, ipRange,
getOpenFirewall(), getDisplay());
             if (vpn != null) {
                 this.setEntityId(vpn.getServerAddressId());
                 // find uuid for server ip address
@@ -191,4 +195,8 @@ public class CreateRemoteAccessVpnCmd extends BaseAsyncCreateCmd {
         }
         return ip;
     }
+
+    public Boolean getDisplay() {
+        return display;
+    }
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e2ec0947/api/src/org/apache/cloudstack/api/command/user/vpn/CreateVpnConnectionCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/vpn/CreateVpnConnectionCmd.java
b/api/src/org/apache/cloudstack/api/command/user/vpn/CreateVpnConnectionCmd.java
index 2c2bf55..bd603e1 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vpn/CreateVpnConnectionCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vpn/CreateVpnConnectionCmd.java
@@ -16,8 +16,7 @@
 // under the License.
 package org.apache.cloudstack.api.command.user.vpn;
 
-import org.apache.log4j.Logger;
-
+import org.apache.cloudstack.acl.RoleType;
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
 import org.apache.cloudstack.api.ApiErrorCode;
@@ -28,6 +27,7 @@ import org.apache.cloudstack.api.ServerApiException;
 import org.apache.cloudstack.api.response.Site2SiteCustomerGatewayResponse;
 import org.apache.cloudstack.api.response.Site2SiteVpnConnectionResponse;
 import org.apache.cloudstack.api.response.Site2SiteVpnGatewayResponse;
+import org.apache.log4j.Logger;
 
 import com.cloud.event.EventTypes;
 import com.cloud.exception.NetworkRuleConflictException;
@@ -62,6 +62,9 @@ public class CreateVpnConnectionCmd extends BaseAsyncCreateCmd {
     @Parameter(name = ApiConstants.PASSIVE, type = CommandType.BOOLEAN, required = false,
description = "connection is passive or not")
     private Boolean passive;
 
+    @Parameter(name = ApiConstants.FOR_DISPLAY, type = CommandType.BOOLEAN, description =
"an optional field, whether to the display the vpn to the end user or not", since = "4.4",
authorized = {RoleType.Admin})
+    private Boolean display;
+
     /////////////////////////////////////////////////////
     /////////////////// Accessors ///////////////////////
     /////////////////////////////////////////////////////
@@ -81,6 +84,10 @@ public class CreateVpnConnectionCmd extends BaseAsyncCreateCmd {
         return passive;
     }
 
+    public Boolean getDisplay() {
+        return display;
+    }
+
     /////////////////////////////////////////////////////
     /////////////// API Implementation///////////////////
     /////////////////////////////////////////////////////

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e2ec0947/api/src/org/apache/cloudstack/api/command/user/vpn/CreateVpnGatewayCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/vpn/CreateVpnGatewayCmd.java b/api/src/org/apache/cloudstack/api/command/user/vpn/CreateVpnGatewayCmd.java
index 8955c8e..a48159f 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vpn/CreateVpnGatewayCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vpn/CreateVpnGatewayCmd.java
@@ -16,8 +16,7 @@
 // under the License.
 package org.apache.cloudstack.api.command.user.vpn;
 
-import org.apache.log4j.Logger;
-
+import org.apache.cloudstack.acl.RoleType;
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
 import org.apache.cloudstack.api.ApiErrorCode;
@@ -26,6 +25,7 @@ import org.apache.cloudstack.api.Parameter;
 import org.apache.cloudstack.api.ServerApiException;
 import org.apache.cloudstack.api.response.Site2SiteVpnGatewayResponse;
 import org.apache.cloudstack.api.response.VpcResponse;
+import org.apache.log4j.Logger;
 
 import com.cloud.event.EventTypes;
 import com.cloud.network.Site2SiteVpnGateway;
@@ -47,6 +47,9 @@ public class CreateVpnGatewayCmd extends BaseAsyncCmd {
                description = "public ip address id of the vpn gateway")
     private Long vpcId;
 
+    @Parameter(name = ApiConstants.FOR_DISPLAY, type = CommandType.BOOLEAN, description =
"an optional field, whether to the display the vpn to the end user or not", since = "4.4",
authorized = {RoleType.Admin})
+    private Boolean display;
+
     /////////////////////////////////////////////////////
     /////////////////// Accessors ///////////////////////
     /////////////////////////////////////////////////////
@@ -55,6 +58,10 @@ public class CreateVpnGatewayCmd extends BaseAsyncCmd {
         return vpcId;
     }
 
+    public Boolean getDisplay() {
+        return display;
+    }
+
     /////////////////////////////////////////////////////
     /////////////// API Implementation///////////////////
     /////////////////////////////////////////////////////

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e2ec0947/api/src/org/apache/cloudstack/api/command/user/vpn/UpdateRemoteAccessVpnCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/vpn/UpdateRemoteAccessVpnCmd.java
b/api/src/org/apache/cloudstack/api/command/user/vpn/UpdateRemoteAccessVpnCmd.java
index e275faf..9f552db 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vpn/UpdateRemoteAccessVpnCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vpn/UpdateRemoteAccessVpnCmd.java
@@ -16,6 +16,7 @@
 // under the License.
 package org.apache.cloudstack.api.command.user.vpn;
 
+import org.apache.cloudstack.acl.RoleType;
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
 import org.apache.cloudstack.api.BaseAsyncCustomIdCmd;
@@ -45,6 +46,9 @@ public class UpdateRemoteAccessVpnCmd extends BaseAsyncCustomIdCmd {
     @Parameter(name = ApiConstants.ACCOUNT_ID, type = CommandType.UUID, entityType = AccountResponse.class,
expose = false)
     private Long ownerId;
 
+    @Parameter(name = ApiConstants.FOR_DISPLAY, type = CommandType.BOOLEAN, description =
"an optional field, whether to the display the vpn to the end user or not", since = "4.4",
authorized = {RoleType.Admin})
+    private Boolean display;
+
     /////////////////////////////////////////////////////
     /////////////////// Accessors ///////////////////////
     /////////////////////////////////////////////////////
@@ -58,6 +62,10 @@ public class UpdateRemoteAccessVpnCmd extends BaseAsyncCustomIdCmd {
         return s_name;
     }
 
+    public Boolean getDisplay() {
+        return display;
+    }
+
     @Override
     public long getEntityOwnerId() {
         if (ownerId == null) {
@@ -86,7 +94,7 @@ public class UpdateRemoteAccessVpnCmd extends BaseAsyncCustomIdCmd {
 
     @Override
     public void execute() {
-        RemoteAccessVpn result = _ravService.updateRemoteAccessVpn(id, this.getCustomId());
+        RemoteAccessVpn result = _ravService.updateRemoteAccessVpn(id, this.getCustomId(),
getDisplay());
         RemoteAccessVpnResponse response = _responseGenerator.createRemoteAccessVpnResponse(result);
         response.setResponseName(getCommandName());
         this.setResponseObject(response);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e2ec0947/api/src/org/apache/cloudstack/api/command/user/vpn/UpdateVpnConnectionCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/vpn/UpdateVpnConnectionCmd.java
b/api/src/org/apache/cloudstack/api/command/user/vpn/UpdateVpnConnectionCmd.java
index 5fee7a2..662187c 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vpn/UpdateVpnConnectionCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vpn/UpdateVpnConnectionCmd.java
@@ -16,6 +16,7 @@
 // under the License.
 package org.apache.cloudstack.api.command.user.vpn;
 
+import org.apache.cloudstack.acl.RoleType;
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
 import org.apache.cloudstack.api.BaseAsyncCustomIdCmd;
@@ -39,12 +40,19 @@ public class UpdateVpnConnectionCmd extends BaseAsyncCustomIdCmd {
     @Parameter(name = ApiConstants.ID, type = CommandType.UUID, entityType = Site2SiteVpnConnectionResponse.class,
required = true, description = "id of vpn connection")
     private Long id;
 
+    @Parameter(name = ApiConstants.FOR_DISPLAY, type = CommandType.BOOLEAN, description =
"an optional field, whether to the display the vpn to the end user or not", since = "4.4",
authorized = {RoleType.Admin})
+    private Boolean display;
+
     /////////////////////////////////////////////////////
     /////////////////// Accessors ///////////////////////
     /////////////////////////////////////////////////////
     public Long getId() {
         return id;
     }
+
+    public Boolean getDisplay() {
+        return display;
+    }
     /////////////////////////////////////////////////////
     /////////////// API Implementation///////////////////
     /////////////////////////////////////////////////////
@@ -75,7 +83,7 @@ public class UpdateVpnConnectionCmd extends BaseAsyncCustomIdCmd {
 
     @Override
     public void execute() {
-        Site2SiteVpnConnection result = _s2sVpnService.updateVpnConnection(id, this.getCustomId());
+        Site2SiteVpnConnection result = _s2sVpnService.updateVpnConnection(id, this.getCustomId(),
getDisplay());
         Site2SiteVpnConnectionResponse response = _responseGenerator.createSite2SiteVpnConnectionResponse(result);
         response.setResponseName(getCommandName());
         setResponseObject(response);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e2ec0947/api/src/org/apache/cloudstack/api/command/user/vpn/UpdateVpnGatewayCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/vpn/UpdateVpnGatewayCmd.java b/api/src/org/apache/cloudstack/api/command/user/vpn/UpdateVpnGatewayCmd.java
index 30c56b4..eabc04a 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vpn/UpdateVpnGatewayCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vpn/UpdateVpnGatewayCmd.java
@@ -16,6 +16,7 @@
 // under the License.
 package org.apache.cloudstack.api.command.user.vpn;
 
+import org.apache.cloudstack.acl.RoleType;
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
 import org.apache.cloudstack.api.BaseAsyncCustomIdCmd;
@@ -39,6 +40,9 @@ public class UpdateVpnGatewayCmd extends BaseAsyncCustomIdCmd {
     @Parameter(name = ApiConstants.ID, type = CommandType.UUID, entityType = Site2SiteVpnGatewayResponse.class,
required = true, description = "id of customer gateway")
     private Long id;
 
+    @Parameter(name = ApiConstants.FOR_DISPLAY, type = CommandType.BOOLEAN, description =
"an optional field, whether to the display the vpn to the end user or not", since = "4.4",
authorized = {RoleType.Admin})
+    private Boolean display;
+
     /////////////////////////////////////////////////////
     /////////////////// Accessors ///////////////////////
     /////////////////////////////////////////////////////
@@ -46,6 +50,10 @@ public class UpdateVpnGatewayCmd extends BaseAsyncCustomIdCmd {
         return id;
     }
 
+    public Boolean getDisplay() {
+        return display;
+    }
+
     @Override
     public String getCommandName() {
         return s_name;
@@ -75,7 +83,7 @@ public class UpdateVpnGatewayCmd extends BaseAsyncCustomIdCmd {
     /////////////////////////////////////////////////////
     @Override
     public void execute() {
-        Site2SiteVpnGateway result = _s2sVpnService.updateVpnGateway(id, this.getCustomId());
+        Site2SiteVpnGateway result = _s2sVpnService.updateVpnGateway(id, this.getCustomId(),
getDisplay());
         Site2SiteVpnGatewayResponse response = _responseGenerator.createSite2SiteVpnGatewayResponse(result);
         response.setResponseName(getCommandName());
     }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e2ec0947/api/src/org/apache/cloudstack/api/response/RemoteAccessVpnResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/RemoteAccessVpnResponse.java b/api/src/org/apache/cloudstack/api/response/RemoteAccessVpnResponse.java
index e09bd94..28d788b 100644
--- a/api/src/org/apache/cloudstack/api/response/RemoteAccessVpnResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/RemoteAccessVpnResponse.java
@@ -16,14 +16,14 @@
 // under the License.
 package org.apache.cloudstack.api.response;
 
-import com.google.gson.annotations.SerializedName;
-
+import org.apache.cloudstack.acl.RoleType;
 import org.apache.cloudstack.api.ApiConstants;
 import org.apache.cloudstack.api.BaseResponse;
 import org.apache.cloudstack.api.EntityReference;
 
 import com.cloud.network.RemoteAccessVpn;
 import com.cloud.serializer.Param;
+import com.google.gson.annotations.SerializedName;
 
 @EntityReference(value = RemoteAccessVpn.class)
 @SuppressWarnings("unused")
@@ -73,6 +73,10 @@ public class RemoteAccessVpnResponse extends BaseResponse implements ControlledE
     @Param(description = "the id of the remote access vpn")
     private String id;
 
+    @SerializedName(ApiConstants.FOR_DISPLAY)
+    @Param(description = "is vpn for display to the regular user", since = "4.4", authorized
= {RoleType.Admin})
+    private Boolean forDisplay;
+
     public void setPublicIp(String publicIp) {
         this.publicIp = publicIp;
     }
@@ -122,4 +126,7 @@ public class RemoteAccessVpnResponse extends BaseResponse implements ControlledE
         this.id = id;
     }
 
+    public void setForDisplay(Boolean forDisplay) {
+        this.forDisplay = forDisplay;
+    }
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e2ec0947/api/src/org/apache/cloudstack/api/response/Site2SiteVpnConnectionResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/Site2SiteVpnConnectionResponse.java
b/api/src/org/apache/cloudstack/api/response/Site2SiteVpnConnectionResponse.java
index f025b52..4c57256 100644
--- a/api/src/org/apache/cloudstack/api/response/Site2SiteVpnConnectionResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/Site2SiteVpnConnectionResponse.java
@@ -18,6 +18,7 @@ package org.apache.cloudstack.api.response;
 
 import java.util.Date;
 
+import org.apache.cloudstack.acl.RoleType;
 import org.apache.cloudstack.api.ApiConstants;
 import org.apache.cloudstack.api.BaseResponse;
 import org.apache.cloudstack.api.EntityReference;
@@ -122,6 +123,10 @@ public class Site2SiteVpnConnectionResponse extends BaseResponse implements
Cont
     @Param(description = "the date and time the host was removed")
     private Date removed;
 
+    @SerializedName(ApiConstants.FOR_DISPLAY)
+    @Param(description = "is connection for display to the regular user", since = "4.4",
authorized = {RoleType.Admin})
+    private Boolean forDisplay;
+
     public void setId(String id) {
         this.id = id;
     }
@@ -211,4 +216,8 @@ public class Site2SiteVpnConnectionResponse extends BaseResponse implements
Cont
         this.domain = domainName;
     }
 
+    public void setForDisplay(Boolean forDisplay) {
+        this.forDisplay = forDisplay;
+    }
+
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e2ec0947/api/src/org/apache/cloudstack/api/response/Site2SiteVpnGatewayResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/Site2SiteVpnGatewayResponse.java b/api/src/org/apache/cloudstack/api/response/Site2SiteVpnGatewayResponse.java
index c0917c7..e7194d7 100644
--- a/api/src/org/apache/cloudstack/api/response/Site2SiteVpnGatewayResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/Site2SiteVpnGatewayResponse.java
@@ -18,14 +18,14 @@ package org.apache.cloudstack.api.response;
 
 import java.util.Date;
 
-import com.google.gson.annotations.SerializedName;
-
+import org.apache.cloudstack.acl.RoleType;
 import org.apache.cloudstack.api.ApiConstants;
 import org.apache.cloudstack.api.BaseResponse;
 import org.apache.cloudstack.api.EntityReference;
 
 import com.cloud.network.Site2SiteVpnGateway;
 import com.cloud.serializer.Param;
+import com.google.gson.annotations.SerializedName;
 
 @EntityReference(value = Site2SiteVpnGateway.class)
 @SuppressWarnings("unused")
@@ -66,6 +66,10 @@ public class Site2SiteVpnGatewayResponse extends BaseResponse implements
Control
     @Param(description = "the date and time the host was removed")
     private Date removed;
 
+    @SerializedName(ApiConstants.FOR_DISPLAY)
+    @Param(description = "is vpn gateway for display to the regular user", since = "4.4",
authorized = {RoleType.Admin})
+    private Boolean forDisplay;
+
     public void setId(String id) {
         this.id = id;
     }
@@ -107,4 +111,7 @@ public class Site2SiteVpnGatewayResponse extends BaseResponse implements
Control
         this.domain = domainName;
     }
 
+    public void setForDisplay(Boolean forDisplay) {
+        this.forDisplay = forDisplay;
+    }
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e2ec0947/engine/schema/src/com/cloud/network/dao/RemoteAccessVpnVO.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/network/dao/RemoteAccessVpnVO.java b/engine/schema/src/com/cloud/network/dao/RemoteAccessVpnVO.java
index c892949..3d416f2 100644
--- a/engine/schema/src/com/cloud/network/dao/RemoteAccessVpnVO.java
+++ b/engine/schema/src/com/cloud/network/dao/RemoteAccessVpnVO.java
@@ -65,6 +65,9 @@ public class RemoteAccessVpnVO implements RemoteAccessVpn {
     @Column(name = "vpc_id")
     private Long vpcId;
 
+    @Column(name = "display", updatable = true, nullable = false)
+    protected boolean display = true;
+
     public RemoteAccessVpnVO() {
         this.uuid = UUID.randomUUID().toString();
     }
@@ -152,4 +155,13 @@ public class RemoteAccessVpnVO implements RemoteAccessVpn {
     public void setUuid(String uuid) {
         this.uuid = uuid;
     }
+
+    public void setDisplay(boolean display) {
+        this.display = display;
+    }
+
+    @Override
+    public boolean isDisplay() {
+        return display;
+    }
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e2ec0947/engine/schema/src/com/cloud/network/dao/Site2SiteVpnConnectionVO.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/network/dao/Site2SiteVpnConnectionVO.java b/engine/schema/src/com/cloud/network/dao/Site2SiteVpnConnectionVO.java
index 7f1d0aa..beba999 100644
--- a/engine/schema/src/com/cloud/network/dao/Site2SiteVpnConnectionVO.java
+++ b/engine/schema/src/com/cloud/network/dao/Site2SiteVpnConnectionVO.java
@@ -69,6 +69,9 @@ public class Site2SiteVpnConnectionVO implements Site2SiteVpnConnection,
Interna
     @Column(name = "passive")
     private boolean passive;
 
+    @Column(name = "display", updatable = true, nullable = false)
+    protected boolean display = true;
+
     public Site2SiteVpnConnectionVO() {
     }
 
@@ -159,4 +162,13 @@ public class Site2SiteVpnConnectionVO implements Site2SiteVpnConnection,
Interna
     public void setUuid(String uuid) {
         this.uuid = uuid;
     }
+
+    public void setDisplay(boolean display) {
+        this.display = display;
+    }
+
+    @Override
+    public boolean isDisplay() {
+        return display;
+    }
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e2ec0947/engine/schema/src/com/cloud/network/dao/Site2SiteVpnGatewayVO.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/network/dao/Site2SiteVpnGatewayVO.java b/engine/schema/src/com/cloud/network/dao/Site2SiteVpnGatewayVO.java
index 5e8c6b6..226f608 100644
--- a/engine/schema/src/com/cloud/network/dao/Site2SiteVpnGatewayVO.java
+++ b/engine/schema/src/com/cloud/network/dao/Site2SiteVpnGatewayVO.java
@@ -55,6 +55,9 @@ public class Site2SiteVpnGatewayVO implements Site2SiteVpnGateway {
     @Column(name = GenericDao.REMOVED_COLUMN)
     private Date removed;
 
+    @Column(name = "display", updatable = true, nullable = false)
+    protected boolean display = true;
+
     public Site2SiteVpnGatewayVO() {
     }
 
@@ -116,4 +119,13 @@ public class Site2SiteVpnGatewayVO implements Site2SiteVpnGateway {
     public void setUuid(String uuid) {
         this.uuid = uuid;
     }
+
+    public void setDisplay(boolean display) {
+        this.display = display;
+    }
+
+    @Override
+    public boolean isDisplay() {
+        return display;
+    }
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e2ec0947/server/src/com/cloud/api/ApiResponseHelper.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/api/ApiResponseHelper.java b/server/src/com/cloud/api/ApiResponseHelper.java
index f608ae6..eb1f94a 100755
--- a/server/src/com/cloud/api/ApiResponseHelper.java
+++ b/server/src/com/cloud/api/ApiResponseHelper.java
@@ -1263,11 +1263,10 @@ public class ApiResponseHelper implements ResponseGenerator {
         }
         vpnResponse.setIpRange(vpn.getIpRange());
         vpnResponse.setPresharedKey(vpn.getIpsecPresharedKey());
-
         populateOwner(vpnResponse, vpn);
-
         vpnResponse.setState(vpn.getState().toString());
         vpnResponse.setId(vpn.getUuid());
+        vpnResponse.setForDisplay(vpn.isDisplay());
         vpnResponse.setObjectName("remoteaccessvpn");
 
         return vpnResponse;
@@ -3045,6 +3044,7 @@ public class ApiResponseHelper implements ResponseGenerator {
             response.setVpcId(vpc.getUuid());
         }
         response.setRemoved(result.getRemoved());
+        response.setForDisplay(result.isDisplay());
         response.setObjectName("vpngateway");
 
         populateAccount(response, result.getAccountId());
@@ -3114,6 +3114,7 @@ public class ApiResponseHelper implements ResponseGenerator {
         response.setState(result.getState().toString());
         response.setCreated(result.getCreated());
         response.setRemoved(result.getRemoved());
+        response.setForDisplay(result.isDisplay());
         response.setObjectName("vpnconnection");
         return response;
     }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e2ec0947/server/src/com/cloud/network/vpn/RemoteAccessVpnManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/vpn/RemoteAccessVpnManagerImpl.java b/server/src/com/cloud/network/vpn/RemoteAccessVpnManagerImpl.java
index 0b33ae3..b61e7b1 100755
--- a/server/src/com/cloud/network/vpn/RemoteAccessVpnManagerImpl.java
+++ b/server/src/com/cloud/network/vpn/RemoteAccessVpnManagerImpl.java
@@ -136,7 +136,7 @@ public class RemoteAccessVpnManagerImpl extends ManagerBase implements
RemoteAcc
 
     @Override
     @DB
-    public RemoteAccessVpn createRemoteAccessVpn(final long publicIpId, String ipRange, boolean
openFirewall) throws NetworkRuleConflictException {
+    public RemoteAccessVpn createRemoteAccessVpn(final long publicIpId, String ipRange, boolean
openFirewall, final Boolean forDisplay) throws NetworkRuleConflictException {
         CallContext ctx = CallContext.current();
         final Account caller = ctx.getCallingAccount();
 
@@ -246,6 +246,10 @@ public class RemoteAccessVpnManagerImpl extends ManagerBase implements
RemoteAcc
                 RemoteAccessVpnVO vpnVO =
                     new RemoteAccessVpnVO(ipAddr.getAccountId(), ipAddr.getDomainId(), ipAddr.getAssociatedWithNetworkId(),
publicIpId, vpcId, range[0], newIpRange,
                         sharedSecret);
+
+                if (forDisplay != null) {
+                    vpnVO.setDisplay(forDisplay);
+                }
                 return _remoteAccessVpnDao.persist(vpnVO);
             }
         });
@@ -730,7 +734,7 @@ public class RemoteAccessVpnManagerImpl extends ManagerBase implements
RemoteAcc
 
     @Override
     @ActionEvent(eventType = EventTypes.EVENT_REMOTE_ACCESS_VPN_UPDATE, eventDescription
= "updating remote access vpn", async = true)
-    public RemoteAccessVpn updateRemoteAccessVpn(long id, String customId) {
+    public RemoteAccessVpn updateRemoteAccessVpn(long id, String customId, Boolean forDisplay)
{
         final RemoteAccessVpnVO vpn = _remoteAccessVpnDao.findById(id);
         if (vpn == null) {
             throw new InvalidParameterValueException("Can't find remote access vpn by id
" + id);
@@ -740,6 +744,9 @@ public class RemoteAccessVpnManagerImpl extends ManagerBase implements
RemoteAcc
         if (customId != null) {
             vpn.setUuid(customId);
         }
+        if (forDisplay != null) {
+            vpn.setDisplay(forDisplay);
+        }
 
         _remoteAccessVpnDao.update(vpn.getId(), vpn);
         return _remoteAccessVpnDao.findById(id);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e2ec0947/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 2f6ad6c..05fec85 100644
--- a/server/src/com/cloud/network/vpn/Site2SiteVpnManagerImpl.java
+++ b/server/src/com/cloud/network/vpn/Site2SiteVpnManagerImpl.java
@@ -142,6 +142,11 @@ public class Site2SiteVpnManagerImpl extends ManagerBase implements Site2SiteVpn
         }
 
         Site2SiteVpnGatewayVO gw = new Site2SiteVpnGatewayVO(owner.getAccountId(), owner.getDomainId(),
ips.get(0).getId(), vpcId);
+
+        if (cmd.getDisplay() != null) {
+            gw.setDisplay(cmd.getDisplay());
+        }
+
         _vpnGatewayDao.persist(gw);
         return gw;
     }
@@ -299,6 +304,10 @@ public class Site2SiteVpnManagerImpl extends ManagerBase implements Site2SiteVpn
 
         Site2SiteVpnConnectionVO conn = new Site2SiteVpnConnectionVO(owner.getAccountId(),
owner.getDomainId(), vpnGatewayId, customerGatewayId, cmd.isPassive());
         conn.setState(State.Pending);
+        if (cmd.getDisplay() != null) {
+            conn.setDisplay(cmd.getDisplay());
+        }
+
         _vpnConnectionDao.persist(conn);
         return conn;
     }
@@ -785,7 +794,7 @@ public class Site2SiteVpnManagerImpl extends ManagerBase implements Site2SiteVpn
 
     @Override
     @ActionEvent(eventType = EventTypes.EVENT_S2S_VPN_CONNECTION_UPDATE, eventDescription
= "creating s2s vpn gateway", async = true)
-    public Site2SiteVpnConnection updateVpnConnection(long id, String customId) {
+    public Site2SiteVpnConnection updateVpnConnection(long id, String customId, Boolean forDisplay)
{
         Account caller = CallContext.current().getCallingAccount();
         Site2SiteVpnConnectionVO conn = _vpnConnectionDao.findById(id);
         if (conn == null) {
@@ -797,13 +806,17 @@ public class Site2SiteVpnManagerImpl extends ManagerBase implements
Site2SiteVpn
             conn.setUuid(customId);
         }
 
+        if (forDisplay != null) {
+            conn.setDisplay(forDisplay);
+        }
+
         _vpnConnectionDao.update(id, conn);
         return _vpnConnectionDao.findById(id);
     }
 
     @Override
     @ActionEvent(eventType = EventTypes.EVENT_S2S_VPN_GATEWAY_UPDATE, eventDescription =
"updating s2s vpn gateway", async = true)
-    public Site2SiteVpnGateway updateVpnGateway(Long id, String customId) {
+    public Site2SiteVpnGateway updateVpnGateway(Long id, String customId, Boolean forDisplay)
{
         Account caller = CallContext.current().getCallingAccount();
 
         Site2SiteVpnGatewayVO vpnGateway = _vpnGatewayDao.findById(id);
@@ -815,6 +828,11 @@ public class Site2SiteVpnManagerImpl extends ManagerBase implements Site2SiteVpn
         if (customId != null) {
             vpnGateway.setUuid(customId);
         }
+
+        if (forDisplay != null) {
+            vpnGateway.setDisplay(forDisplay);
+        }
+
         _vpnGatewayDao.update(id, vpnGateway);
         return _vpnGatewayDao.findById(id);
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e2ec0947/server/test/com/cloud/vpc/MockSite2SiteVpnManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/vpc/MockSite2SiteVpnManagerImpl.java b/server/test/com/cloud/vpc/MockSite2SiteVpnManagerImpl.java
index 3815ed1..b59c11a 100644
--- a/server/test/com/cloud/vpc/MockSite2SiteVpnManagerImpl.java
+++ b/server/test/com/cloud/vpc/MockSite2SiteVpnManagerImpl.java
@@ -259,13 +259,13 @@ public class MockSite2SiteVpnManagerImpl extends ManagerBase implements
Site2Sit
     }
 
     @Override
-    public Site2SiteVpnConnection updateVpnConnection(long id, String customId) {
+    public Site2SiteVpnConnection updateVpnConnection(long id, String customId, Boolean forDisplay)
{
         // TODO Auto-generated method stub
         return null;
     }
 
     @Override
-    public Site2SiteVpnGateway updateVpnGateway(Long id, String customId) {
+    public Site2SiteVpnGateway updateVpnGateway(Long id, String customId, Boolean forDisplay)
{
         // TODO Auto-generated method stub
         return null;
     }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e2ec0947/setup/db/db/schema-430to440.sql
----------------------------------------------------------------------
diff --git a/setup/db/db/schema-430to440.sql b/setup/db/db/schema-430to440.sql
index a20d0e7..116731d 100644
--- a/setup/db/db/schema-430to440.sql
+++ b/setup/db/db/schema-430to440.sql
@@ -536,6 +536,8 @@ ALTER TABLE `cloud`.`autoscale_vmgroups` ADD COLUMN `display` tinyint(1)
NOT NUL
 ALTER TABLE `cloud`.`autoscale_vmprofiles` ADD COLUMN `display` tinyint(1) NOT NULL DEFAULT
'1' COMMENT 'True if the entry can be displayed to the end user';
 ALTER TABLE `cloud`.`network_acl_item` ADD COLUMN `display` tinyint(1) NOT NULL DEFAULT '1'
COMMENT 'True if the entry can be displayed to the end user';
 ALTER TABLE `cloud`.`network_acl` ADD COLUMN `display` tinyint(1) NOT NULL DEFAULT '1' COMMENT
'True if the entry can be displayed to the end user';
-
+ALTER TABLE `cloud`.`remote_access_vpn` ADD COLUMN `display` tinyint(1) NOT NULL DEFAULT
'1' COMMENT 'True if the entry can be displayed to the end user';
+ALTER TABLE `cloud`.`s2s_vpn_connection` ADD COLUMN `display` tinyint(1) NOT NULL DEFAULT
'1' COMMENT 'True if the entry can be displayed to the end user';
+ALTER TABLE `cloud`.`s2s_vpn_gateway` ADD COLUMN `display` tinyint(1) NOT NULL DEFAULT '1'
COMMENT 'True if the entry can be displayed to the end user';
 
 


Mime
View raw message