incubator-cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mc...@apache.org
Subject [4/8] git commit: Fix ControlledEntityResponse interface to remove IdentityProxy for projectId and domainId.
Date Tue, 18 Dec 2012 20:02:49 GMT
Fix ControlledEntityResponse interface to remove IdentityProxy for
projectId and domainId.

Signed-off-by: Min Chen <min.chen@citrix.com>


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

Branch: refs/heads/api_refactoring
Commit: 3d344738b1faad2b05a97e3e0a45f70596a6469e
Parents: 57eda4e
Author: Min Chen <min.chen@citrix.com>
Authored: Mon Dec 17 23:24:08 2012 -0800
Committer: Min Chen <min.chen@citrix.com>
Committed: Mon Dec 17 23:24:08 2012 -0800

----------------------------------------------------------------------
 api/src/com/cloud/network/as/AutoScalePolicy.java  |    2 +
 .../api/command/user/user/AddVpnUserCmd.java       |   37 +++++----
 .../api/response/AutoScalePolicyResponse.java      |   21 +++---
 .../api/response/AutoScaleVmGroupResponse.java     |   13 ++--
 .../api/response/AutoScaleVmProfileResponse.java   |   12 ++--
 .../cloudstack/api/response/ConditionResponse.java |   12 ++--
 .../api/response/ControlledEntityResponse.java     |    4 +-
 .../cloudstack/api/response/IPAddressResponse.java |   12 ++--
 .../api/response/LoadBalancerResponse.java         |   13 ++--
 .../cloudstack/api/response/NetworkResponse.java   |   13 ++--
 .../api/response/PrivateGatewayResponse.java       |   12 ++--
 .../api/response/RemoteAccessVpnResponse.java      |   13 ++--
 .../api/response/ResourceCountResponse.java        |   12 ++--
 .../api/response/ResourceLimitResponse.java        |   12 ++--
 .../response/Site2SiteCustomerGatewayResponse.java |   12 ++--
 .../response/Site2SiteVpnConnectionResponse.java   |   12 ++--
 .../api/response/Site2SiteVpnGatewayResponse.java  |   12 ++--
 .../cloudstack/api/response/SnapshotResponse.java  |   17 ++--
 .../api/response/StaticRouteResponse.java          |   12 ++--
 .../cloudstack/api/response/TemplateResponse.java  |   12 ++--
 .../cloudstack/api/response/UserVmResponse.java    |   19 +----
 .../response/VirtualRouterProviderResponse.java    |    8 +-
 .../api/response/VlanIpRangeResponse.java          |   12 ++--
 .../cloudstack/api/response/VolumeResponse.java    |   13 ++--
 .../cloudstack/api/response/VpcResponse.java       |   12 ++--
 .../cloudstack/api/response/VpnUsersResponse.java  |   13 ++--
 server/src/com/cloud/api/ApiResponseHelper.java    |   22 ++++--
 .../com/cloud/api/commands/GetUsageRecordsCmd.java |   59 ++++++++-------
 .../server/api/response/UsageRecordResponse.java   |   36 +++++-----
 29 files changed, 234 insertions(+), 225 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/3d344738/api/src/com/cloud/network/as/AutoScalePolicy.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/network/as/AutoScalePolicy.java b/api/src/com/cloud/network/as/AutoScalePolicy.java
index cef198f..4ba2d15 100644
--- a/api/src/com/cloud/network/as/AutoScalePolicy.java
+++ b/api/src/com/cloud/network/as/AutoScalePolicy.java
@@ -23,6 +23,8 @@ public interface AutoScalePolicy extends ControlledEntity {
 
     long getId();
 
+    String getUuid();
+
     public int getDuration();
 
     public int getQuietTime();

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/3d344738/api/src/org/apache/cloudstack/api/command/user/user/AddVpnUserCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/user/AddVpnUserCmd.java b/api/src/org/apache/cloudstack/api/command/user/user/AddVpnUserCmd.java
index abd58b8..e8f8fc9 100644
--- a/api/src/org/apache/cloudstack/api/command/user/user/AddVpnUserCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/user/AddVpnUserCmd.java
@@ -118,23 +118,26 @@ public class AddVpnUserCmd extends BaseAsyncCreateCmd {
 
     @Override
     public void execute(){
-            VpnUser vpnUser = _entityMgr.findById(VpnUser.class, getEntityId());
-            Account account = _entityMgr.findById(Account.class, vpnUser.getAccountId());
-            if (!_ravService.applyVpnUsers(vpnUser.getAccountId(), userName)) {
-                throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to add vpn user");
-            }
-
-            VpnUsersResponse vpnResponse = new VpnUsersResponse();
-            vpnResponse.setId(vpnUser.getId());
-            vpnResponse.setUserName(vpnUser.getUsername());
-            vpnResponse.setAccountName(account.getAccountName());
-
-            vpnResponse.setDomainId(account.getDomainId());
-            vpnResponse.setDomainName(_entityMgr.findById(Domain.class, account.getDomainId()).getName());
-
-            vpnResponse.setResponseName(getCommandName());
-            vpnResponse.setObjectName("vpnuser");
-            this.setResponseObject(vpnResponse);
+        VpnUser vpnUser = _entityMgr.findById(VpnUser.class, getEntityId());
+        Account account = _entityMgr.findById(Account.class, vpnUser.getAccountId());
+        if (!_ravService.applyVpnUsers(vpnUser.getAccountId(), userName)) {
+            throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to add vpn user");
+        }
+
+        VpnUsersResponse vpnResponse = new VpnUsersResponse();
+        vpnResponse.setId(vpnUser.getId());
+        vpnResponse.setUserName(vpnUser.getUsername());
+        vpnResponse.setAccountName(account.getAccountName());
+
+        Domain domain = _entityMgr.findById(Domain.class, account.getDomainId());
+        if (domain != null) {
+            vpnResponse.setDomainId(domain.getUuid());
+            vpnResponse.setDomainName(domain.getName());
+        }
+
+        vpnResponse.setResponseName(getCommandName());
+        vpnResponse.setObjectName("vpnuser");
+        this.setResponseObject(vpnResponse);
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/3d344738/api/src/org/apache/cloudstack/api/response/AutoScalePolicyResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/AutoScalePolicyResponse.java b/api/src/org/apache/cloudstack/api/response/AutoScalePolicyResponse.java
index 681147f..b133139 100644
--- a/api/src/org/apache/cloudstack/api/response/AutoScalePolicyResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/AutoScalePolicyResponse.java
@@ -17,7 +17,6 @@
 package org.apache.cloudstack.api.response;
 
 import org.apache.cloudstack.api.ApiConstants;
-import com.cloud.utils.IdentityProxy;
 import com.cloud.serializer.Param;
 import com.google.gson.annotations.SerializedName;
 import org.apache.cloudstack.api.BaseResponse;
@@ -28,7 +27,7 @@ public class AutoScalePolicyResponse extends BaseResponse implements ControlledE
 
     @SerializedName(ApiConstants.ID)
     @Param(description = "the autoscale policy ID")
-    private IdentityProxy id = new IdentityProxy("autoscale_policies");
+    private String id;
 
     @SerializedName(ApiConstants.ACTION)
     @Param(description = "the action to be executed if all the conditions evaluate to true for the specified duration.")
@@ -50,19 +49,19 @@ public class AutoScalePolicyResponse extends BaseResponse implements ControlledE
     private String accountName;
 
     @SerializedName(ApiConstants.PROJECT_ID) @Param(description="the project id autoscale policy")
-    private IdentityProxy projectId = new IdentityProxy("projects");
+    private String projectId;
 
     @SerializedName(ApiConstants.PROJECT) @Param(description="the project name of the autoscale policy")
     private String projectName;
 
     @SerializedName(ApiConstants.DOMAIN_ID) @Param(description="the domain ID of the autoscale policy")
-    private IdentityProxy domainId = new IdentityProxy("domain");
+    private String domainId;
 
     @SerializedName(ApiConstants.DOMAIN) @Param(description="the domain name of the autoscale policy")
     private String domainName;
 
-    public void setId(Long id) {
-        this.id.setValue(id);
+    public void setId(String id) {
+        this.id = id;
     }
 
     public void setDuration(Integer duration) {
@@ -86,9 +85,11 @@ public class AutoScalePolicyResponse extends BaseResponse implements ControlledE
         this.accountName = accountName;
     }
 
+
+
     @Override
-    public void setDomainId(Long domainId) {
-        this.domainId.setValue(domainId);
+    public void setDomainId(String domainId) {
+        this.domainId = domainId;
     }
 
     @Override
@@ -97,8 +98,8 @@ public class AutoScalePolicyResponse extends BaseResponse implements ControlledE
     }
 
     @Override
-    public void setProjectId(Long projectId) {
-        this.projectId.setValue(projectId);
+    public void setProjectId(String projectId) {
+        this.projectId = projectId;
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/3d344738/api/src/org/apache/cloudstack/api/response/AutoScaleVmGroupResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/AutoScaleVmGroupResponse.java b/api/src/org/apache/cloudstack/api/response/AutoScaleVmGroupResponse.java
index 6f2a28d..a6ea46f 100644
--- a/api/src/org/apache/cloudstack/api/response/AutoScaleVmGroupResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/AutoScaleVmGroupResponse.java
@@ -66,13 +66,13 @@ public class AutoScaleVmGroupResponse extends BaseResponse implements Controlled
     private String accountName;
 
     @SerializedName(ApiConstants.PROJECT_ID) @Param(description="the project id vm profile")
-    private IdentityProxy projectId = new IdentityProxy("projects");
+    private String projectId;
 
     @SerializedName(ApiConstants.PROJECT) @Param(description="the project name of the vm profile")
     private String projectName;
 
     @SerializedName(ApiConstants.DOMAIN_ID) @Param(description="the domain ID of the vm profile")
-    private IdentityProxy domainId = new IdentityProxy("domain");
+    private String domainId;
 
     @SerializedName(ApiConstants.DOMAIN) @Param(description="the domain name of the vm profile")
     private String domainName;
@@ -122,9 +122,10 @@ public class AutoScaleVmGroupResponse extends BaseResponse implements Controlled
         this.accountName = accountName;
     }
 
+
     @Override
-    public void setDomainId(Long domainId) {
-        this.domainId.setValue(domainId);
+    public void setDomainId(String domainId) {
+        this.domainId = domainId;
     }
 
     @Override
@@ -133,8 +134,8 @@ public class AutoScaleVmGroupResponse extends BaseResponse implements Controlled
     }
 
     @Override
-    public void setProjectId(Long projectId) {
-        this.projectId.setValue(projectId);
+    public void setProjectId(String projectId) {
+        this.projectId = projectId;
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/3d344738/api/src/org/apache/cloudstack/api/response/AutoScaleVmProfileResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/AutoScaleVmProfileResponse.java b/api/src/org/apache/cloudstack/api/response/AutoScaleVmProfileResponse.java
index 7205daa..cc338bf 100644
--- a/api/src/org/apache/cloudstack/api/response/AutoScaleVmProfileResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/AutoScaleVmProfileResponse.java
@@ -75,7 +75,7 @@ public class AutoScaleVmProfileResponse extends BaseResponse implements Controll
 
     @SerializedName(ApiConstants.PROJECT_ID)
     @Param(description = "the project id vm profile")
-    private IdentityProxy projectId = new IdentityProxy("projects");
+    private String projectId;
 
     @SerializedName(ApiConstants.PROJECT)
     @Param(description = "the project name of the vm profile")
@@ -83,7 +83,7 @@ public class AutoScaleVmProfileResponse extends BaseResponse implements Controll
 
     @SerializedName(ApiConstants.DOMAIN_ID)
     @Param(description = "the domain ID of the vm profile")
-    private IdentityProxy domainId = new IdentityProxy("domain");
+    private String domainId;
 
     @SerializedName(ApiConstants.DOMAIN)
     @Param(description = "the domain name of the vm profile")
@@ -128,8 +128,8 @@ public class AutoScaleVmProfileResponse extends BaseResponse implements Controll
     }
 
     @Override
-    public void setDomainId(Long domainId) {
-        this.domainId.setValue(domainId);
+    public void setDomainId(String domainId) {
+        this.domainId = domainId;
     }
 
     @Override
@@ -138,8 +138,8 @@ public class AutoScaleVmProfileResponse extends BaseResponse implements Controll
     }
 
     @Override
-    public void setProjectId(Long projectId) {
-        this.projectId.setValue(projectId);
+    public void setProjectId(String projectId) {
+        this.projectId = projectId;
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/3d344738/api/src/org/apache/cloudstack/api/response/ConditionResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/ConditionResponse.java b/api/src/org/apache/cloudstack/api/response/ConditionResponse.java
index 144d4f3..83ff222 100644
--- a/api/src/org/apache/cloudstack/api/response/ConditionResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/ConditionResponse.java
@@ -45,7 +45,7 @@ public class ConditionResponse extends BaseResponse implements ControlledEntityR
 
     @SerializedName(ApiConstants.DOMAIN_ID)
     @Param(description = "the domain id of the Condition owner")
-    private final IdentityProxy domainId = new IdentityProxy("domain");
+    private String domainId;
 
     @SerializedName(ApiConstants.DOMAIN)
     @Param(description = "the domain name of the owner.")
@@ -57,7 +57,7 @@ public class ConditionResponse extends BaseResponse implements ControlledEntityR
 
     @SerializedName(ApiConstants.PROJECT_ID)
     @Param(description = "the project id of the Condition.")
-    private final IdentityProxy projectId = new IdentityProxy("projects");
+    private String projectId;
 
     @SerializedName(ApiConstants.PROJECT)
     @Param(description = "the project name of the Condition")
@@ -93,8 +93,8 @@ public class ConditionResponse extends BaseResponse implements ControlledEntityR
     }
 
     @Override
-    public void setProjectId(Long projectId) {
-        this.projectId.setValue(projectId);
+    public void setProjectId(String projectId) {
+        this.projectId = projectId;
     }
 
     public void setZoneId(Long zoneId) {
@@ -107,8 +107,8 @@ public class ConditionResponse extends BaseResponse implements ControlledEntityR
     }
 
     @Override
-    public void setDomainId(Long domainId) {
-        this.domainId.setValue(domainId);
+    public void setDomainId(String domainId) {
+        this.domainId = domainId;
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/3d344738/api/src/org/apache/cloudstack/api/response/ControlledEntityResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/ControlledEntityResponse.java b/api/src/org/apache/cloudstack/api/response/ControlledEntityResponse.java
index 250e432..598ef08 100644
--- a/api/src/org/apache/cloudstack/api/response/ControlledEntityResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/ControlledEntityResponse.java
@@ -20,11 +20,11 @@ public interface ControlledEntityResponse {
 
     public void setAccountName(String accountName);
 
-    public void setProjectId(Long projectId);
+    public void setProjectId(String projectId);
 
     public void setProjectName(String projectName);
 
-    public void setDomainId(Long domainId);
+    public void setDomainId(String domainId);
 
     public void setDomainName(String domainName);
 }

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/3d344738/api/src/org/apache/cloudstack/api/response/IPAddressResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/IPAddressResponse.java b/api/src/org/apache/cloudstack/api/response/IPAddressResponse.java
index 15ac72d..44dcc69 100644
--- a/api/src/org/apache/cloudstack/api/response/IPAddressResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/IPAddressResponse.java
@@ -49,13 +49,13 @@ public class IPAddressResponse extends BaseResponse implements ControlledEntityR
     private String accountName;
 
     @SerializedName(ApiConstants.PROJECT_ID) @Param(description="the project id of the ipaddress")
-    private IdentityProxy projectId = new IdentityProxy("projects");
+    private String projectId;
 
     @SerializedName(ApiConstants.PROJECT) @Param(description="the project name of the address")
     private String projectName;
 
     @SerializedName(ApiConstants.DOMAIN_ID) @Param(description="the domain ID the public IP address is associated with")
-    private IdentityProxy domainId = new IdentityProxy("domain");
+    private String domainId;
 
     @SerializedName(ApiConstants.DOMAIN) @Param(description="the domain the public IP address is associated with")
     private String domainName;
@@ -140,8 +140,8 @@ public class IPAddressResponse extends BaseResponse implements ControlledEntityR
     }
 
     @Override
-    public void setDomainId(Long domainId) {
-        this.domainId.setValue(domainId);
+    public void setDomainId(String domainId) {
+        this.domainId = domainId;
     }
 
     @Override
@@ -203,8 +203,8 @@ public class IPAddressResponse extends BaseResponse implements ControlledEntityR
     }
 
     @Override
-    public void setProjectId(Long projectId) {
-        this.projectId.setValue(projectId);
+    public void setProjectId(String projectId) {
+        this.projectId = projectId;
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/3d344738/api/src/org/apache/cloudstack/api/response/LoadBalancerResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/LoadBalancerResponse.java b/api/src/org/apache/cloudstack/api/response/LoadBalancerResponse.java
index 6e02b70..c1549b0 100644
--- a/api/src/org/apache/cloudstack/api/response/LoadBalancerResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/LoadBalancerResponse.java
@@ -66,14 +66,14 @@ public class LoadBalancerResponse extends BaseResponse implements ControlledEnti
     private String accountName;
 
     @SerializedName(ApiConstants.PROJECT_ID) @Param(description="the project id of the load balancer")
-    private IdentityProxy projectId = new IdentityProxy("projects");
+    private String projectId;
 
     @SerializedName(ApiConstants.PROJECT) @Param(description="the project name of the load balancer")
     private String projectName;
 
     @SerializedName(ApiConstants.DOMAIN_ID)
     @Param(description = "the domain ID of the load balancer rule")
-    private IdentityProxy domainId = new IdentityProxy("domain");
+    private String domainId;
 
     @SerializedName(ApiConstants.DOMAIN)
     @Param(description = "the domain of the load balancer rule")
@@ -126,8 +126,9 @@ public class LoadBalancerResponse extends BaseResponse implements ControlledEnti
         this.accountName = accountName;
     }
 
-    public void setDomainId(Long domainId) {
-        this.domainId.setValue(domainId);
+    @Override
+    public void setDomainId(String domainId) {
+        this.domainId = domainId;
     }
 
     public void setDomainName(String domainName) {
@@ -147,8 +148,8 @@ public class LoadBalancerResponse extends BaseResponse implements ControlledEnti
     }
 
     @Override
-    public void setProjectId(Long projectId) {
-        this.projectId.setValue(projectId);
+    public void setProjectId(String projectId) {
+        this.projectId = projectId;
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/3d344738/api/src/org/apache/cloudstack/api/response/NetworkResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/NetworkResponse.java b/api/src/org/apache/cloudstack/api/response/NetworkResponse.java
index 3f0af61..03fa586 100644
--- a/api/src/org/apache/cloudstack/api/response/NetworkResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/NetworkResponse.java
@@ -106,13 +106,13 @@ public class NetworkResponse extends BaseResponse implements ControlledEntityRes
     private String accountName;
 
     @SerializedName(ApiConstants.PROJECT_ID) @Param(description="the project id of the ipaddress")
-    private IdentityProxy projectId = new IdentityProxy("projects");
+    private String projectId;
 
     @SerializedName(ApiConstants.PROJECT) @Param(description="the project name of the address")
     private String projectName;
 
     @SerializedName(ApiConstants.DOMAIN_ID) @Param(description="the domain id of the network owner")
-    private IdentityProxy domainId = new IdentityProxy("domain");
+    private String domainId;
 
     @SerializedName(ApiConstants.DOMAIN) @Param(description="the domain name of the network owner")
     private String domain;
@@ -204,8 +204,9 @@ public class NetworkResponse extends BaseResponse implements ControlledEntityRes
         this.accountName = accountName;
     }
 
-    public void setDomainId(Long domainId) {
-        this.domainId.setValue(domainId);
+    @Override
+    public void setDomainId(String domainId) {
+        this.domainId = domainId;
     }
 
     public void setNetworkOfferingName(String networkOfferingName) {
@@ -249,8 +250,8 @@ public class NetworkResponse extends BaseResponse implements ControlledEntityRes
     }
 
     @Override
-    public void setProjectId(Long projectId) {
-        this.projectId.setValue(projectId);
+    public void setProjectId(String projectId) {
+        this.projectId = projectId;
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/3d344738/api/src/org/apache/cloudstack/api/response/PrivateGatewayResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/PrivateGatewayResponse.java b/api/src/org/apache/cloudstack/api/response/PrivateGatewayResponse.java
index ef2d06a..931a6de 100644
--- a/api/src/org/apache/cloudstack/api/response/PrivateGatewayResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/PrivateGatewayResponse.java
@@ -56,14 +56,14 @@ public class PrivateGatewayResponse extends BaseResponse implements ControlledEn
     private String accountName;
 
     @SerializedName(ApiConstants.PROJECT_ID) @Param(description="the project id of the private gateway")
-    private IdentityProxy projectId = new IdentityProxy("projects");
+    private String projectId;
 
     @SerializedName(ApiConstants.PROJECT) @Param(description="the project name of the private gateway")
     private String projectName;
 
     @SerializedName(ApiConstants.DOMAIN_ID)
     @Param(description = "the ID of the domain associated with the private gateway")
-    private IdentityProxy domainId = new IdentityProxy("domain");
+    private String domainId;
 
     @SerializedName(ApiConstants.DOMAIN)
     @Param(description = "the domain associated with the private gateway")
@@ -115,8 +115,8 @@ public class PrivateGatewayResponse extends BaseResponse implements ControlledEn
     }
 
     @Override
-    public void setDomainId(Long domainId) {
-        this.domainId.setValue(domainId);
+    public void setDomainId(String domainId) {
+        this.domainId = domainId;
     }
 
     @Override
@@ -125,8 +125,8 @@ public class PrivateGatewayResponse extends BaseResponse implements ControlledEn
     }
 
     @Override
-    public void setProjectId(Long projectId) {
-        this.projectId.setValue(projectId);
+    public void setProjectId(String projectId) {
+        this.projectId = projectId;
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/3d344738/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 038ba73..732e2d1 100644
--- a/api/src/org/apache/cloudstack/api/response/RemoteAccessVpnResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/RemoteAccessVpnResponse.java
@@ -41,13 +41,13 @@ public class RemoteAccessVpnResponse extends BaseResponse implements ControlledE
     private String accountName;
 
     @SerializedName(ApiConstants.PROJECT_ID) @Param(description="the project id of the vpn")
-    private IdentityProxy projectId = new IdentityProxy("projects");
+    private String projectId;
 
     @SerializedName(ApiConstants.PROJECT) @Param(description="the project name of the vpn")
     private String projectName;
 
     @SerializedName(ApiConstants.DOMAIN_ID) @Param(description="the domain id of the account of the remote access vpn")
-    private IdentityProxy domainId = new IdentityProxy("domain");
+    private String domainId;
 
     @SerializedName(ApiConstants.DOMAIN) @Param(description="the domain name of the account of the remote access vpn")
     private String domainName;
@@ -71,8 +71,9 @@ public class RemoteAccessVpnResponse extends BaseResponse implements ControlledE
         this.accountName = accountName;
     }
 
-    public void setDomainId(Long domainId) {
-        this.domainId.setValue(domainId);
+    @Override
+    public void setDomainId(String domainId) {
+        this.domainId = domainId;
     }
 
     public void setDomainName(String name) {
@@ -88,8 +89,8 @@ public class RemoteAccessVpnResponse extends BaseResponse implements ControlledE
     }
 
     @Override
-    public void setProjectId(Long projectId) {
-        this.projectId.setValue(projectId);
+    public void setProjectId(String projectId) {
+        this.projectId = projectId;
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/3d344738/api/src/org/apache/cloudstack/api/response/ResourceCountResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/ResourceCountResponse.java b/api/src/org/apache/cloudstack/api/response/ResourceCountResponse.java
index ac3ba4e..9e62f4f 100644
--- a/api/src/org/apache/cloudstack/api/response/ResourceCountResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/ResourceCountResponse.java
@@ -28,14 +28,14 @@ public class ResourceCountResponse extends BaseResponse implements ControlledEnt
     private String accountName;
 
     @SerializedName(ApiConstants.PROJECT_ID) @Param(description="the project id for which resource count's are updated")
-    private IdentityProxy projectId = new IdentityProxy("projects");
+    private String projectId;
 
     @SerializedName(ApiConstants.PROJECT) @Param(description="the project name for which resource count's are updated")
     private String projectName;
 
 
     @SerializedName(ApiConstants.DOMAIN_ID) @Param(description="the domain ID for which resource count's are updated")
-    private IdentityProxy domainId = new IdentityProxy("domain");
+    private String domainId;
 
     @SerializedName(ApiConstants.DOMAIN) @Param(description="the domain name for which resource count's are updated")
     private String domainName;
@@ -52,8 +52,8 @@ public class ResourceCountResponse extends BaseResponse implements ControlledEnt
     }
 
     @Override
-    public void setDomainId(Long domainId) {
-        this.domainId.setValue(domainId);
+    public void setDomainId(String domainId) {
+        this.domainId = domainId;
     }
 
     @Override
@@ -70,8 +70,8 @@ public class ResourceCountResponse extends BaseResponse implements ControlledEnt
     }
 
     @Override
-    public void setProjectId(Long projectId) {
-        this.projectId.setValue(projectId);
+    public void setProjectId(String projectId) {
+        this.projectId = projectId;
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/3d344738/api/src/org/apache/cloudstack/api/response/ResourceLimitResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/ResourceLimitResponse.java b/api/src/org/apache/cloudstack/api/response/ResourceLimitResponse.java
index 854ebee..d87921a 100644
--- a/api/src/org/apache/cloudstack/api/response/ResourceLimitResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/ResourceLimitResponse.java
@@ -28,7 +28,7 @@ public class ResourceLimitResponse extends BaseResponse implements ControlledEnt
     private String accountName;
 
     @SerializedName(ApiConstants.DOMAIN_ID) @Param(description="the domain ID of the resource limit")
-    private IdentityProxy domainId = new IdentityProxy("domain");
+    private String domainId;
 
     @SerializedName(ApiConstants.DOMAIN) @Param(description="the domain name of the resource limit")
     private String domainName;
@@ -40,7 +40,7 @@ public class ResourceLimitResponse extends BaseResponse implements ControlledEnt
     private Long max;
 
     @SerializedName(ApiConstants.PROJECT_ID) @Param(description="the project id of the resource limit")
-    private IdentityProxy projectId = new IdentityProxy("projects");
+    private String projectId;
 
     @SerializedName(ApiConstants.PROJECT) @Param(description="the project name of the resource limit")
     private String projectName;
@@ -56,8 +56,8 @@ public class ResourceLimitResponse extends BaseResponse implements ControlledEnt
     }
 
     @Override
-    public void setDomainId(Long domainId) {
-        this.domainId.setValue(domainId);
+    public void setDomainId(String domainId) {
+        this.domainId = domainId;
     }
 
     @Override
@@ -74,7 +74,7 @@ public class ResourceLimitResponse extends BaseResponse implements ControlledEnt
     }
 
     @Override
-    public void setProjectId(Long projectId) {
-        this.projectId.setValue(projectId);
+    public void setProjectId(String projectId) {
+        this.projectId = projectId;
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/3d344738/api/src/org/apache/cloudstack/api/response/Site2SiteCustomerGatewayResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/Site2SiteCustomerGatewayResponse.java b/api/src/org/apache/cloudstack/api/response/Site2SiteCustomerGatewayResponse.java
index 29bfeaa..10c468d 100644
--- a/api/src/org/apache/cloudstack/api/response/Site2SiteCustomerGatewayResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/Site2SiteCustomerGatewayResponse.java
@@ -63,13 +63,13 @@ public class Site2SiteCustomerGatewayResponse extends BaseResponse implements Co
     private String accountName;
 
     @SerializedName(ApiConstants.PROJECT_ID) @Param(description="the project id")
-    private IdentityProxy projectId = new IdentityProxy("projects");
+    private String projectId;
 
     @SerializedName(ApiConstants.PROJECT) @Param(description="the project name")
     private String projectName;
 
     @SerializedName(ApiConstants.DOMAIN_ID) @Param(description="the domain id of the owner")
-    private IdentityProxy domainId = new IdentityProxy("domain");
+    private String domainId;
 
     @SerializedName(ApiConstants.DOMAIN) @Param(description="the domain name of the owner")
     private String domain;
@@ -131,8 +131,8 @@ public class Site2SiteCustomerGatewayResponse extends BaseResponse implements Co
     }
 
     @Override
-    public void setProjectId(Long projectId) {
-        this.projectId.setValue(projectId);
+    public void setProjectId(String projectId) {
+        this.projectId = projectId;
     }
 
     @Override
@@ -141,8 +141,8 @@ public class Site2SiteCustomerGatewayResponse extends BaseResponse implements Co
     }
 
     @Override
-    public void setDomainId(Long domainId) {
-        this.domainId.setValue(domainId);
+    public void setDomainId(String domainId) {
+        this.domainId = domainId;
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/3d344738/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 cbddee7..4248acd 100644
--- a/api/src/org/apache/cloudstack/api/response/Site2SiteVpnConnectionResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/Site2SiteVpnConnectionResponse.java
@@ -69,13 +69,13 @@ public class Site2SiteVpnConnectionResponse extends BaseResponse implements Cont
     private String accountName;
 
     @SerializedName(ApiConstants.PROJECT_ID) @Param(description="the project id")
-    private IdentityProxy projectId = new IdentityProxy("projects");
+    private String projectId;
 
     @SerializedName(ApiConstants.PROJECT) @Param(description="the project name")
     private String projectName;
 
     @SerializedName(ApiConstants.DOMAIN_ID) @Param(description="the domain id of the owner")
-    private IdentityProxy domainId = new IdentityProxy("domain");
+    private String domainId;
 
     @SerializedName(ApiConstants.DOMAIN) @Param(description="the domain name of the owner")
     private String domain;
@@ -152,8 +152,8 @@ public class Site2SiteVpnConnectionResponse extends BaseResponse implements Cont
     }
 
     @Override
-    public void setProjectId(Long projectId) {
-        this.projectId.setValue(projectId);
+    public void setProjectId(String projectId) {
+        this.projectId = projectId;
     }
 
     @Override
@@ -162,8 +162,8 @@ public class Site2SiteVpnConnectionResponse extends BaseResponse implements Cont
     }
 
     @Override
-    public void setDomainId(Long domainId) {
-        this.domainId.setValue(domainId);
+    public void setDomainId(String domainId) {
+        this.domainId = domainId;
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/3d344738/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 5165912..c193eaf 100644
--- a/api/src/org/apache/cloudstack/api/response/Site2SiteVpnGatewayResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/Site2SiteVpnGatewayResponse.java
@@ -39,13 +39,13 @@ public class Site2SiteVpnGatewayResponse extends BaseResponse implements Control
     private String accountName;
 
     @SerializedName(ApiConstants.PROJECT_ID) @Param(description="the project id")
-    private IdentityProxy projectId = new IdentityProxy("projects");
+    private String projectId;
 
     @SerializedName(ApiConstants.PROJECT) @Param(description="the project name")
     private String projectName;
 
     @SerializedName(ApiConstants.DOMAIN_ID) @Param(description="the domain id of the owner")
-    private IdentityProxy domainId = new IdentityProxy("domain");
+    private String domainId;
 
     @SerializedName(ApiConstants.DOMAIN) @Param(description="the domain name of the owner")
     private String domain;
@@ -75,8 +75,8 @@ public class Site2SiteVpnGatewayResponse extends BaseResponse implements Control
     }
 
     @Override
-    public void setProjectId(Long projectId) {
-        this.projectId.setValue(projectId);
+    public void setProjectId(String projectId) {
+        this.projectId = projectId;
     }
 
     @Override
@@ -85,8 +85,8 @@ public class Site2SiteVpnGatewayResponse extends BaseResponse implements Control
     }
 
     @Override
-    public void setDomainId(Long domainId) {
-        this.domainId.setValue(domainId);
+    public void setDomainId(String domainId) {
+        this.domainId = domainId;
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/3d344738/api/src/org/apache/cloudstack/api/response/SnapshotResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/SnapshotResponse.java b/api/src/org/apache/cloudstack/api/response/SnapshotResponse.java
index 05b178b..fff421c 100644
--- a/api/src/org/apache/cloudstack/api/response/SnapshotResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/SnapshotResponse.java
@@ -38,14 +38,14 @@ public class SnapshotResponse extends BaseResponse implements ControlledEntityRe
 
     @SerializedName(ApiConstants.DOMAIN_ID)
     @Param(description = "the domain ID of the snapshot's account")
-    private IdentityProxy domainId = new IdentityProxy("domain");
+    private String domainId;
 
     @SerializedName(ApiConstants.DOMAIN)
     @Param(description = "the domain name of the snapshot's account")
     private String domainName;
 
     @SerializedName(ApiConstants.PROJECT_ID) @Param(description="the project id of the snapshot")
-    private IdentityProxy projectId = new IdentityProxy("projects");
+    private String projectId;
 
     @SerializedName(ApiConstants.PROJECT) @Param(description="the project name of the snapshot")
     private String projectName;
@@ -106,12 +106,13 @@ public class SnapshotResponse extends BaseResponse implements ControlledEntityRe
         this.accountName = accountName;
     }
 
-    public Long getDomainId() {
-        return domainId.getValue();
+    public String getDomainId() {
+        return domainId;
     }
 
-    public void setDomainId(Long domainId) {
-        this.domainId.setValue(domainId);
+    @Override
+    public void setDomainId(String domainId) {
+        this.domainId = domainId;
     }
 
     public void setDomainName(String domainName) {
@@ -151,8 +152,8 @@ public class SnapshotResponse extends BaseResponse implements ControlledEntityRe
     }
 
     @Override
-    public void setProjectId(Long projectId) {
-        this.projectId.setValue(projectId);
+    public void setProjectId(String projectId) {
+        this.projectId = projectId;
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/3d344738/api/src/org/apache/cloudstack/api/response/StaticRouteResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/StaticRouteResponse.java b/api/src/org/apache/cloudstack/api/response/StaticRouteResponse.java
index d610380..5cf4adf 100644
--- a/api/src/org/apache/cloudstack/api/response/StaticRouteResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/StaticRouteResponse.java
@@ -46,14 +46,14 @@ public class StaticRouteResponse extends BaseResponse implements ControlledEntit
     private String accountName;
 
     @SerializedName(ApiConstants.PROJECT_ID) @Param(description="the project id of the static route")
-    private IdentityProxy projectId = new IdentityProxy("projects");
+    private String projectId;
 
     @SerializedName(ApiConstants.PROJECT) @Param(description="the project name of the static route")
     private String projectName;
 
     @SerializedName(ApiConstants.DOMAIN_ID)
     @Param(description = "the ID of the domain associated with the static route")
-    private IdentityProxy domainId = new IdentityProxy("domain");
+    private String domainId;
 
     @SerializedName(ApiConstants.DOMAIN)
     @Param(description = "the domain associated with the static route")
@@ -89,8 +89,8 @@ public class StaticRouteResponse extends BaseResponse implements ControlledEntit
     }
 
     @Override
-    public void setDomainId(Long domainId) {
-        this.domainId.setValue(domainId);
+    public void setDomainId(String domainId) {
+        this.domainId = domainId;
     }
 
     @Override
@@ -99,8 +99,8 @@ public class StaticRouteResponse extends BaseResponse implements ControlledEntit
     }
 
     @Override
-    public void setProjectId(Long projectId) {
-        this.projectId.setValue(projectId);
+    public void setProjectId(String projectId) {
+        this.projectId = projectId;
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/3d344738/api/src/org/apache/cloudstack/api/response/TemplateResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/TemplateResponse.java b/api/src/org/apache/cloudstack/api/response/TemplateResponse.java
index 2cea0f6..0683b43 100644
--- a/api/src/org/apache/cloudstack/api/response/TemplateResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/TemplateResponse.java
@@ -101,7 +101,7 @@ public class TemplateResponse extends BaseResponse implements ControlledEntityRe
     private String domainName;
 
     @SerializedName(ApiConstants.DOMAIN_ID) @Param(description="the ID of the domain to which the template belongs")
-    private IdentityProxy domainId = new IdentityProxy("domain");
+    private String domainId;
 
     @SerializedName(ApiConstants.IS_EXTRACTABLE) @Param(description="true if the template is extractable, false otherwise")
     private Boolean extractable;
@@ -122,7 +122,7 @@ public class TemplateResponse extends BaseResponse implements ControlledEntityRe
     private String templateTag;
 
     @SerializedName(ApiConstants.PROJECT_ID) @Param(description="the project id of the template")
-    private IdentityProxy projectId = new IdentityProxy("projects");
+    private String projectId;
 
     @SerializedName(ApiConstants.PROJECT) @Param(description="the project name of the template")
     private String projectName;
@@ -237,8 +237,8 @@ public class TemplateResponse extends BaseResponse implements ControlledEntityRe
     }
 
     @Override
-    public void setDomainId(Long domainId) {
-        this.domainId.setValue(domainId);
+    public void setDomainId(String domainId) {
+        this.domainId = domainId;
     }
 
     public void setExtractable(Boolean extractable) {
@@ -266,8 +266,8 @@ public class TemplateResponse extends BaseResponse implements ControlledEntityRe
     }
 
     @Override
-    public void setProjectId(Long projectId) {
-        this.projectId.setValue(projectId);
+    public void setProjectId(String projectId) {
+        this.projectId = projectId;
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/3d344738/api/src/org/apache/cloudstack/api/response/UserVmResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/UserVmResponse.java b/api/src/org/apache/cloudstack/api/response/UserVmResponse.java
index 4934d8b..bea841f 100644
--- a/api/src/org/apache/cloudstack/api/response/UserVmResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/UserVmResponse.java
@@ -200,6 +200,7 @@ public class UserVmResponse extends BaseResponse implements ControlledEntityResp
         this.accountName = accountName;
     }
 
+    @Override
     public void setDomainId(String domainId) {
         this.domainId = domainId;
     }
@@ -340,6 +341,7 @@ public class UserVmResponse extends BaseResponse implements ControlledEntityResp
         this.securityGroupList.add(securityGroup);
     }
 
+    @Override
     public void setProjectId(String projectId) {
         this.projectId = projectId;
     }
@@ -373,21 +375,4 @@ public class UserVmResponse extends BaseResponse implements ControlledEntityResp
         this.keyPairName = keyPairName;
     }
 
-    @Override
-    public void setProjectId(Long projectId) {
-        // TODO: remove this later
-    }
-
-    @Override
-    public void setDomainId(Long domainId) {
-        // TODO: remove this later
-    }
-
-    public void setProjectUuid(String projectUuid){
-        this.projectId = projectUuid;
-    }
-
-    public void setDomainUuid(String domainUuid){
-        this.domainId = domainUuid;
-    }
 }

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/3d344738/api/src/org/apache/cloudstack/api/response/VirtualRouterProviderResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/VirtualRouterProviderResponse.java b/api/src/org/apache/cloudstack/api/response/VirtualRouterProviderResponse.java
index 85e7f11..f4d7988 100644
--- a/api/src/org/apache/cloudstack/api/response/VirtualRouterProviderResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/VirtualRouterProviderResponse.java
@@ -36,13 +36,13 @@ public class VirtualRouterProviderResponse extends BaseResponse implements Contr
     private String accountName;
 
     @SerializedName(ApiConstants.PROJECT_ID) @Param(description="the project id of the ipaddress")
-    private Long projectId;
+    private String projectId;
 
     @SerializedName(ApiConstants.PROJECT) @Param(description="the project name of the address")
     private String projectName;
 
     @SerializedName(ApiConstants.DOMAIN_ID) @Param(description="the domain ID associated with the provider")
-    private Long domainId;
+    private String domainId;
 
     @SerializedName(ApiConstants.DOMAIN) @Param(description="the domain associated with the provider")
     private String domainName;
@@ -57,7 +57,7 @@ public class VirtualRouterProviderResponse extends BaseResponse implements Contr
     }
 
     @Override
-    public void setDomainId(Long domainId) {
+    public void setDomainId(String domainId) {
         this.domainId = domainId;
     }
 
@@ -67,7 +67,7 @@ public class VirtualRouterProviderResponse extends BaseResponse implements Contr
     }
 
     @Override
-    public void setProjectId(Long projectId) {
+    public void setProjectId(String projectId) {
         this.projectId = projectId;
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/3d344738/api/src/org/apache/cloudstack/api/response/VlanIpRangeResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/VlanIpRangeResponse.java b/api/src/org/apache/cloudstack/api/response/VlanIpRangeResponse.java
index 4993cc3..aef0dcc 100644
--- a/api/src/org/apache/cloudstack/api/response/VlanIpRangeResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/VlanIpRangeResponse.java
@@ -40,7 +40,7 @@ public class VlanIpRangeResponse extends BaseResponse implements ControlledEntit
     private String accountName;
 
     @SerializedName(ApiConstants.DOMAIN_ID) @Param(description="the domain ID of the VLAN IP range")
-    private IdentityProxy domainId = new IdentityProxy("domain");
+    private String domainId;
 
     @SerializedName(ApiConstants.DOMAIN) @Param(description="the domain name of the VLAN IP range")
     private String domainName;
@@ -70,7 +70,7 @@ public class VlanIpRangeResponse extends BaseResponse implements ControlledEntit
     private IdentityProxy networkId = new IdentityProxy("networks");
 
     @SerializedName(ApiConstants.PROJECT_ID) @Param(description="the project id of the vlan range")
-    private IdentityProxy projectId = new IdentityProxy("projects");
+    private String projectId;
 
     @SerializedName(ApiConstants.PROJECT) @Param(description="the project name of the vlan range")
     private String projectName;
@@ -98,8 +98,8 @@ public class VlanIpRangeResponse extends BaseResponse implements ControlledEntit
         this.accountName = accountName;
     }
 
-    public void setDomainId(Long domainId) {
-        this.domainId.setValue(domainId);
+    public void setDomainId(String domainId) {
+        this.domainId = domainId;
     }
 
     public void setDomainName(String domainName) {
@@ -139,8 +139,8 @@ public class VlanIpRangeResponse extends BaseResponse implements ControlledEntit
     }
 
     @Override
-    public void setProjectId(Long projectId) {
-        this.projectId.setValue(projectId);
+    public void setProjectId(String projectId) {
+        this.projectId = projectId;
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/3d344738/api/src/org/apache/cloudstack/api/response/VolumeResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/VolumeResponse.java b/api/src/org/apache/cloudstack/api/response/VolumeResponse.java
index 8085e69..c1adc02 100644
--- a/api/src/org/apache/cloudstack/api/response/VolumeResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/VolumeResponse.java
@@ -84,14 +84,14 @@ public class VolumeResponse extends BaseResponse implements ControlledEntityResp
     private String accountName;
 
     @SerializedName(ApiConstants.PROJECT_ID) @Param(description="the project id of the vpn")
-    private IdentityProxy projectId = new IdentityProxy("projects");
+    private String projectId;
 
     @SerializedName(ApiConstants.PROJECT) @Param(description="the project name of the vpn")
     private String projectName;
 
     @SerializedName(ApiConstants.DOMAIN_ID)
     @Param(description = "the ID of the domain associated with the disk volume")
-    private IdentityProxy domainId = new IdentityProxy("domain");
+    private String domainId;
 
     @SerializedName(ApiConstants.DOMAIN)
     @Param(description = "the domain associated with the disk volume")
@@ -225,8 +225,9 @@ public class VolumeResponse extends BaseResponse implements ControlledEntityResp
         this.accountName = accountName;
     }
 
-    public void setDomainId(Long domainId) {
-        this.domainId.setValue(domainId);
+    @Override
+    public void setDomainId(String domainId) {
+        this.domainId = domainId;
     }
 
     public void setDomainName(String domainName) {
@@ -290,8 +291,8 @@ public class VolumeResponse extends BaseResponse implements ControlledEntityResp
     }
 
     @Override
-    public void setProjectId(Long projectId) {
-        this.projectId.setValue(projectId);
+    public void setProjectId(String projectId) {
+        this.projectId = projectId;
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/3d344738/api/src/org/apache/cloudstack/api/response/VpcResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/VpcResponse.java b/api/src/org/apache/cloudstack/api/response/VpcResponse.java
index 0c5f02a..d23337f 100644
--- a/api/src/org/apache/cloudstack/api/response/VpcResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/VpcResponse.java
@@ -61,13 +61,13 @@ public class VpcResponse extends BaseResponse implements ControlledEntityRespons
     private String accountName;
 
     @SerializedName(ApiConstants.PROJECT_ID) @Param(description="the project id of the VPC")
-    private IdentityProxy projectId = new IdentityProxy("projects");
+    private String projectId;
 
     @SerializedName(ApiConstants.PROJECT) @Param(description="the project name of the VPC")
     private String projectName;
 
     @SerializedName(ApiConstants.DOMAIN_ID) @Param(description="the domain id of the VPC owner")
-    private IdentityProxy domainId = new IdentityProxy("domain");
+    private String domainId;
 
     @SerializedName(ApiConstants.DOMAIN) @Param(description="the domain name of the owner")
     private String domain;
@@ -114,8 +114,8 @@ public class VpcResponse extends BaseResponse implements ControlledEntityRespons
     }
 
     @Override
-    public void setProjectId(Long projectId) {
-        this.projectId.setValue(projectId);
+    public void setProjectId(String projectId) {
+        this.projectId = projectId;
     }
 
     @Override
@@ -124,8 +124,8 @@ public class VpcResponse extends BaseResponse implements ControlledEntityRespons
     }
 
     @Override
-    public void setDomainId(Long domainId) {
-        this.domainId.setValue(domainId);
+    public void setDomainId(String domainId) {
+        this.domainId = domainId;
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/3d344738/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 d1f45de..eace392 100644
--- a/api/src/org/apache/cloudstack/api/response/VpnUsersResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/VpnUsersResponse.java
@@ -34,13 +34,13 @@ public class VpnUsersResponse extends BaseResponse implements ControlledEntityRe
     private String accountName;
 
     @SerializedName(ApiConstants.DOMAIN_ID) @Param(description="the domain id of the account of the remote access vpn")
-    private IdentityProxy domainId = new IdentityProxy("domain");
+    private String domainId;
 
     @SerializedName(ApiConstants.DOMAIN) @Param(description="the domain name of the account of the remote access vpn")
     private String domainName;
 
     @SerializedName(ApiConstants.PROJECT_ID) @Param(description="the project id of the vpn")
-    private IdentityProxy projectId = new IdentityProxy("projects");
+    private String projectId;
 
     @SerializedName(ApiConstants.PROJECT) @Param(description="the project name of the vpn")
     private String projectName;
@@ -58,8 +58,9 @@ public class VpnUsersResponse extends BaseResponse implements ControlledEntityRe
         this.accountName = accountName;
     }
 
-    public void setDomainId(Long domainId) {
-        this.domainId.setValue(domainId);
+    @Override
+    public void setDomainId(String domainId) {
+        this.domainId = domainId;
     }
 
     public void setDomainName(String name) {
@@ -67,8 +68,8 @@ public class VpnUsersResponse extends BaseResponse implements ControlledEntityRe
     }
 
     @Override
-    public void setProjectId(Long projectId) {
-        this.projectId.setValue(projectId);
+    public void setProjectId(String projectId) {
+        this.projectId = projectId;
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/3d344738/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 0eeb8ca..f9b908c 100755
--- a/server/src/com/cloud/api/ApiResponseHelper.java
+++ b/server/src/com/cloud/api/ApiResponseHelper.java
@@ -1519,7 +1519,6 @@ public class ApiResponseHelper implements ResponseGenerator {
         vpnResponse.setPublicIp(ApiDBUtils.findIpAddressById(vpn.getServerAddressId()).getAddress().addr());
         vpnResponse.setIpRange(vpn.getIpRange());
         vpnResponse.setPresharedKey(vpn.getIpsecPresharedKey());
-        vpnResponse.setDomainId(vpn.getDomainId());
 
         populateOwner(vpnResponse, vpn);
 
@@ -2699,14 +2698,21 @@ public class ApiResponseHelper implements ResponseGenerator {
         } else {
             // get domain from network_domain table
             Pair<Long, Boolean> domainNetworkDetails = ApiDBUtils.getDomainNetworkDetails(network.getId());
-            response.setDomainId(domainNetworkDetails.first());
+            if (domainNetworkDetails.first() != null) {
+                Domain domain = ApiDBUtils.findDomainById(domainNetworkDetails.first());
+                if (domain != null) {
+                    response.setDomainId(domain.getUuid());
+                }
+            }
             response.setSubdomainAccess(domainNetworkDetails.second());
         }
 
         Long dedicatedDomainId = ApiDBUtils.getDedicatedNetworkDomain(network.getId());
         if (dedicatedDomainId != null) {
             Domain domain = ApiDBUtils.findDomainById(dedicatedDomainId);
-            response.setDomainId(dedicatedDomainId);
+            if (domain != null) {
+                response.setDomainId(domain.getUuid());
+            }
             response.setDomainName(domain.getName());
         }
 
@@ -2854,14 +2860,14 @@ public class ApiResponseHelper implements ResponseGenerator {
         if (account.getType() == Account.ACCOUNT_TYPE_PROJECT) {
             // find the project
             Project project = ApiDBUtils.findProjectByProjectAccountIdIncludingRemoved(account.getId());
-            response.setProjectId(project.getId());
+            response.setProjectId(project.getUuid());
             response.setProjectName(project.getName());
         } else {
             response.setAccountName(account.getAccountName());
         }
 
         Domain domain = ApiDBUtils.findDomainById(object.getDomainId());
-        response.setDomainId(domain.getId());
+        response.setDomainId(domain.getUuid());
         response.setDomainName(domain.getName());
     }
 
@@ -2883,7 +2889,7 @@ public class ApiResponseHelper implements ResponseGenerator {
         if (account.getType() == Account.ACCOUNT_TYPE_PROJECT) {
             // find the project
             Project project = ApiDBUtils.findProjectByProjectAccountIdIncludingRemoved(account.getId());
-            response.setProjectId(project.getId());
+            response.setProjectId(project.getUuid());
             response.setProjectName(project.getName());
         } else {
             response.setAccountName(account.getAccountName());
@@ -2893,7 +2899,7 @@ public class ApiResponseHelper implements ResponseGenerator {
     private void populateDomain(ControlledEntityResponse response, long domainId) {
         Domain domain = ApiDBUtils.findDomainById(domainId);
 
-        response.setDomainId(domain.getId());
+        response.setDomainId(domain.getUuid());
         response.setDomainName(domain.getName());
     }
 
@@ -3319,7 +3325,7 @@ public class ApiResponseHelper implements ResponseGenerator {
     @Override
     public AutoScalePolicyResponse createAutoScalePolicyResponse(AutoScalePolicy policy) {
         AutoScalePolicyResponse response = new AutoScalePolicyResponse();
-        response.setId(policy.getId());
+        response.setId(policy.getUuid());
         response.setDuration(policy.getDuration());
         response.setQuietTime(policy.getQuietTime());
         response.setAction(policy.getAction());

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/3d344738/server/src/com/cloud/api/commands/GetUsageRecordsCmd.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/api/commands/GetUsageRecordsCmd.java b/server/src/com/cloud/api/commands/GetUsageRecordsCmd.java
index 9f1e21a..6d67e05 100644
--- a/server/src/com/cloud/api/commands/GetUsageRecordsCmd.java
+++ b/server/src/com/cloud/api/commands/GetUsageRecordsCmd.java
@@ -27,6 +27,8 @@ import org.apache.log4j.Logger;
 
 import org.apache.cloudstack.api.ApiConstants;
 import com.cloud.api.ApiDBUtils;
+import com.cloud.domain.Domain;
+
 import org.apache.cloudstack.api.BaseListCmd;
 import org.apache.cloudstack.api.IdentityMapper;
 import org.apache.cloudstack.api.Implementation;
@@ -63,15 +65,15 @@ public class GetUsageRecordsCmd extends BaseListCmd {
 
     @Parameter(name=ApiConstants.START_DATE, type=CommandType.DATE, required=true, description="Start date range for usage record query. Use yyyy-MM-dd as the date format, e.g. startDate=2009-06-01.")
     private Date startDate;
-    
+
     @IdentityMapper(entityTableName="account")
     @Parameter(name=ApiConstants.ACCOUNT_ID, type=CommandType.LONG, description="List usage records for the specified account")
     private Long accountId;
-    
+
     @IdentityMapper(entityTableName="projects")
     @Parameter(name=ApiConstants.PROJECT_ID, type=CommandType.LONG, description="List usage records for specified project")
     private Long projectId;
-    
+
     @Parameter(name=ApiConstants.TYPE, type=CommandType.LONG, description="List usage records for the specified usage type")
     private Long usageType;
 
@@ -94,7 +96,7 @@ public class GetUsageRecordsCmd extends BaseListCmd {
     public Date getStartDate() {
         return startDate;
     }
-    
+
     public Long getAccountId() {
         return accountId;
     }
@@ -102,11 +104,11 @@ public class GetUsageRecordsCmd extends BaseListCmd {
     public Long getUsageType() {
         return usageType;
     }
-    
+
     public Long getProjectId() {
         return projectId;
     }
-    
+
     /////////////////////////////////////////////////////
     ///////////////  Misc parameters  ///////////////////
     /////////////////////////////////////////////////////
@@ -162,7 +164,7 @@ public class GetUsageRecordsCmd extends BaseListCmd {
         } else {
             sb.append(hour+":");
         }
-        
+
         int minute = cal.get(Calendar.MINUTE);
         if (minute < 10) {
             sb.append("0" + minute + ":");
@@ -213,7 +215,7 @@ public class GetUsageRecordsCmd extends BaseListCmd {
 
         return sb.toString();
     }
-    
+
     @Override
     public void execute(){
         ManagementServerExt _mgrExt = (ManagementServerExt)_mgr;
@@ -225,20 +227,23 @@ public class GetUsageRecordsCmd extends BaseListCmd {
             UsageRecordResponse usageRecResponse = new UsageRecordResponse();
             if (usageRecordGeneric instanceof UsageVO) {
                 UsageVO usageRecord = (UsageVO)usageRecordGeneric;
-      
-                Account account = ApiDBUtils.findAccountByIdIncludingRemoved(usageRecord.getAccountId()); 
+
+                Account account = ApiDBUtils.findAccountByIdIncludingRemoved(usageRecord.getAccountId());
                 if (account.getType() == Account.ACCOUNT_TYPE_PROJECT) {
                     //find the project
                     Project project = ApiDBUtils.findProjectByProjectAccountId(account.getId());
-                    usageRecResponse.setProjectId(project.getId());
+                    usageRecResponse.setProjectId(project.getUuid());
                     usageRecResponse.setProjectName(project.getName());
                 } else {
                     usageRecResponse.setAccountId(account.getId());
                     usageRecResponse.setAccountName(account.getAccountName());
                 }
-             
-                usageRecResponse.setDomainId(usageRecord.getDomainId());
-                
+
+                Domain domain = ApiDBUtils.findDomainById(usageRecord.getDomainId());
+                if (domain != null) {
+                    usageRecResponse.setDomainId(domain.getUuid());
+                }
+
                 usageRecResponse.setZoneId(usageRecord.getZoneId());
                 usageRecResponse.setDescription(usageRecord.getDescription());
                 usageRecResponse.setUsage(usageRecord.getUsageDisplay());
@@ -246,7 +251,7 @@ public class GetUsageRecordsCmd extends BaseListCmd {
                 usageRecResponse.setVirtualMachineId(usageRecord.getVmInstanceId());
                 usageRecResponse.setVmName(usageRecord.getVmName());
                 usageRecResponse.setTemplateId(usageRecord.getTemplateId());
-                
+
                 if(usageRecord.getUsageType() == UsageTypes.RUNNING_VM || usageRecord.getUsageType() == UsageTypes.ALLOCATED_VM){
                 	//Service Offering Id
                 	usageRecResponse.setOfferingId(identityDao.getIdentityUuid("disk_offering", usageRecord.getOfferingId().toString()));
@@ -254,7 +259,7 @@ public class GetUsageRecordsCmd extends BaseListCmd {
                 	usageRecResponse.setUsageId(identityDao.getIdentityUuid("vm_instance", usageRecord.getUsageId().toString()));
                 	//Hypervisor Type
                 	usageRecResponse.setType(usageRecord.getType());
-                	
+
                 } else if(usageRecord.getUsageType() == UsageTypes.IP_ADDRESS){
                 	//isSourceNAT
                     usageRecResponse.setSourceNat((usageRecord.getType().equals("SourceNat"))?true:false);
@@ -262,7 +267,7 @@ public class GetUsageRecordsCmd extends BaseListCmd {
                     usageRecResponse.setSystem((usageRecord.getSize() == 1)?true:false);
                     //IP Address ID
                     usageRecResponse.setUsageId(identityDao.getIdentityUuid("user_ip_address", usageRecord.getUsageId().toString()));
-                    
+
                 } else if(usageRecord.getUsageType() == UsageTypes.NETWORK_BYTES_SENT || usageRecord.getUsageType() == UsageTypes.NETWORK_BYTES_RECEIVED){
                 	//Device Type
                 	usageRecResponse.setType(usageRecord.getType());
@@ -271,11 +276,11 @@ public class GetUsageRecordsCmd extends BaseListCmd {
                         usageRecResponse.setUsageId(identityDao.getIdentityUuid("vm_instance", usageRecord.getUsageId().toString()));
                 	} else {
                 		//External Device Host Id
-                		usageRecResponse.setUsageId(identityDao.getIdentityUuid("host", usageRecord.getUsageId().toString()));	
+                		usageRecResponse.setUsageId(identityDao.getIdentityUuid("host", usageRecord.getUsageId().toString()));
                 	}
                     //Network ID
                     usageRecResponse.setNetworkId(identityDao.getIdentityUuid("networks", usageRecord.getNetworkId().toString()));
-                    
+
                 } else if(usageRecord.getUsageType() == UsageTypes.VOLUME){
                     //Volume ID
                     usageRecResponse.setUsageId(identityDao.getIdentityUuid("volumes", usageRecord.getUsageId().toString()));
@@ -291,36 +296,36 @@ public class GetUsageRecordsCmd extends BaseListCmd {
                     usageRecResponse.setUsageId(identityDao.getIdentityUuid("vm_template", usageRecord.getUsageId().toString()));
                     //Template/ISO Size
                     usageRecResponse.setSize(usageRecord.getSize());
-                    
+
                 } else if(usageRecord.getUsageType() == UsageTypes.SNAPSHOT){
                     //Snapshot ID
                     usageRecResponse.setUsageId(identityDao.getIdentityUuid("snapshots", usageRecord.getUsageId().toString()));
                     //Snapshot Size
                     usageRecResponse.setSize(usageRecord.getSize());
-                    
+
                 } else if(usageRecord.getUsageType() == UsageTypes.LOAD_BALANCER_POLICY){
                     //Load Balancer Policy ID
                     usageRecResponse.setUsageId(usageRecord.getUsageId().toString());
-                    
+
                 } else if(usageRecord.getUsageType() == UsageTypes.PORT_FORWARDING_RULE){
                     //Port Forwarding Rule ID
                     usageRecResponse.setUsageId(usageRecord.getUsageId().toString());
-                    
+
                 } else if(usageRecord.getUsageType() == UsageTypes.NETWORK_OFFERING){
                 	//Network Offering Id
                 	usageRecResponse.setOfferingId(identityDao.getIdentityUuid("network_offerings", usageRecord.getOfferingId().toString()));
                 	//is Default
                 	usageRecResponse.setDefault((usageRecord.getUsageId() == 1)? true:false);
-                	
+
                 } else if(usageRecord.getUsageType() == UsageTypes.VPN_USERS){
                     //VPN User ID
                     usageRecResponse.setUsageId(usageRecord.getUsageId().toString());
-                    
+
                 } else if(usageRecord.getUsageType() == UsageTypes.SECURITY_GROUP){
                 	//Security Group Id
                 	usageRecResponse.setUsageId(identityDao.getIdentityUuid("security_group", usageRecord.getUsageId().toString()));
                 }
-                
+
                 if (usageRecord.getRawUsage() != null) {
                     DecimalFormat decimalFormat = new DecimalFormat("###########.######");
                     usageRecResponse.setRawUsage(decimalFormat.format(usageRecord.getRawUsage()));
@@ -332,7 +337,7 @@ public class GetUsageRecordsCmd extends BaseListCmd {
                 if (usageRecord.getEndDate() != null) {
                     usageRecResponse.setEndDate(getDateStringInternal(usageRecord.getEndDate()));
                 }
-            } 
+            }
 
             usageRecResponse.setObjectName("usagerecord");
             usageResponses.add(usageRecResponse);

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/3d344738/server/src/com/cloud/server/api/response/UsageRecordResponse.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/server/api/response/UsageRecordResponse.java b/server/src/com/cloud/server/api/response/UsageRecordResponse.java
index 63712e1..bcfce2d 100644
--- a/server/src/com/cloud/server/api/response/UsageRecordResponse.java
+++ b/server/src/com/cloud/server/api/response/UsageRecordResponse.java
@@ -27,19 +27,19 @@ import com.google.gson.annotations.SerializedName;
 public class UsageRecordResponse extends BaseResponse implements ControlledEntityResponse{
     @SerializedName(ApiConstants.ACCOUNT) @Param(description="the user account name")
     private String accountName;
-    
+
     @SerializedName(ApiConstants.ACCOUNT_ID) @Param(description="the user account Id")
     private IdentityProxy accountId = new IdentityProxy("account");
-    
+
     @SerializedName(ApiConstants.PROJECT_ID) @Param(description="the project id of the resource")
-    private IdentityProxy projectId = new IdentityProxy("projects");
-    
+    private String projectId;
+
     @SerializedName(ApiConstants.PROJECT) @Param(description="the project name of the resource")
     private String projectName;
 
     @SerializedName(ApiConstants.DOMAIN_ID) @Param(description="the domain ID")
-    private IdentityProxy domainId = new IdentityProxy("domain");
-    
+    private String domainId;
+
     @SerializedName(ApiConstants.DOMAIN) @Param(description="the domain the resource is associated with")
     private String domainName;
 
@@ -72,7 +72,7 @@ public class UsageRecordResponse extends BaseResponse implements ControlledEntit
 
     @SerializedName("usageid") @Param(description="id of the resource")
     private String usageId;
-    
+
     @SerializedName(ApiConstants.TYPE) @Param(description="resource type")
     private String type;
 
@@ -90,13 +90,13 @@ public class UsageRecordResponse extends BaseResponse implements ControlledEntit
 
     @SerializedName(ApiConstants.IS_SYSTEM) @Param(description="True if the IPAddress is system IP - allocated during vm deploy or lb rule create")
     private Boolean isSystem;
-    
+
     @SerializedName("networkid") @Param(description="id of the network")
     private String networkId;
-    
+
     @SerializedName("isdefault") @Param(description="True if the resource is default")
     private Boolean isDefault;
-    
+
     @Override
     public void setAccountName(String accountName) {
         this.accountName = accountName;
@@ -105,10 +105,10 @@ public class UsageRecordResponse extends BaseResponse implements ControlledEntit
     public void setAccountId(Long accountId) {
         this.accountId.setValue(accountId);
     }
-    
+
     @Override
-    public void setDomainId(Long domainId) {
-        this.domainId.setValue(domainId);
+    public void setDomainId(String domainId) {
+        this.domainId = domainId;
     }
 
     public void setZoneId(Long zoneId) {
@@ -174,17 +174,17 @@ public class UsageRecordResponse extends BaseResponse implements ControlledEntit
     public void setSystem(Boolean isSystem) {
         this.isSystem = isSystem;
     }
-    
+
     @Override
-    public void setProjectId(Long projectId) {
-        this.projectId.setValue(projectId);
+    public void setProjectId(String projectId) {
+        this.projectId = projectId;
     }
 
     @Override
     public void setProjectName(String projectName) {
         this.projectName = projectName;
     }
-    
+
     @Override
     public void setDomainName(String domainName) {
         this.domainName = domainName;
@@ -193,7 +193,7 @@ public class UsageRecordResponse extends BaseResponse implements ControlledEntit
     public void setNetworkId(String networkId) {
         this.networkId =  networkId;
     }
-    
+
     public void setDefault(Boolean isDefault) {
         this.isDefault = isDefault;
     }


Mime
View raw message