cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kis...@apache.org
Subject git commit: refs/heads/master - CLOUDSTACK-198: Included VpnUsers in Add state while listing. Added state to Vpn user response.
Date Tue, 19 Mar 2013 12:53:01 GMT
Updated Branches:
  refs/heads/master 0b7a4e04a -> 90678c3d1


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/90678c3d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/90678c3d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/90678c3d

Branch: refs/heads/master
Commit: 90678c3d14d31617108ed30c4c06d3f1ee65a3e4
Parents: 0b7a4e0
Author: Kishan Kavala <kishan@cloud.com>
Authored: Tue Mar 19 18:16:36 2013 +0530
Committer: Kishan Kavala <kishan@cloud.com>
Committed: Tue Mar 19 18:17:09 2013 +0530

----------------------------------------------------------------------
 .../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/90678c3d/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/90678c3d/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 ebf0fcf..663139d 100755
--- a/server/src/com/cloud/api/ApiResponseHelper.java
+++ b/server/src/com/cloud/api/ApiResponseHelper.java
@@ -1108,6 +1108,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/90678c3d/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