You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by mc...@apache.org on 2013/01/10 18:52:13 UTC
[6/9] git commit: Remove IdentityProxy and IdentityTypeAdapter class.
Remove IdentityProxy and IdentityTypeAdapter class.
Signed-off-by: Min Chen <mi...@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/7f8262d4
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/7f8262d4
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/7f8262d4
Branch: refs/heads/api_limit
Commit: 7f8262d45e9f2cdaa5d8f1aee0df61dab9573dd7
Parents: d13cc7e
Author: Min Chen <mi...@citrix.com>
Authored: Wed Jan 9 17:40:58 2013 -0800
Committer: Min Chen <mi...@citrix.com>
Committed: Wed Jan 9 17:40:58 2013 -0800
----------------------------------------------------------------------
.../api/commands/CreatePrivateNetworkCmd.java | 5 +-
api/src/com/cloud/exception/CloudException.java | 2 -
.../apache/cloudstack/api/BaseAsyncCreateCmd.java | 15 ++-
api/src/org/apache/cloudstack/api/BaseCmd.java | 2 -
.../org/apache/cloudstack/api/BaseResponse.java | 6 +-
.../command/admin/autoscale/CreateCounterCmd.java | 6 +-
.../network/AddNetworkServiceProviderCmd.java | 5 +-
.../admin/network/CreatePhysicalNetworkCmd.java | 5 +-
.../router/CreateVirtualRouterElementCmd.java | 6 +-
.../api/command/admin/usage/AddTrafficTypeCmd.java | 5 +-
.../command/admin/vpc/CreatePrivateGatewayCmd.java | 5 +-
.../command/admin/vpc/CreateVPCOfferingCmd.java | 5 +-
.../command/user/address/AssociateIPAddrCmd.java | 4 +-
.../user/autoscale/CreateAutoScalePolicyCmd.java | 5 +-
.../user/autoscale/CreateAutoScaleVmGroupCmd.java | 5 +-
.../autoscale/CreateAutoScaleVmProfileCmd.java | 6 +-
.../command/user/autoscale/CreateConditionCmd.java | 6 +-
.../user/firewall/CreateFirewallRuleCmd.java | 4 +-
.../user/firewall/CreatePortForwardingRuleCmd.java | 4 +-
.../loadbalancer/CreateLBStickinessPolicyCmd.java | 5 +-
.../loadbalancer/CreateLoadBalancerRuleCmd.java | 4 +-
.../user/nat/CreateIpForwardingRuleCmd.java | 4 +-
.../command/user/network/CreateNetworkACLCmd.java | 5 +-
.../api/command/user/project/CreateProjectCmd.java | 4 +-
.../command/user/snapshot/CreateSnapshotCmd.java | 4 +-
.../command/user/template/CreateTemplateCmd.java | 7 +-
.../api/command/user/vm/DeployVMCmd.java | 4 +-
.../api/command/user/volume/CreateVolumeCmd.java | 4 +-
.../api/command/user/vpc/CreateStaticRouteCmd.java | 5 +-
.../api/command/user/vpc/CreateVPCCmd.java | 6 +-
.../api/command/user/vpn/AddVpnUserCmd.java | 4 +-
.../command/user/vpn/CreateRemoteAccessVpnCmd.java | 9 +-
.../command/user/vpn/CreateVpnConnectionCmd.java | 4 +-
.../user/vpn/CreateVpnCustomerGatewayCmd.java | 3 -
.../api/command/user/vpn/CreateVpnGatewayCmd.java | 4 -
.../command/user/vpn/DeleteVpnConnectionCmd.java | 3 -
.../user/vpn/DeleteVpnCustomerGatewayCmd.java | 3 -
.../api/command/user/vpn/DeleteVpnGatewayCmd.java | 3 -
.../command/user/vpn/ResetVpnConnectionCmd.java | 3 -
.../user/vpn/UpdateVpnCustomerGatewayCmd.java | 6 +-
.../cloudstack/api/response/CapacityResponse.java | 1 -
.../cloudstack/api/response/CreateCmdResponse.java | 18 +---
.../api/response/ResourceCountResponse.java | 1 -
.../apache/cloudstack/api/response/S3Response.java | 9 +-
server/src/com/cloud/api/ApiGsonHelper.java | 2 -
.../src/com/cloud/api/ApiResponseGsonHelper.java | 4 +-
server/src/com/cloud/api/ApiResponseHelper.java | 2 +-
server/src/com/cloud/api/ApiServer.java | 9 +-
server/src/com/cloud/api/IdentityTypeAdapter.java | 80 ---------------
.../cloud/api/response/ApiResponseSerializer.java | 46 ++-------
.../com/cloud/server/ConfigurationServerImpl.java | 2 -
utils/src/com/cloud/utils/IdentityProxy.java | 60 -----------
.../utils/exception/RuntimeCloudException.java | 1 -
53 files changed, 84 insertions(+), 346 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/7f8262d4/api/src/com/cloud/api/commands/CreatePrivateNetworkCmd.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/commands/CreatePrivateNetworkCmd.java b/api/src/com/cloud/api/commands/CreatePrivateNetworkCmd.java
index b140ac7..263f023 100644
--- a/api/src/com/cloud/api/commands/CreatePrivateNetworkCmd.java
+++ b/api/src/com/cloud/api/commands/CreatePrivateNetworkCmd.java
@@ -153,6 +153,7 @@ public class CreatePrivateNetworkCmd extends BaseAsyncCreateCmd {
if (result != null) {
this.setEntityId(result.getId());
+ this.setEntityUuid(result.getUuid());
} else {
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to create a Private network");
}
@@ -190,8 +191,4 @@ public class CreatePrivateNetworkCmd extends BaseAsyncCreateCmd {
}
- @Override
- public String getEntityTable() {
- return "networks";
- }
}
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/7f8262d4/api/src/com/cloud/exception/CloudException.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/exception/CloudException.java b/api/src/com/cloud/exception/CloudException.java
index 8f1fa37..036cb1b 100644
--- a/api/src/com/cloud/exception/CloudException.java
+++ b/api/src/com/cloud/exception/CloudException.java
@@ -16,10 +16,8 @@
// under the License.
package com.cloud.exception;
-import com.cloud.utils.IdentityProxy;
import java.util.ArrayList;
import com.cloud.utils.exception.CSExceptionErrorCode;
-import com.cloud.utils.AnnotationHelper;
/**
* by the API response serializer. Any exceptions that are thrown by
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/7f8262d4/api/src/org/apache/cloudstack/api/BaseAsyncCreateCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/BaseAsyncCreateCmd.java b/api/src/org/apache/cloudstack/api/BaseAsyncCreateCmd.java
index ad9f4c6..1f2d3f1 100644
--- a/api/src/org/apache/cloudstack/api/BaseAsyncCreateCmd.java
+++ b/api/src/org/apache/cloudstack/api/BaseAsyncCreateCmd.java
@@ -25,6 +25,8 @@ public abstract class BaseAsyncCreateCmd extends BaseAsyncCmd {
@Parameter(name = "id", type = CommandType.LONG)
private Long id;
+ private String uuid;
+
public abstract void create() throws ResourceAllocationException;
public Long getEntityId() {
@@ -35,14 +37,19 @@ public abstract class BaseAsyncCreateCmd extends BaseAsyncCmd {
this.id = id;
}
- public abstract String getEntityTable();
+ public String getEntityUuid() {
+ return uuid;
+ }
+
+ public void setEntityUuid(String uuid) {
+ this.uuid = uuid;
+ }
- public String getResponse(long jobId, long objectId, String objectEntityTable) {
+ public String getResponse(long jobId, String objectUuid) {
CreateCmdResponse response = new CreateCmdResponse();
AsyncJob job = _entityMgr.findById(AsyncJob.class, jobId);
response.setJobId(job.getUuid());
- response.setId(objectId);
- response.setIdEntityTable(objectEntityTable);
+ response.setId(objectUuid);
response.setResponseName(getCommandName());
return _responseGenerator.toSerializedString(response, getResponseType());
}
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/7f8262d4/api/src/org/apache/cloudstack/api/BaseCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/BaseCmd.java b/api/src/org/apache/cloudstack/api/BaseCmd.java
index d964e70..3399784 100644
--- a/api/src/org/apache/cloudstack/api/BaseCmd.java
+++ b/api/src/org/apache/cloudstack/api/BaseCmd.java
@@ -19,7 +19,6 @@ package org.apache.cloudstack.api;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
-import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
@@ -64,7 +63,6 @@ import com.cloud.user.Account;
import com.cloud.user.AccountService;
import com.cloud.user.DomainService;
import com.cloud.user.ResourceLimitService;
-import com.cloud.utils.IdentityProxy;
import com.cloud.utils.Pair;
import com.cloud.utils.component.ComponentLocator;
import com.cloud.vm.BareMetalVmService;
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/7f8262d4/api/src/org/apache/cloudstack/api/BaseResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/BaseResponse.java b/api/src/org/apache/cloudstack/api/BaseResponse.java
index 28ca6b8..01f1be3 100644
--- a/api/src/org/apache/cloudstack/api/BaseResponse.java
+++ b/api/src/org/apache/cloudstack/api/BaseResponse.java
@@ -17,7 +17,6 @@
package org.apache.cloudstack.api;
import org.apache.cloudstack.api.ApiConstants;
-import com.cloud.utils.IdentityProxy;
import org.apache.cloudstack.api.ResponseObject;
import com.cloud.serializer.Param;
import com.google.gson.annotations.SerializedName;
@@ -46,6 +45,7 @@ public abstract class BaseResponse implements ResponseObject {
this.objectName = objectName;
}
+ @Override
public String getObjectId() {
return null;
}
@@ -56,18 +56,22 @@ public abstract class BaseResponse implements ResponseObject {
@SerializedName(ApiConstants.JOB_STATUS) @Param(description="the current status of the latest async job acting on this object")
private Integer jobStatus;
+ @Override
public String getJobId() {
return jobId;
}
+ @Override
public void setJobId(String jobId) {
this.jobId = jobId;
}
+ @Override
public Integer getJobStatus() {
return jobStatus;
}
+ @Override
public void setJobStatus(Integer jobStatus) {
this.jobStatus = jobStatus;
}
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/7f8262d4/api/src/org/apache/cloudstack/api/command/admin/autoscale/CreateCounterCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/autoscale/CreateCounterCmd.java b/api/src/org/apache/cloudstack/api/command/admin/autoscale/CreateCounterCmd.java
index 7369a6f..a119d0f 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/autoscale/CreateCounterCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/autoscale/CreateCounterCmd.java
@@ -81,6 +81,7 @@ public class CreateCounterCmd extends BaseAsyncCreateCmd {
if (ctr != null) {
this.setEntityId(ctr.getId());
+ this.setEntityUuid(ctr.getUuid());
CounterResponse response = _responseGenerator.createCounterResponse(ctr);
response.setResponseName(getCommandName());
this.setResponseObject(response);
@@ -113,8 +114,5 @@ public class CreateCounterCmd extends BaseAsyncCreateCmd {
return Account.ACCOUNT_ID_SYSTEM;
}
- @Override
- public String getEntityTable() {
- return "counter";
- }
+
}
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/7f8262d4/api/src/org/apache/cloudstack/api/command/admin/network/AddNetworkServiceProviderCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/network/AddNetworkServiceProviderCmd.java b/api/src/org/apache/cloudstack/api/command/admin/network/AddNetworkServiceProviderCmd.java
index b6518d8..6d4b962 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/network/AddNetworkServiceProviderCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/network/AddNetworkServiceProviderCmd.java
@@ -59,10 +59,6 @@ public class AddNetworkServiceProviderCmd extends BaseAsyncCreateCmd {
@Parameter(name=ApiConstants.SERVICE_LIST, type=CommandType.LIST, collectionType = CommandType.STRING, description="the list of services to be enabled for this physical network service provider")
private List<String> enabledServices;
- @Override
- public String getEntityTable() {
- return "physical_network_service_providers";
- }
/////////////////////////////////////////////////////
/////////////////// Accessors ///////////////////////
@@ -116,6 +112,7 @@ public class AddNetworkServiceProviderCmd extends BaseAsyncCreateCmd {
PhysicalNetworkServiceProvider result = _networkService.addProviderToPhysicalNetwork(getPhysicalNetworkId(), getProviderName(), getDestinationPhysicalNetworkId(), getEnabledServices());
if (result != null) {
setEntityId(result.getId());
+ setEntityUuid(result.getUuid());
} else {
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to add service provider entity to physical network");
}
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/7f8262d4/api/src/org/apache/cloudstack/api/command/admin/network/CreatePhysicalNetworkCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/network/CreatePhysicalNetworkCmd.java b/api/src/org/apache/cloudstack/api/command/admin/network/CreatePhysicalNetworkCmd.java
index dd3f323..f56ae7d 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/network/CreatePhysicalNetworkCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/network/CreatePhysicalNetworkCmd.java
@@ -79,10 +79,6 @@ public class CreatePhysicalNetworkCmd extends BaseAsyncCreateCmd {
return tags;
}
- @Override
- public String getEntityTable() {
- return "physical_network";
- }
public Long getZoneId() {
return zoneId;
@@ -164,6 +160,7 @@ public class CreatePhysicalNetworkCmd extends BaseAsyncCreateCmd {
PhysicalNetwork result = _networkService.createPhysicalNetwork(getZoneId(),getVlan(),getNetworkSpeed(), getIsolationMethods(),getBroadcastDomainRange(),getDomainId(), getTags(), getNetworkName());
if (result != null) {
setEntityId(result.getId());
+ setEntityUuid(result.getUuid());
} else {
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to create physical network entity");
}
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/7f8262d4/api/src/org/apache/cloudstack/api/command/admin/router/CreateVirtualRouterElementCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/router/CreateVirtualRouterElementCmd.java b/api/src/org/apache/cloudstack/api/command/admin/router/CreateVirtualRouterElementCmd.java
index 545218f..f6a7b74 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/router/CreateVirtualRouterElementCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/router/CreateVirtualRouterElementCmd.java
@@ -53,10 +53,7 @@ public class CreateVirtualRouterElementCmd extends BaseAsyncCreateCmd {
this.nspId = nspId;
}
- @Override
- public String getEntityTable() {
- return "virtual_router_providers";
- }
+
public Long getNspId() {
return nspId;
@@ -94,6 +91,7 @@ public class CreateVirtualRouterElementCmd extends BaseAsyncCreateCmd {
VirtualRouterProvider result = _service.addElement(getNspId(), VirtualRouterProviderType.VirtualRouter);
if (result != null) {
setEntityId(result.getId());
+ setEntityUuid(result.getUuid());
} else {
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to add Virtual Router entity to physical network");
}
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/7f8262d4/api/src/org/apache/cloudstack/api/command/admin/usage/AddTrafficTypeCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/usage/AddTrafficTypeCmd.java b/api/src/org/apache/cloudstack/api/command/admin/usage/AddTrafficTypeCmd.java
index 1759ff7..5dca9d2 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/usage/AddTrafficTypeCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/usage/AddTrafficTypeCmd.java
@@ -66,10 +66,6 @@ public class AddTrafficTypeCmd extends BaseAsyncCreateCmd {
/////////////////// Accessors ///////////////////////
/////////////////////////////////////////////////////
- @Override
- public String getEntityTable() {
- return "physical_network_traffic_types";
- }
public Long getPhysicalNetworkId() {
return physicalNetworkId;
@@ -136,6 +132,7 @@ public class AddTrafficTypeCmd extends BaseAsyncCreateCmd {
PhysicalNetworkTrafficType result = _networkService.addTrafficTypeToPhysicalNetwork(getPhysicalNetworkId(), getTrafficType(), getXenLabel(), getKvmLabel(), getVmwareLabel(), getSimulatorLabel(), getVlan());
if (result != null) {
setEntityId(result.getId());
+ setEntityUuid(result.getUuid());
} else {
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to add traffic type to physical network");
}
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/7f8262d4/api/src/org/apache/cloudstack/api/command/admin/vpc/CreatePrivateGatewayCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/vpc/CreatePrivateGatewayCmd.java b/api/src/org/apache/cloudstack/api/command/admin/vpc/CreatePrivateGatewayCmd.java
index 7950b87..5bb76ab 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/vpc/CreatePrivateGatewayCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/vpc/CreatePrivateGatewayCmd.java
@@ -123,6 +123,7 @@ public class CreatePrivateGatewayCmd extends BaseAsyncCreateCmd {
if (result != null) {
this.setEntityId(result.getId());
+ this.setEntityUuid(result.getUuid());
} else {
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to create private gateway");
}
@@ -156,10 +157,6 @@ public class CreatePrivateGatewayCmd extends BaseAsyncCreateCmd {
return "creating private gateway";
}
- @Override
- public String getEntityTable() {
- return "vpc_gateways";
- }
@Override
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/7f8262d4/api/src/org/apache/cloudstack/api/command/admin/vpc/CreateVPCOfferingCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/vpc/CreateVPCOfferingCmd.java b/api/src/org/apache/cloudstack/api/command/admin/vpc/CreateVPCOfferingCmd.java
index a0abe99..273f7c0 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/vpc/CreateVPCOfferingCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/vpc/CreateVPCOfferingCmd.java
@@ -70,6 +70,7 @@ public class CreateVPCOfferingCmd extends BaseAsyncCreateCmd{
VpcOffering vpcOff = _vpcService.createVpcOffering(getVpcOfferingName(), getDisplayText(), getSupportedServices());
if (vpcOff != null) {
this.setEntityId(vpcOff.getId());
+ this.setEntityUuid(vpcOff.getUuid());
} else {
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to create a VPC offering");
}
@@ -87,10 +88,6 @@ public class CreateVPCOfferingCmd extends BaseAsyncCreateCmd{
}
}
- @Override
- public String getEntityTable() {
- return "vpc_offerings";
- }
@Override
public String getEventType() {
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/7f8262d4/api/src/org/apache/cloudstack/api/command/user/address/AssociateIPAddrCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/address/AssociateIPAddrCmd.java b/api/src/org/apache/cloudstack/api/command/user/address/AssociateIPAddrCmd.java
index 7d4e44b..024ba74 100644
--- a/api/src/org/apache/cloudstack/api/command/user/address/AssociateIPAddrCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/address/AssociateIPAddrCmd.java
@@ -87,9 +87,6 @@ public class AssociateIPAddrCmd extends BaseAsyncCreateCmd {
/////////////////// Accessors ///////////////////////
/////////////////////////////////////////////////////
- public String getEntityTable() {
- return "user_ip_address";
- }
public String getAccountName() {
if (accountName != null) {
@@ -220,6 +217,7 @@ public class AssociateIPAddrCmd extends BaseAsyncCreateCmd {
if (ip != null) {
this.setEntityId(ip.getId());
+ this.setEntityUuid(ip.getUuid());
} else {
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to allocate ip address");
}
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/7f8262d4/api/src/org/apache/cloudstack/api/command/user/autoscale/CreateAutoScalePolicyCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/autoscale/CreateAutoScalePolicyCmd.java b/api/src/org/apache/cloudstack/api/command/user/autoscale/CreateAutoScalePolicyCmd.java
index db3aaa6..e92721d 100644
--- a/api/src/org/apache/cloudstack/api/command/user/autoscale/CreateAutoScalePolicyCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/autoscale/CreateAutoScalePolicyCmd.java
@@ -62,10 +62,6 @@ public class CreateAutoScalePolicyCmd extends BaseAsyncCreateCmd {
private Long conditionDomainId;
private Long conditionAccountId;
- @Override
- public String getEntityTable() {
- return "autoscale_policies";
- }
public int getDuration() {
return duration;
@@ -159,6 +155,7 @@ public class CreateAutoScalePolicyCmd extends BaseAsyncCreateCmd {
AutoScalePolicy result = _autoScaleService.createAutoScalePolicy(this);
if (result != null) {
this.setEntityId(result.getId());
+ this.setEntityUuid(result.getUuid());
} else {
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to create AutoScale Policy");
}
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/7f8262d4/api/src/org/apache/cloudstack/api/command/user/autoscale/CreateAutoScaleVmGroupCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/autoscale/CreateAutoScaleVmGroupCmd.java b/api/src/org/apache/cloudstack/api/command/user/autoscale/CreateAutoScaleVmGroupCmd.java
index 6297888..e3d47a0 100644
--- a/api/src/org/apache/cloudstack/api/command/user/autoscale/CreateAutoScaleVmGroupCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/autoscale/CreateAutoScaleVmGroupCmd.java
@@ -72,10 +72,6 @@ public class CreateAutoScaleVmGroupCmd extends BaseAsyncCreateCmd {
// ///////////////// Accessors ///////////////////////
// ///////////////////////////////////////////////////
- @Override
- public String getEntityTable() {
- return "autoscale_vmgroups";
- }
public int getMinMembers() {
return minMembers;
@@ -161,6 +157,7 @@ public class CreateAutoScaleVmGroupCmd extends BaseAsyncCreateCmd {
AutoScaleVmGroup result = _autoScaleService.createAutoScaleVmGroup(this);
if (result != null) {
this.setEntityId(result.getId());
+ this.setEntityUuid(result.getUuid());
} else {
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to create Autoscale Vm Group");
}
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/7f8262d4/api/src/org/apache/cloudstack/api/command/user/autoscale/CreateAutoScaleVmProfileCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/autoscale/CreateAutoScaleVmProfileCmd.java b/api/src/org/apache/cloudstack/api/command/user/autoscale/CreateAutoScaleVmProfileCmd.java
index daa4850..25bb03b 100644
--- a/api/src/org/apache/cloudstack/api/command/user/autoscale/CreateAutoScaleVmProfileCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/autoscale/CreateAutoScaleVmProfileCmd.java
@@ -86,10 +86,7 @@ public class CreateAutoScaleVmProfileCmd extends BaseAsyncCreateCmd {
private Long domainId;
private Long accountId;
- @Override
- public String getEntityTable() {
- return "autoscale_vmprofiles";
- }
+
public Long getDomainId() {
if (domainId == null) {
@@ -232,6 +229,7 @@ public class CreateAutoScaleVmProfileCmd extends BaseAsyncCreateCmd {
AutoScaleVmProfile result = _autoScaleService.createAutoScaleVmProfile(this);
if (result != null) {
this.setEntityId(result.getId());
+ this.setEntityUuid(result.getUuid());
} else {
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to create Autoscale Vm Profile");
}
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/7f8262d4/api/src/org/apache/cloudstack/api/command/user/autoscale/CreateConditionCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/autoscale/CreateConditionCmd.java b/api/src/org/apache/cloudstack/api/command/user/autoscale/CreateConditionCmd.java
index a952471..58926f2 100644
--- a/api/src/org/apache/cloudstack/api/command/user/autoscale/CreateConditionCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/autoscale/CreateConditionCmd.java
@@ -72,6 +72,7 @@ public class CreateConditionCmd extends BaseAsyncCreateCmd {
if (condition != null) {
this.setEntityId(condition.getId());
+ this.setEntityUuid(condition.getUuid());
} else {
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to create condition.");
}
@@ -146,8 +147,5 @@ public class CreateConditionCmd extends BaseAsyncCreateCmd {
return accountId;
}
- @Override
- public String getEntityTable() {
- return "conditions";
- }
+
}
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/7f8262d4/api/src/org/apache/cloudstack/api/command/user/firewall/CreateFirewallRuleCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/firewall/CreateFirewallRuleCmd.java b/api/src/org/apache/cloudstack/api/command/user/firewall/CreateFirewallRuleCmd.java
index 803301f..7039b41 100644
--- a/api/src/org/apache/cloudstack/api/command/user/firewall/CreateFirewallRuleCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/firewall/CreateFirewallRuleCmd.java
@@ -80,9 +80,6 @@ public class CreateFirewallRuleCmd extends BaseAsyncCreateCmd implements Firewal
// ///////////////// Accessors ///////////////////////
// ///////////////////////////////////////////////////
- public String getEntityTable() {
- return "firewall_rules";
- }
public Long getIpAddressId() {
return ipAddressId;
@@ -242,6 +239,7 @@ public class CreateFirewallRuleCmd extends BaseAsyncCreateCmd implements Firewal
try {
FirewallRule result = _firewallService.createFirewallRule(this);
setEntityId(result.getId());
+ setEntityUuid(result.getUuid());
} catch (NetworkRuleConflictException ex) {
s_logger.info("Network rule conflict: " + ex.getMessage());
s_logger.trace("Network Rule Conflict: ", ex);
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/7f8262d4/api/src/org/apache/cloudstack/api/command/user/firewall/CreatePortForwardingRuleCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/firewall/CreatePortForwardingRuleCmd.java b/api/src/org/apache/cloudstack/api/command/user/firewall/CreatePortForwardingRuleCmd.java
index ecccf03..1feefde 100644
--- a/api/src/org/apache/cloudstack/api/command/user/firewall/CreatePortForwardingRuleCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/firewall/CreatePortForwardingRuleCmd.java
@@ -94,9 +94,6 @@ public class CreatePortForwardingRuleCmd extends BaseAsyncCreateCmd implements P
// ///////////////// Accessors ///////////////////////
// ///////////////////////////////////////////////////
- public String getEntityTable() {
- return "firewall_rules";
- }
public Long getIpAddressId() {
return ipAddressId;
@@ -301,6 +298,7 @@ public class CreatePortForwardingRuleCmd extends BaseAsyncCreateCmd implements P
try {
PortForwardingRule result = _rulesService.createPortForwardingRule(this, virtualMachineId, getOpenFirewall());
setEntityId(result.getId());
+ setEntityUuid(result.getUuid());
} catch (NetworkRuleConflictException ex) {
s_logger.info("Network rule conflict: " , ex);
s_logger.trace("Network Rule Conflict: ", ex);
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/7f8262d4/api/src/org/apache/cloudstack/api/command/user/loadbalancer/CreateLBStickinessPolicyCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/CreateLBStickinessPolicyCmd.java b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/CreateLBStickinessPolicyCmd.java
index dc80d31..c01e138 100644
--- a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/CreateLBStickinessPolicyCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/CreateLBStickinessPolicyCmd.java
@@ -91,9 +91,7 @@ public class CreateLBStickinessPolicyCmd extends BaseAsyncCreateCmd {
return paramList;
}
- public String getEntityTable() {
- return "firewall_rules";
- }
+
// ///////////////////////////////////////////////////
// ///////////// API Implementation///////////////////
// ///////////////////////////////////////////////////
@@ -141,6 +139,7 @@ public class CreateLBStickinessPolicyCmd extends BaseAsyncCreateCmd {
try {
StickinessPolicy result = _lbService.createLBStickinessPolicy(this);
this.setEntityId(result.getId());
+ this.setEntityUuid(result.getUuid());
} catch (NetworkRuleConflictException e) {
s_logger.warn("Exception: ", e);
throw new ServerApiException(BaseCmd.NETWORK_RULE_CONFLICT_ERROR, e.getMessage());
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/7f8262d4/api/src/org/apache/cloudstack/api/command/user/loadbalancer/CreateLoadBalancerRuleCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/CreateLoadBalancerRuleCmd.java b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/CreateLoadBalancerRuleCmd.java
index 4aacc8e..4e76a6b 100644
--- a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/CreateLoadBalancerRuleCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/CreateLoadBalancerRuleCmd.java
@@ -120,9 +120,6 @@ public class CreateLoadBalancerRuleCmd extends BaseAsyncCreateCmd /*implements
return privatePort;
}
- public String getEntityTable() {
- return "firewall_rules";
- }
public Long getSourceIpAddressId() {
if (publicIpId != null) {
@@ -283,6 +280,7 @@ public class CreateLoadBalancerRuleCmd extends BaseAsyncCreateCmd /*implements
try {
LoadBalancer result = _lbService.createLoadBalancerRule(this, getOpenFirewall());
this.setEntityId(result.getId());
+ this.setEntityUuid(result.getUuid());
} catch (NetworkRuleConflictException e) {
s_logger.warn("Exception: ", e);
throw new ServerApiException(BaseCmd.NETWORK_RULE_CONFLICT_ERROR, e.getMessage());
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/7f8262d4/api/src/org/apache/cloudstack/api/command/user/nat/CreateIpForwardingRuleCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/nat/CreateIpForwardingRuleCmd.java b/api/src/org/apache/cloudstack/api/command/user/nat/CreateIpForwardingRuleCmd.java
index e612b84..1ce3458 100644
--- a/api/src/org/apache/cloudstack/api/command/user/nat/CreateIpForwardingRuleCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/nat/CreateIpForwardingRuleCmd.java
@@ -75,9 +75,6 @@ public class CreateIpForwardingRuleCmd extends BaseAsyncCreateCmd implements Sta
/////////////////// Accessors ///////////////////////
/////////////////////////////////////////////////////
- public String getEntityTable() {
- return "firewall_rules";
- }
public Long getIpAddressId() {
return ipAddressId;
@@ -151,6 +148,7 @@ public class CreateIpForwardingRuleCmd extends BaseAsyncCreateCmd implements Sta
try {
StaticNatRule rule = _rulesService.createStaticNatRule(this, getOpenFirewall());
this.setEntityId(rule.getId());
+ this.setEntityUuid(rule.getUuid());
} catch (NetworkRuleConflictException e) {
s_logger.info("Unable to create Static Nat Rule due to ", e);
throw new ServerApiException(BaseCmd.NETWORK_RULE_CONFLICT_ERROR, e.getMessage());
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/7f8262d4/api/src/org/apache/cloudstack/api/command/user/network/CreateNetworkACLCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/network/CreateNetworkACLCmd.java b/api/src/org/apache/cloudstack/api/command/user/network/CreateNetworkACLCmd.java
index e2aba5b..16843b5 100644
--- a/api/src/org/apache/cloudstack/api/command/user/network/CreateNetworkACLCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/network/CreateNetworkACLCmd.java
@@ -86,10 +86,6 @@ public class CreateNetworkACLCmd extends BaseAsyncCreateCmd implements FirewallR
// ///////////////// Accessors ///////////////////////
// ///////////////////////////////////////////////////
- public String getEntityTable() {
- return "firewall_rules";
- }
-
public Long getIpAddressId() {
return null;
}
@@ -262,6 +258,7 @@ public class CreateNetworkACLCmd extends BaseAsyncCreateCmd implements FirewallR
try {
FirewallRule result = _networkACLService.createNetworkACL(this);
setEntityId(result.getId());
+ setEntityUuid(result.getUuid());
} catch (NetworkRuleConflictException ex) {
s_logger.info("Network rule conflict: " + ex.getMessage());
s_logger.trace("Network Rule Conflict: ", ex);
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/7f8262d4/api/src/org/apache/cloudstack/api/command/user/project/CreateProjectCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/project/CreateProjectCmd.java b/api/src/org/apache/cloudstack/api/command/user/project/CreateProjectCmd.java
index 9500a97..865f7a0 100644
--- a/api/src/org/apache/cloudstack/api/command/user/project/CreateProjectCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/project/CreateProjectCmd.java
@@ -56,9 +56,6 @@ public class CreateProjectCmd extends BaseAsyncCreateCmd {
// ///////////////// Accessors ///////////////////////
// ///////////////////////////////////////////////////
- public String getEntityTable() {
- return "projects";
- }
public String getAccountName() {
if (accountName != null) {
@@ -127,6 +124,7 @@ public class CreateProjectCmd extends BaseAsyncCreateCmd {
Project project = _projectService.createProject(getName(), getDisplayText(), getAccountName(), getDomainId());
if (project != null) {
this.setEntityId(project.getId());
+ this.setEntityUuid(project.getUuid());
} else {
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to create a project");
}
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/7f8262d4/api/src/org/apache/cloudstack/api/command/user/snapshot/CreateSnapshotCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/snapshot/CreateSnapshotCmd.java b/api/src/org/apache/cloudstack/api/command/user/snapshot/CreateSnapshotCmd.java
index 33469ac..14f4654 100644
--- a/api/src/org/apache/cloudstack/api/command/user/snapshot/CreateSnapshotCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/snapshot/CreateSnapshotCmd.java
@@ -65,9 +65,6 @@ public class CreateSnapshotCmd extends BaseAsyncCreateCmd {
// ///////////////// Accessors ///////////////////////
// ///////////////////////////////////////////////////
- public String getEntityTable() {
- return "snapshots";
- }
public String getAccountName() {
return accountName;
@@ -153,6 +150,7 @@ public class CreateSnapshotCmd extends BaseAsyncCreateCmd {
Snapshot snapshot = _snapshotService.allocSnapshot(getVolumeId(), getPolicyId());
if (snapshot != null) {
this.setEntityId(snapshot.getId());
+ this.setEntityUuid(snapshot.getUuid());
} else {
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to create snapshot");
}
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/7f8262d4/api/src/org/apache/cloudstack/api/command/user/template/CreateTemplateCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/template/CreateTemplateCmd.java b/api/src/org/apache/cloudstack/api/command/user/template/CreateTemplateCmd.java
index 65cc8b9..e72b49b 100644
--- a/api/src/org/apache/cloudstack/api/command/user/template/CreateTemplateCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/template/CreateTemplateCmd.java
@@ -102,9 +102,6 @@ import com.cloud.user.UserContext;
// ///////////////// Accessors ///////////////////////
// ///////////////////////////////////////////////////
- public String getEntityTable() {
- return "vm_template";
- }
public Integer getBits() {
return bits;
@@ -240,13 +237,15 @@ import com.cloud.user.UserContext;
public void create() throws ResourceAllocationException {
if (isBareMetal()) {
_bareMetalVmService.createPrivateTemplateRecord(this, _accountService.getAccount(getEntityOwnerId()));
- /*Baremetal creates template record after taking image proceeded, use vmId as entity id here*/
+ /*Baremetal creates template record after taking image proceeded, use vmId as entity id and uuid here*/
this.setEntityId(vmId);
+ this.setEntityUuid(vmId.toString());
} else {
VirtualMachineTemplate template = null;
template = _userVmService.createPrivateTemplateRecord(this, _accountService.getAccount(getEntityOwnerId()));
if (template != null) {
this.setEntityId(template.getId());
+ this.setEntityUuid(template.getUuid());
} else {
throw new ServerApiException(BaseCmd.INTERNAL_ERROR,
"Failed to create a template");
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/7f8262d4/api/src/org/apache/cloudstack/api/command/user/vm/DeployVMCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/vm/DeployVMCmd.java b/api/src/org/apache/cloudstack/api/command/user/vm/DeployVMCmd.java
index 349f4a1..28bb80f 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vm/DeployVMCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vm/DeployVMCmd.java
@@ -171,9 +171,6 @@ public class DeployVMCmd extends BaseAsyncCreateCmd {
/////////////////// Accessors ///////////////////////
/////////////////////////////////////////////////////
- public String getEntityTable() {
- return "vm_instance";
- }
public String getAccountName() {
if (accountName == null) {
@@ -446,6 +443,7 @@ public class DeployVMCmd extends BaseAsyncCreateCmd {
if (vm != null) {
setEntityId(vm.getId());
+ setEntityUuid(vm.getUuid());
} else {
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to deploy vm");
}
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/7f8262d4/api/src/org/apache/cloudstack/api/command/user/volume/CreateVolumeCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/volume/CreateVolumeCmd.java b/api/src/org/apache/cloudstack/api/command/user/volume/CreateVolumeCmd.java
index 512685f..04541b9 100644
--- a/api/src/org/apache/cloudstack/api/command/user/volume/CreateVolumeCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/volume/CreateVolumeCmd.java
@@ -76,9 +76,6 @@ public class CreateVolumeCmd extends BaseAsyncCreateCmd {
/////////////////// Accessors ///////////////////////
/////////////////////////////////////////////////////
- public String getEntityTable() {
- return "volumes";
- }
public String getAccountName() {
return accountName;
@@ -154,6 +151,7 @@ public class CreateVolumeCmd extends BaseAsyncCreateCmd {
Volume volume = _storageService.allocVolume(this);
if (volume != null) {
this.setEntityId(volume.getId());
+ this.setEntityUuid(volume.getUuid());
} else {
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to create volume");
}
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/7f8262d4/api/src/org/apache/cloudstack/api/command/user/vpc/CreateStaticRouteCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/vpc/CreateStaticRouteCmd.java b/api/src/org/apache/cloudstack/api/command/user/vpc/CreateStaticRouteCmd.java
index 85a0ae4..96de56a 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vpc/CreateStaticRouteCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vpc/CreateStaticRouteCmd.java
@@ -67,6 +67,7 @@ public class CreateStaticRouteCmd extends BaseAsyncCreateCmd{
try {
StaticRoute result = _vpcService.createStaticRoute(getGatewayId(), getCidr());
setEntityId(result.getId());
+ setEntityUuid(result.getUuid());
} catch (NetworkRuleConflictException ex) {
s_logger.info("Network rule conflict: " + ex.getMessage());
s_logger.trace("Network rule conflict: ", ex);
@@ -74,10 +75,6 @@ public class CreateStaticRouteCmd extends BaseAsyncCreateCmd{
}
}
- @Override
- public String getEntityTable() {
- return "static_routes";
- }
@Override
public String getEventType() {
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/7f8262d4/api/src/org/apache/cloudstack/api/command/user/vpc/CreateVPCCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/vpc/CreateVPCCmd.java b/api/src/org/apache/cloudstack/api/command/user/vpc/CreateVPCCmd.java
index df16c8e..8a2e1f6 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vpc/CreateVPCCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vpc/CreateVPCCmd.java
@@ -124,6 +124,7 @@ public class CreateVPCCmd extends BaseAsyncCreateCmd{
getCidr(), getNetworkDomain());
if (vpc != null) {
this.setEntityId(vpc.getId());
+ this.setEntityUuid(vpc.getUuid());
} else {
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to create a VPC");
}
@@ -157,11 +158,6 @@ public class CreateVPCCmd extends BaseAsyncCreateCmd{
}
}
- @Override
- public String getEntityTable() {
- return "vpc";
- }
-
@Override
public String getEventType() {
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/7f8262d4/api/src/org/apache/cloudstack/api/command/user/vpn/AddVpnUserCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/vpn/AddVpnUserCmd.java b/api/src/org/apache/cloudstack/api/command/user/vpn/AddVpnUserCmd.java
index 674dc6a..f2d19a7 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vpn/AddVpnUserCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vpn/AddVpnUserCmd.java
@@ -103,9 +103,6 @@ public class AddVpnUserCmd extends BaseAsyncCreateCmd {
return accountId;
}
- public String getEntityTable() {
- return "vpn_users";
- }
@Override
public String getEventDescription() {
@@ -150,5 +147,6 @@ public class AddVpnUserCmd extends BaseAsyncCreateCmd {
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to add vpn user");
}
setEntityId(vpnUser.getId());
+ setEntityUuid(vpnUser.getUuid());
}
}
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/7f8262d4/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 37952f8..b517af8 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
@@ -62,10 +62,6 @@ public class CreateRemoteAccessVpnCmd extends BaseAsyncCreateCmd {
/////////////////// Accessors ///////////////////////
/////////////////////////////////////////////////////
- public String getEntityTable() {
- return "user_ip_address";
- }
-
public Long getPublicIpId() {
return publicIpId;
}
@@ -146,6 +142,11 @@ public class CreateRemoteAccessVpnCmd extends BaseAsyncCreateCmd {
RemoteAccessVpn vpn = _ravService.createRemoteAccessVpn(publicIpId, ipRange, getOpenFirewall(), getNetworkId());
if (vpn != null) {
this.setEntityId(vpn.getServerAddressId());
+ // find uuid for server ip address
+ IpAddress ipAddr = _entityMgr.findById(IpAddress.class, vpn.getServerAddressId());
+ if (ipAddr != null) {
+ this.setEntityUuid(ipAddr.getUuid());
+ }
} else {
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to create remote access vpn");
}
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/7f8262d4/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 7f85fb4..3dc334d 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
@@ -51,9 +51,6 @@ public class CreateVpnConnectionCmd extends BaseAsyncCreateCmd {
/////////////////// Accessors ///////////////////////
/////////////////////////////////////////////////////
- public String getEntityTable() {
- return "s2s_vpn_connection";
- }
public Long getVpnGatewayId() {
return vpnGatewayId;
@@ -95,6 +92,7 @@ public class CreateVpnConnectionCmd extends BaseAsyncCreateCmd {
Site2SiteVpnConnection conn = _s2sVpnService.createVpnConnection(this);
if (conn != null) {
this.setEntityId(conn.getId());
+ this.setEntityUuid(conn.getUuid());
} else {
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to create site to site vpn connection");
}
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/7f8262d4/api/src/org/apache/cloudstack/api/command/user/vpn/CreateVpnCustomerGatewayCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/vpn/CreateVpnCustomerGatewayCmd.java b/api/src/org/apache/cloudstack/api/command/user/vpn/CreateVpnCustomerGatewayCmd.java
index 6508518..bde98b0 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vpn/CreateVpnCustomerGatewayCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vpn/CreateVpnCustomerGatewayCmd.java
@@ -78,9 +78,6 @@ public class CreateVpnCustomerGatewayCmd extends BaseAsyncCmd {
/////////////////// Accessors ///////////////////////
/////////////////////////////////////////////////////
- public String getEntityTable() {
- return "s2s_customer_gateway";
- }
public String getName() {
return name;
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/7f8262d4/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 89965bd..4b40554 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
@@ -47,10 +47,6 @@ public class CreateVpnGatewayCmd extends BaseAsyncCmd {
/////////////////// Accessors ///////////////////////
/////////////////////////////////////////////////////
- public String getEntityTable() {
- return "s2s_vpn_gateway";
- }
-
public Long getVpcId() {
return vpcId;
}
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/7f8262d4/api/src/org/apache/cloudstack/api/command/user/vpn/DeleteVpnConnectionCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/vpn/DeleteVpnConnectionCmd.java b/api/src/org/apache/cloudstack/api/command/user/vpn/DeleteVpnConnectionCmd.java
index a079e8b..23a7793 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vpn/DeleteVpnConnectionCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vpn/DeleteVpnConnectionCmd.java
@@ -44,9 +44,6 @@ public class DeleteVpnConnectionCmd extends BaseAsyncCmd {
/////////////////// Accessors ///////////////////////
/////////////////////////////////////////////////////
- public String getEntityTable() {
- return "s2s_vpn_connection";
- }
public Long getId() {
return id;
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/7f8262d4/api/src/org/apache/cloudstack/api/command/user/vpn/DeleteVpnCustomerGatewayCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/vpn/DeleteVpnCustomerGatewayCmd.java b/api/src/org/apache/cloudstack/api/command/user/vpn/DeleteVpnCustomerGatewayCmd.java
index ef5ff3d..181ee3b 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vpn/DeleteVpnCustomerGatewayCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vpn/DeleteVpnCustomerGatewayCmd.java
@@ -43,9 +43,6 @@ public class DeleteVpnCustomerGatewayCmd extends BaseAsyncCmd {
/////////////////// Accessors ///////////////////////
/////////////////////////////////////////////////////
- public String getEntityTable() {
- return "s2s_customer_gateway";
- }
public Long getId() {
return id;
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/7f8262d4/api/src/org/apache/cloudstack/api/command/user/vpn/DeleteVpnGatewayCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/vpn/DeleteVpnGatewayCmd.java b/api/src/org/apache/cloudstack/api/command/user/vpn/DeleteVpnGatewayCmd.java
index f9b9e35..9ac27d0 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vpn/DeleteVpnGatewayCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vpn/DeleteVpnGatewayCmd.java
@@ -43,9 +43,6 @@ public class DeleteVpnGatewayCmd extends BaseAsyncCmd {
/////////////////// Accessors ///////////////////////
/////////////////////////////////////////////////////
- public String getEntityTable() {
- return "s2s_vpn_gateway";
- }
public Long getId() {
return id;
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/7f8262d4/api/src/org/apache/cloudstack/api/command/user/vpn/ResetVpnConnectionCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/vpn/ResetVpnConnectionCmd.java b/api/src/org/apache/cloudstack/api/command/user/vpn/ResetVpnConnectionCmd.java
index 0d7632a..ed28ea5 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vpn/ResetVpnConnectionCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vpn/ResetVpnConnectionCmd.java
@@ -53,9 +53,6 @@ public class ResetVpnConnectionCmd extends BaseAsyncCmd {
/////////////////// Accessors ///////////////////////
/////////////////////////////////////////////////////
- public String getEntityTable() {
- return "s2s_vpn_connection";
- }
public Long getDomainId() {
return domainId;
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/7f8262d4/api/src/org/apache/cloudstack/api/command/user/vpn/UpdateVpnCustomerGatewayCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/vpn/UpdateVpnCustomerGatewayCmd.java b/api/src/org/apache/cloudstack/api/command/user/vpn/UpdateVpnCustomerGatewayCmd.java
index f2778e0..7564129 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vpn/UpdateVpnCustomerGatewayCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vpn/UpdateVpnCustomerGatewayCmd.java
@@ -78,11 +78,7 @@ public class UpdateVpnCustomerGatewayCmd extends BaseAsyncCmd {
/////////////////// Accessors ///////////////////////
/////////////////////////////////////////////////////
- public String getEntityTable() {
- return "s2s_customer_gateway";
- }
-
- public Long getId() {
+ public Long getId() {
return id;
}
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/7f8262d4/api/src/org/apache/cloudstack/api/response/CapacityResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/CapacityResponse.java b/api/src/org/apache/cloudstack/api/response/CapacityResponse.java
index 0007058..2c98dc9 100644
--- a/api/src/org/apache/cloudstack/api/response/CapacityResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/CapacityResponse.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;
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/7f8262d4/api/src/org/apache/cloudstack/api/response/CreateCmdResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/CreateCmdResponse.java b/api/src/org/apache/cloudstack/api/response/CreateCmdResponse.java
index 3c26324..e4c6c60 100644
--- a/api/src/org/apache/cloudstack/api/response/CreateCmdResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/CreateCmdResponse.java
@@ -16,24 +16,16 @@
// under the License.
package org.apache.cloudstack.api.response;
-import org.apache.cloudstack.api.ApiConstants;
-import com.cloud.utils.IdentityProxy;
-import com.google.gson.annotations.SerializedName;
import org.apache.cloudstack.api.BaseResponse;
public class CreateCmdResponse extends BaseResponse {
- @SerializedName(ApiConstants.ID)
- private IdentityProxy id = new IdentityProxy();
+ private String id;
- public Long getId() {
- return id.getValue();
+ public String getId() {
+ return id;
}
- public void setId(Long id) {
- this.id.setValue(id);
- }
-
- public void setIdEntityTable(String entityTable) {
- this.id.setTableName(entityTable);
+ public void setId(String id) {
+ this.id = id;
}
}
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/7f8262d4/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 9e62f4f..7a29194 100644
--- a/api/src/org/apache/cloudstack/api/response/ResourceCountResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/ResourceCountResponse.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;
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/7f8262d4/api/src/org/apache/cloudstack/api/response/S3Response.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/S3Response.java b/api/src/org/apache/cloudstack/api/response/S3Response.java
index 5dd0ef0..4dab217 100644
--- a/api/src/org/apache/cloudstack/api/response/S3Response.java
+++ b/api/src/org/apache/cloudstack/api/response/S3Response.java
@@ -19,7 +19,6 @@
package org.apache.cloudstack.api.response;
import com.cloud.serializer.Param;
-import com.cloud.utils.IdentityProxy;
import com.google.gson.annotations.SerializedName;
import org.apache.cloudstack.api.BaseResponse;
@@ -29,7 +28,7 @@ public class S3Response extends BaseResponse {
@SerializedName(ID)
@Param(description = "The ID of the S3 configuration")
- private IdentityProxy id = new IdentityProxy("s3");
+ private String id;
@SerializedName(S3_ACCESS_KEY)
@Param(description = "The S3 access key")
@@ -135,11 +134,11 @@ public class S3Response extends BaseResponse {
@Override
public String getObjectId() {
- return this.id.getValue().toString();
+ return this.id;
}
- public void setObjectId(Long id) {
- this.id.setValue(id);
+ public void setObjectId(String id) {
+ this.id = id;
}
public String getAccessKey() {
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/7f8262d4/server/src/com/cloud/api/ApiGsonHelper.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/api/ApiGsonHelper.java b/server/src/com/cloud/api/ApiGsonHelper.java
index 6e64f71..6163860 100644
--- a/server/src/com/cloud/api/ApiGsonHelper.java
+++ b/server/src/com/cloud/api/ApiGsonHelper.java
@@ -17,7 +17,6 @@
package com.cloud.api;
import com.google.gson.GsonBuilder;
-import com.cloud.utils.IdentityProxy;
import org.apache.cloudstack.api.ResponseObject;
import java.util.Map;
@@ -28,7 +27,6 @@ public class ApiGsonHelper {
s_gBuilder = new GsonBuilder().setDateFormat("yyyy-MM-dd'T'HH:mm:ssZ");
s_gBuilder.setVersion(1.3);
s_gBuilder.registerTypeAdapter(ResponseObject.class, new ResponseObjectTypeAdapter());
- s_gBuilder.registerTypeAdapter(IdentityProxy.class, new IdentityTypeAdapter());
s_gBuilder.registerTypeAdapter(Map.class, new StringMapTypeAdapter());
}
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/7f8262d4/server/src/com/cloud/api/ApiResponseGsonHelper.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/api/ApiResponseGsonHelper.java b/server/src/com/cloud/api/ApiResponseGsonHelper.java
index c71193e..6bccf9a 100644
--- a/server/src/com/cloud/api/ApiResponseGsonHelper.java
+++ b/server/src/com/cloud/api/ApiResponseGsonHelper.java
@@ -17,7 +17,6 @@
package com.cloud.api;
import com.google.gson.GsonBuilder;
-import com.cloud.utils.IdentityProxy;
import org.apache.cloudstack.api.ResponseObject;
/**
@@ -25,13 +24,12 @@ import org.apache.cloudstack.api.ResponseObject;
*/
public class ApiResponseGsonHelper {
private static final GsonBuilder s_gBuilder;
-
+
static {
s_gBuilder = new GsonBuilder().setDateFormat("yyyy-MM-dd'T'HH:mm:ssZ");
s_gBuilder.setVersion(1.3);
s_gBuilder.registerTypeAdapter(ResponseObject.class, new ResponseObjectTypeAdapter());
s_gBuilder.registerTypeAdapter(String.class, new EncodedStringTypeAdapter());
- s_gBuilder.registerTypeAdapter(IdentityProxy.class, new IdentityTypeAdapter());
}
public static GsonBuilder getBuilder() {
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/7f8262d4/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 4775439..edb798b 100755
--- a/server/src/com/cloud/api/ApiResponseHelper.java
+++ b/server/src/com/cloud/api/ApiResponseHelper.java
@@ -482,7 +482,7 @@ public class ApiResponseHelper implements ResponseGenerator {
response.setEndPoint(result.getEndPoint());
response.setHttpsFlag(result.getHttpsFlag());
response.setMaxErrorRetry(result.getMaxErrorRetry());
- response.setObjectId(result.getId());
+ response.setObjectId(result.getUuid());
response.setSecretKey(result.getSecretKey());
response.setSocketTimeout(result.getSocketTimeout());
response.setTemplateBucketName(result.getBucketName());
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/7f8262d4/server/src/com/cloud/api/ApiServer.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/api/ApiServer.java b/server/src/com/cloud/api/ApiServer.java
index 519908d..17a2b29 100755
--- a/server/src/com/cloud/api/ApiServer.java
+++ b/server/src/com/cloud/api/ApiServer.java
@@ -400,12 +400,12 @@ public class ApiServer implements HttpRequestHandler {
// BaseAsyncCmd: cmd is processed and submitted as an AsyncJob, job related info is serialized and returned.
if (cmdObj instanceof BaseAsyncCmd) {
Long objectId = null;
- String objectEntityTable = null;
+ String objectUuid = null;
if (cmdObj instanceof BaseAsyncCreateCmd) {
BaseAsyncCreateCmd createCmd = (BaseAsyncCreateCmd) cmdObj;
_dispatcher.dispatchCreateCmd(createCmd, params);
objectId = createCmd.getEntityId();
- objectEntityTable = createCmd.getEntityTable();
+ objectUuid = createCmd.getEntityUuid();
params.put("id", objectId.toString());
} else {
ApiDispatcher.processParameters(cmdObj, params);
@@ -449,8 +449,8 @@ public class ApiServer implements HttpRequestHandler {
}
if (objectId != null) {
- SerializationContext.current().setUuidTranslation(true);
- return ((BaseAsyncCreateCmd) asyncCmd).getResponse(jobId, objectId, objectEntityTable);
+ String objUuid = (objectUuid == null) ? objectId.toString() : objectUuid;
+ return ((BaseAsyncCreateCmd) asyncCmd).getResponse(jobId, objUuid);
}
SerializationContext.current().setUuidTranslation(true);
@@ -460,6 +460,7 @@ public class ApiServer implements HttpRequestHandler {
// if the command is of the listXXXCommand, we will need to also return the
// the job id and status if possible
+ // For those listXXXCommand which we have already created DB views, this step is not needed since async job is joined in their db views.
if (cmdObj instanceof BaseListCmd && !(cmdObj instanceof ListVMsCmd) && !(cmdObj instanceof ListRoutersCmd)
&& !(cmdObj instanceof ListSecurityGroupsCmd)
&& !(cmdObj instanceof ListTagsCmd)
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/7f8262d4/server/src/com/cloud/api/IdentityTypeAdapter.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/api/IdentityTypeAdapter.java b/server/src/com/cloud/api/IdentityTypeAdapter.java
deleted file mode 100644
index 369c202..0000000
--- a/server/src/com/cloud/api/IdentityTypeAdapter.java
+++ /dev/null
@@ -1,80 +0,0 @@
-// 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
-// regarding copyright ownership. The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied. See the License for the
-// specific language governing permissions and limitations
-// under the License.
-package com.cloud.api;
-
-import java.lang.reflect.Type;
-
-import com.cloud.uuididentity.dao.IdentityDao;
-import com.cloud.uuididentity.dao.IdentityDaoImpl;
-import com.google.gson.Gson;
-import com.google.gson.JsonDeserializationContext;
-import com.google.gson.JsonDeserializer;
-import com.google.gson.JsonElement;
-import com.google.gson.JsonObject;
-import com.google.gson.JsonParseException;
-import com.google.gson.JsonPrimitive;
-import com.google.gson.JsonSerializationContext;
-import com.google.gson.JsonSerializer;
-import com.cloud.utils.IdentityProxy;
-
-
-public class IdentityTypeAdapter implements JsonSerializer<IdentityProxy>, JsonDeserializer<IdentityProxy> {
-
- @Override
- public JsonElement serialize(IdentityProxy src, Type srcType, JsonSerializationContext context) {
- if(SerializationContext.current().getUuidTranslation()) {
- assert(src != null);
- if(src.getValue() == null)
- return context.serialize(null);
-
- IdentityDao identityDao = new IdentityDaoImpl();
- if(src.getTableName() != null) {
- String uuid = identityDao.getIdentityUuid(src.getTableName(), String.valueOf(src.getValue()));
- if(uuid == null)
- return context.serialize(null);
-
- // Exceptions set the _idFieldName in the IdentityProxy structure. So if this field is not
- // null, prepare a structure of uuid and idFieldName and return the json representation of that.
- String idName = src.getidFieldName();
- if (idName != null) {
- // Prepare a structure.
- JsonObject jsonObj = new JsonObject();
- jsonObj.add("uuid", new JsonPrimitive(uuid));
- jsonObj.add("uuidProperty", new JsonPrimitive(idName));
- return jsonObj;
- }
- return new JsonPrimitive(uuid);
- } else {
- return new JsonPrimitive(String.valueOf(src.getValue()));
- }
- } else {
- return new Gson().toJsonTree(src);
- }
- }
-
- @Override
- public IdentityProxy deserialize(JsonElement src, Type srcType,
- JsonDeserializationContext context) throws JsonParseException {
-
- IdentityProxy obj = new IdentityProxy();
- JsonObject json = src.getAsJsonObject();
- obj.setTableName(json.get("_tableName").getAsString());
- if(json.get("_value") != null)
- obj.setValue(json.get("_value").getAsLong());
- return obj;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/7f8262d4/server/src/com/cloud/api/response/ApiResponseSerializer.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/api/response/ApiResponseSerializer.java b/server/src/com/cloud/api/response/ApiResponseSerializer.java
index 470cc5f..11aee3d 100644
--- a/server/src/com/cloud/api/response/ApiResponseSerializer.java
+++ b/server/src/com/cloud/api/response/ApiResponseSerializer.java
@@ -37,7 +37,6 @@ import com.cloud.api.ApiResponseGsonHelper;
import com.cloud.api.ApiServer;
import org.apache.cloudstack.api.BaseCmd;
import org.apache.cloudstack.api.ResponseObject;
-import com.cloud.utils.IdentityProxy;
import com.cloud.utils.encoding.URLEncoder;
import com.cloud.utils.exception.CloudRuntimeException;
import com.cloud.uuididentity.dao.IdentityDao;
@@ -226,27 +225,17 @@ public class ApiResponseSerializer {
subObj.setObjectName(serializedName.value());
}
serializeResponseObjXML(sb, subObj);
- } else if (value instanceof IdentityProxy) {
- // Only exception reponses carry a list of IdentityProxy objects.
- IdentityProxy idProxy = (IdentityProxy)value;
- String id = (idProxy.getValue() != null ? String.valueOf(idProxy.getValue()) : "");
- if(!id.isEmpty()) {
- IdentityDao identityDao = new IdentityDaoImpl();
- id = identityDao.getIdentityUuid(idProxy.getTableName(), id);
- }
- if(id != null && !id.isEmpty()) {
- // If this is the first IdentityProxy field encountered, put in a uuidList tag.
- if (!usedUuidList) {
- sb.append("<").append(serializedName.value()).append(">");
- usedUuidList = true;
- }
- sb.append("<uuid>").append(id).append("</uuid>");
- }
- // Append the new idFieldName property also.
- String idFieldName = idProxy.getidFieldName();
- if (idFieldName != null) {
- sb.append("<uuidProperty>").append(idFieldName).append("</uuidProperty>");
- }
+ } else {
+ // Only exception reponses carry a list of uuid
+ // strings.
+ // If this is the first IdentityProxy field
+ // encountered, put in a uuidList tag.
+ if (!usedUuidList) {
+ sb.append("<").append(serializedName.value()).append(">");
+ usedUuidList = true;
+ }
+ sb.append("<uuid>").append(value).append("</uuid>");
+ // We have removed uuid property field due to removal of IdentityProxy class.
}
}
if (usedUuidList) {
@@ -256,19 +245,6 @@ public class ApiResponseSerializer {
} else if (fieldValue instanceof Date) {
sb.append("<").append(serializedName.value()).append(">").append(BaseCmd.getDateString((Date) fieldValue)).
append("</").append(serializedName.value()).append(">");
- } else if (fieldValue instanceof IdentityProxy) {
- IdentityProxy idProxy = (IdentityProxy)fieldValue;
- String id = (idProxy.getValue() != null ? String.valueOf(idProxy.getValue()) : "");
- if(!id.isEmpty()) {
- IdentityDao identityDao = new IdentityDaoImpl();
- if(idProxy.getTableName() != null) {
- id = identityDao.getIdentityUuid(idProxy.getTableName(), id);
- } else {
- s_logger.warn("IdentityProxy sanity check issue, invalid IdentityProxy table name found in class: " + obj.getClass().getName());
- }
- }
- if(id != null && !id.isEmpty())
- sb.append("<").append(serializedName.value()).append(">").append(id).append("</").append(serializedName.value()).append(">");
} else {
String resultString = escapeSpecialXmlChars(fieldValue.toString());
if (!(obj instanceof ExceptionResponse)) {
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/7f8262d4/server/src/com/cloud/server/ConfigurationServerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/server/ConfigurationServerImpl.java b/server/src/com/cloud/server/ConfigurationServerImpl.java
index af5989c..b25c63f 100755
--- a/server/src/com/cloud/server/ConfigurationServerImpl.java
+++ b/server/src/com/cloud/server/ConfigurationServerImpl.java
@@ -103,7 +103,6 @@ public class ConfigurationServerImpl implements ConfigurationServer {
private final AccountDao _accountDao;
private final ResourceCountDao _resourceCountDao;
private final NetworkOfferingServiceMapDao _ntwkOfferingServiceMapDao;
- private final IdentityDao _identityDao;
public ConfigurationServerImpl() {
ComponentLocator locator = ComponentLocator.getLocator(Name);
@@ -120,7 +119,6 @@ public class ConfigurationServerImpl implements ConfigurationServer {
_accountDao = locator.getDao(AccountDao.class);
_resourceCountDao = locator.getDao(ResourceCountDao.class);
_ntwkOfferingServiceMapDao = locator.getDao(NetworkOfferingServiceMapDao.class);
- _identityDao = locator.getDao(IdentityDao.class);
}
@Override
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/7f8262d4/utils/src/com/cloud/utils/IdentityProxy.java
----------------------------------------------------------------------
diff --git a/utils/src/com/cloud/utils/IdentityProxy.java b/utils/src/com/cloud/utils/IdentityProxy.java
deleted file mode 100644
index 7e385fb..0000000
--- a/utils/src/com/cloud/utils/IdentityProxy.java
+++ /dev/null
@@ -1,60 +0,0 @@
-// 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
-// regarding copyright ownership. The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied. See the License for the
-// specific language governing permissions and limitations
-// under the License.
-package com.cloud.utils;
-
-public class IdentityProxy {
- private String _tableName;
- private Long _value;
- private String _idFieldName;
-
- public IdentityProxy() {
- }
-
- public IdentityProxy(String tableName) {
- _tableName = tableName;
- }
-
- public IdentityProxy(String tableName, Long id, String fieldName) {
- _tableName = tableName;
- _value = id;
- _idFieldName = fieldName;
- }
-
- public String getTableName() {
- return _tableName;
- }
-
- public void setTableName(String tableName) {
- _tableName = tableName;
- }
-
- public Long getValue() {
- return _value;
- }
-
- public void setValue(Long value) {
- _value = value;
- }
-
- public void setidFieldName(String value) {
- _idFieldName = value;
- }
-
- public String getidFieldName() {
- return _idFieldName;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/7f8262d4/utils/src/com/cloud/utils/exception/RuntimeCloudException.java
----------------------------------------------------------------------
diff --git a/utils/src/com/cloud/utils/exception/RuntimeCloudException.java b/utils/src/com/cloud/utils/exception/RuntimeCloudException.java
index 2334696..5222980 100644
--- a/utils/src/com/cloud/utils/exception/RuntimeCloudException.java
+++ b/utils/src/com/cloud/utils/exception/RuntimeCloudException.java
@@ -17,7 +17,6 @@
package com.cloud.utils.exception;
import com.cloud.utils.AnnotationHelper;
-import com.cloud.utils.IdentityProxy;
import java.util.ArrayList;
/**