cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chipchild...@apache.org
Subject git commit: refs/heads/4.1 - CLOUDSTACK-198: Included VpnUsers in Add state while listing. Added state to Vpn user response.
Date Wed, 20 Mar 2013 15:42:21 GMT
Updated Branches:
  refs/heads/4.1 df8189883 -> 65cc29734


CLOUDSTACK-198: Included VpnUsers in Add state while listing. Added state to Vpn user response.


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

Branch: refs/heads/4.1
Commit: 65cc29734acdb04606051190f60d0af93ab3a3e3
Parents: df81898
Author: Kishan Kavala <kishan@cloud.com>
Authored: Tue Mar 19 18:16:36 2013 +0530
Committer: Chip Childers <chip.childers@gmail.com>
Committed: Wed Mar 20 15:36:47 2013 +0000

----------------------------------------------------------------------
 .../cloudstack/api/response/VpnUsersResponse.java  |   10 ++++++++++
 server/src/com/cloud/api/ApiResponseHelper.java    |    1 +
 .../network/vpn/RemoteAccessVpnManagerImpl.java    |    4 ++--
 3 files changed, 13 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/65cc2973/api/src/org/apache/cloudstack/api/response/VpnUsersResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/VpnUsersResponse.java b/api/src/org/apache/cloudstack/api/response/VpnUsersResponse.java
index e654e8a..c29a37e 100644
--- a/api/src/org/apache/cloudstack/api/response/VpnUsersResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/VpnUsersResponse.java
@@ -48,6 +48,8 @@ public class VpnUsersResponse extends BaseResponse implements ControlledEntityRe
     @SerializedName(ApiConstants.PROJECT) @Param(description="the project name of the vpn")
     private String projectName;
 
+    @SerializedName(ApiConstants.STATE) @Param(description="the state of the Vpn User")
+    private String state;
 
     public void setId(String id) {
         this.id = id;
@@ -80,4 +82,12 @@ public class VpnUsersResponse extends BaseResponse implements ControlledEntityRe
         this.projectName = projectName;
     }
 
+    public String getState() {
+        return state;
+    }
+
+    public void setState(String state) {
+        this.state = state;
+    }
+
 }

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/65cc2973/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 8c97615..2e1cc55 100755
--- a/server/src/com/cloud/api/ApiResponseHelper.java
+++ b/server/src/com/cloud/api/ApiResponseHelper.java
@@ -1058,6 +1058,7 @@ public class ApiResponseHelper implements ResponseGenerator {
         VpnUsersResponse vpnResponse = new VpnUsersResponse();
         vpnResponse.setId(vpnUser.getUuid());
         vpnResponse.setUserName(vpnUser.getUsername());
+        vpnResponse.setState(vpnUser.getState().toString());
 
         populateOwner(vpnResponse, vpnUser);
 

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/65cc2973/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 82c0015..d64a021 100755
--- a/server/src/com/cloud/network/vpn/RemoteAccessVpnManagerImpl.java
+++ b/server/src/com/cloud/network/vpn/RemoteAccessVpnManagerImpl.java
@@ -511,13 +511,13 @@ public class RemoteAccessVpnManagerImpl extends ManagerBase implements
RemoteAcc
 
         sb.and("id", sb.entity().getId(), SearchCriteria.Op.EQ);
         sb.and("username", sb.entity().getUsername(), SearchCriteria.Op.EQ);
-        sb.and("state", sb.entity().getState(), SearchCriteria.Op.EQ);
+        sb.and("state", sb.entity().getState(), Op.IN);
 
         SearchCriteria<VpnUserVO> sc = sb.create();
         _accountMgr.buildACLSearchCriteria(sc, domainId, isRecursive, permittedAccounts,
listProjectResourcesCriteria);
 
         //list only active users
-        sc.setParameters("state", State.Active);
+        sc.setParameters("state", State.Active, State.Add);
 
         if (id != null) {
             sc.setParameters("id", id);


Mime
View raw message