From 7e9579dab2b70d16bc006d64b7db1e6f2c1f9c50 Mon Sep 17 00:00:00 2001 From: alena Date: Thu, 9 Dec 2010 18:58:18 -0800 Subject: [PATCH] Fixed create/list LoadBalancerRules --- api/src/com/cloud/api/BaseAsyncCmd.java | 2 +- api/src/com/cloud/api/BaseAsyncCreateCmd.java | 2 +- api/src/com/cloud/api/BaseCmd.java | 14 +- .../com/cloud/api/commands/AddHostCmd.java | 4 +- .../api/commands/AddSecondaryStorageCmd.java | 4 +- .../com/cloud/api/commands/AddVpnUserCmd.java | 4 +- .../commands/AssignToLoadBalancerRuleCmd.java | 4 +- .../api/commands/AssociateIPAddrCmd.java | 4 +- .../com/cloud/api/commands/AttachIsoCmd.java | 2 +- .../cloud/api/commands/AttachVolumeCmd.java | 4 +- .../AuthorizeNetworkGroupIngressCmd.java | 2 +- .../api/commands/CancelMaintenanceCmd.java | 4 +- .../CancelPrimaryStorageMaintenanceCmd.java | 4 +- .../com/cloud/api/commands/CopyIsoCmd.java | 4 +- .../cloud/api/commands/CopyTemplateCmd.java | 4 +- .../com/cloud/api/commands/CreateCfgCmd.java | 4 +- .../api/commands/CreateDiskOfferingCmd.java | 4 +- .../cloud/api/commands/CreateDomainCmd.java | 4 +- .../commands/CreateIpForwardingRuleCmd.java | 4 +- .../commands/CreateLoadBalancerRuleCmd.java | 40 +-- .../cloud/api/commands/CreateNetworkCmd.java | 4 +- .../api/commands/CreateNetworkGroupCmd.java | 4 +- .../commands/CreateNetworkOfferingCmd.java | 4 +- .../com/cloud/api/commands/CreatePodCmd.java | 4 +- .../commands/CreatePortForwardingRuleCmd.java | 4 +- .../commands/CreateRemoteAccessVpnCmd.java | 4 +- .../commands/CreateServiceOfferingCmd.java | 4 +- .../cloud/api/commands/CreateSnapshotCmd.java | 4 +- .../api/commands/CreateSnapshotPolicyCmd.java | 4 +- .../api/commands/CreateStoragePoolCmd.java | 4 +- .../cloud/api/commands/CreateTemplateCmd.java | 4 +- .../com/cloud/api/commands/CreateUserCmd.java | 4 +- .../cloud/api/commands/CreateVMGroupCmd.java | 4 +- .../api/commands/CreateVlanIpRangeCmd.java | 4 +- .../cloud/api/commands/CreateVolumeCmd.java | 4 +- .../com/cloud/api/commands/CreateZoneCmd.java | 4 +- .../api/commands/DeleteDiskOfferingCmd.java | 4 +- .../cloud/api/commands/DeleteDomainCmd.java | 4 +- .../com/cloud/api/commands/DeleteHostCmd.java | 4 +- .../commands/DeleteIpForwardingRuleCmd.java | 4 +- .../com/cloud/api/commands/DeleteIsoCmd.java | 4 +- .../commands/DeleteLoadBalancerRuleCmd.java | 4 +- .../cloud/api/commands/DeleteNetworkCmd.java | 4 +- .../api/commands/DeleteNetworkGroupCmd.java | 4 +- .../commands/DeleteNetworkOfferingCmd.java | 4 +- .../com/cloud/api/commands/DeletePodCmd.java | 4 +- .../com/cloud/api/commands/DeletePoolCmd.java | 4 +- .../commands/DeletePortForwardingRuleCmd.java | 4 +- .../commands/DeletePreallocatedLunCmd.java | 4 +- .../commands/DeleteRemoteAccessVpnCmd.java | 4 +- .../commands/DeleteServiceOfferingCmd.java | 4 +- .../cloud/api/commands/DeleteSnapshotCmd.java | 4 +- .../commands/DeleteSnapshotPoliciesCmd.java | 4 +- .../cloud/api/commands/DeleteTemplateCmd.java | 4 +- .../com/cloud/api/commands/DeleteUserCmd.java | 4 +- .../cloud/api/commands/DeleteVMGroupCmd.java | 4 +- .../api/commands/DeleteVlanIpRangeCmd.java | 4 +- .../cloud/api/commands/DeleteVolumeCmd.java | 4 +- .../com/cloud/api/commands/DeleteZoneCmd.java | 4 +- .../com/cloud/api/commands/DeployVMCmd.java | 4 +- .../api/commands/DestroyConsoleProxyCmd.java | 4 +- .../com/cloud/api/commands/DestroyVMCmd.java | 2 +- .../com/cloud/api/commands/DetachIsoCmd.java | 2 +- .../cloud/api/commands/DetachVolumeCmd.java | 2 +- .../cloud/api/commands/DisableAccountCmd.java | 4 +- .../cloud/api/commands/DisableUserCmd.java | 4 +- .../api/commands/DisassociateIPAddrCmd.java | 4 +- .../cloud/api/commands/EnableAccountCmd.java | 4 +- .../com/cloud/api/commands/EnableUserCmd.java | 4 +- .../com/cloud/api/commands/ExtractIsoCmd.java | 4 +- .../api/commands/ExtractTemplateCmd.java | 4 +- .../cloud/api/commands/ExtractVolumeCmd.java | 4 +- .../api/commands/GetCloudIdentifierCmd.java | 4 +- .../cloud/api/commands/ListAccountsCmd.java | 4 +- .../com/cloud/api/commands/ListAlertsCmd.java | 4 +- .../cloud/api/commands/ListAsyncJobsCmd.java | 4 +- .../api/commands/ListCapabilitiesCmd.java | 4 +- .../cloud/api/commands/ListCapacityCmd.java | 4 +- .../com/cloud/api/commands/ListCfgsByCmd.java | 4 +- .../cloud/api/commands/ListClustersCmd.java | 4 +- .../api/commands/ListDiskOfferingsCmd.java | 4 +- .../api/commands/ListDomainChildrenCmd.java | 4 +- .../cloud/api/commands/ListDomainsCmd.java | 4 +- .../com/cloud/api/commands/ListEventsCmd.java | 4 +- .../commands/ListGuestOsCategoriesCmd.java | 4 +- .../cloud/api/commands/ListGuestOsCmd.java | 4 +- .../com/cloud/api/commands/ListHostsCmd.java | 4 +- .../api/commands/ListHypervisorsCmd.java | 4 +- .../commands/ListIpForwardingRulesCmd.java | 4 +- .../com/cloud/api/commands/ListIsosCmd.java | 4 +- .../ListLoadBalancerRuleInstancesCmd.java | 15 +- .../commands/ListLoadBalancerRulesCmd.java | 4 +- .../api/commands/ListNetworkGroupsCmd.java | 4 +- .../api/commands/ListNetworkOfferingsCmd.java | 4 +- .../cloud/api/commands/ListNetworksCmd.java | 4 +- .../com/cloud/api/commands/ListPodsByCmd.java | 4 +- .../commands/ListPortForwardingRulesCmd.java | 4 +- .../api/commands/ListPreallocatedLunsCmd.java | 4 +- .../commands/ListPublicIpAddressesCmd.java | 4 +- .../ListRecurringSnapshotScheduleCmd.java | 4 +- .../api/commands/ListRemoteAccessVpnsCmd.java | 4 +- .../api/commands/ListResourceLimitsCmd.java | 4 +- .../cloud/api/commands/ListRoutersCmd.java | 4 +- .../api/commands/ListServiceOfferingsCmd.java | 4 +- .../api/commands/ListSnapshotPoliciesCmd.java | 4 +- .../cloud/api/commands/ListSnapshotsCmd.java | 4 +- .../api/commands/ListStoragePoolsCmd.java | 4 +- .../cloud/api/commands/ListSystemVMsCmd.java | 4 +- .../ListTemplateOrIsoPermissionsCmd.java | 4 +- .../cloud/api/commands/ListTemplatesCmd.java | 4 +- .../com/cloud/api/commands/ListUsersCmd.java | 4 +- .../cloud/api/commands/ListVMGroupsCmd.java | 4 +- .../com/cloud/api/commands/ListVMsCmd.java | 4 +- .../api/commands/ListVlanIpRangesCmd.java | 4 +- .../cloud/api/commands/ListVolumesCmd.java | 4 +- .../cloud/api/commands/ListVpnUsersCmd.java | 4 +- .../cloud/api/commands/ListZonesByCmd.java | 4 +- .../cloud/api/commands/LockAccountCmd.java | 4 +- .../com/cloud/api/commands/LockUserCmd.java | 4 +- .../commands/PrepareForMaintenanceCmd.java | 2 +- ...reparePrimaryStorageForMaintenanceCmd.java | 2 +- .../api/commands/QueryAsyncJobResultCmd.java | 4 +- .../cloud/api/commands/RebootRouterCmd.java | 2 +- .../cloud/api/commands/RebootSystemVmCmd.java | 4 +- .../com/cloud/api/commands/RebootVMCmd.java | 4 +- .../cloud/api/commands/ReconnectHostCmd.java | 4 +- .../com/cloud/api/commands/RecoverVMCmd.java | 4 +- .../com/cloud/api/commands/RegisterCmd.java | 4 +- .../cloud/api/commands/RegisterIsoCmd.java | 4 +- .../commands/RegisterPreallocatedLunCmd.java | 4 +- .../api/commands/RegisterTemplateCmd.java | 4 +- .../RemoveFromLoadBalancerRuleCmd.java | 4 +- .../cloud/api/commands/RemoveVpnUserCmd.java | 4 +- .../api/commands/ResetVMPasswordCmd.java | 4 +- .../RevokeNetworkGroupIngressCmd.java | 4 +- .../cloud/api/commands/SetVMOSTypeCmd.java | 2 +- .../cloud/api/commands/StartRouterCmd.java | 4 +- .../cloud/api/commands/StartSystemVMCmd.java | 4 +- .../com/cloud/api/commands/StartVMCmd.java | 4 +- .../com/cloud/api/commands/StopRouterCmd.java | 4 +- .../cloud/api/commands/StopSystemVmCmd.java | 4 +- api/src/com/cloud/api/commands/StopVMCmd.java | 4 +- .../cloud/api/commands/UpdateAccountCmd.java | 4 +- .../com/cloud/api/commands/UpdateCfgCmd.java | 4 +- .../api/commands/UpdateDiskOfferingCmd.java | 4 +- .../cloud/api/commands/UpdateDomainCmd.java | 4 +- .../com/cloud/api/commands/UpdateHostCmd.java | 4 +- .../com/cloud/api/commands/UpdateIsoCmd.java | 4 +- .../api/commands/UpdateIsoPermissionsCmd.java | 2 +- .../commands/UpdateLoadBalancerRuleCmd.java | 4 +- .../com/cloud/api/commands/UpdatePodCmd.java | 4 +- .../commands/UpdatePortForwardingRuleCmd.java | 2 +- .../api/commands/UpdateResourceLimitCmd.java | 4 +- .../commands/UpdateServiceOfferingCmd.java | 4 +- .../api/commands/UpdateStoragePoolCmd.java | 4 +- .../cloud/api/commands/UpdateTemplateCmd.java | 4 +- .../UpdateTemplateOrIsoPermissionsCmd.java | 2 +- .../UpdateTemplatePermissionsCmd.java | 2 +- .../com/cloud/api/commands/UpdateUserCmd.java | 4 +- .../com/cloud/api/commands/UpdateVMCmd.java | 4 +- .../cloud/api/commands/UpdateVMGroupCmd.java | 4 +- .../com/cloud/api/commands/UpdateZoneCmd.java | 4 +- .../cloud/api/commands/UpgradeRouterCmd.java | 4 +- .../com/cloud/api/commands/UpgradeVMCmd.java | 4 +- .../commands/UploadCustomCertificateCmd.java | 4 +- server/src/com/cloud/api/ApiDispatcher.java | 20 +- .../com/cloud/async/AsyncJobManagerImpl.java | 2 +- .../src/com/cloud/network/LoadBalancerVO.java | 6 +- .../com/cloud/network/NetworkManagerImpl.java | 10 +- .../lb/LoadBalancingRulesManagerImpl.java | 335 +++++++++--------- .../cloud/server/ManagementServerImpl.java | 2 +- 171 files changed, 516 insertions(+), 546 deletions(-) diff --git a/api/src/com/cloud/api/BaseAsyncCmd.java b/api/src/com/cloud/api/BaseAsyncCmd.java index 3502700ffc9..69a18f3ce39 100644 --- a/api/src/com/cloud/api/BaseAsyncCmd.java +++ b/api/src/com/cloud/api/BaseAsyncCmd.java @@ -58,7 +58,7 @@ public abstract class BaseAsyncCmd extends BaseCmd { public ResponseObject getResponse(long jobId) { AsyncJobResponse response = new AsyncJobResponse(); response.setId(jobId); - response.setResponseName(getName()); + response.setResponseName(getCommandName()); return response; } diff --git a/api/src/com/cloud/api/BaseAsyncCreateCmd.java b/api/src/com/cloud/api/BaseAsyncCreateCmd.java index d6f6a75ddb1..93a0c2ef9c5 100644 --- a/api/src/com/cloud/api/BaseAsyncCreateCmd.java +++ b/api/src/com/cloud/api/BaseAsyncCreateCmd.java @@ -20,7 +20,7 @@ public abstract class BaseAsyncCreateCmd extends BaseAsyncCmd { CreateCmdResponse response = new CreateCmdResponse(); response.setJobId(jobId); response.setId(objectId); - response.setResponseName(getName()); + response.setResponseName(getCommandName()); return _responseGenerator.toSerializedString(response, getResponseType()); } } diff --git a/api/src/com/cloud/api/BaseCmd.java b/api/src/com/cloud/api/BaseCmd.java index dbeacde19bb..f7d484748c1 100755 --- a/api/src/com/cloud/api/BaseCmd.java +++ b/api/src/com/cloud/api/BaseCmd.java @@ -139,7 +139,7 @@ public abstract class BaseCmd { this.responseType = responseType; } - public abstract String getName(); + public abstract String getCommandName(); public Object getResponseObject() { return _responseObject; @@ -342,14 +342,14 @@ public abstract class BaseCmd { StringBuffer sb = new StringBuffer(); if (RESPONSE_TYPE_JSON.equalsIgnoreCase(responseType)) { // JSON response - sb.append("{ \"" + getName() + "\" : { " + "\"@attributes\":{\"cloud-stack-version\":\""+_mgr.getVersion()+"\"},"); + sb.append("{ \"" + getCommandName() + "\" : { " + "\"@attributes\":{\"cloud-stack-version\":\""+_mgr.getVersion()+"\"},"); sb.append("\"errorcode\" : \"" + apiException.getErrorCode() + "\", \"description\" : \"" + apiException.getDescription() + "\" } }"); } else { sb.append(""); - sb.append("<" + getName() + ">"); + sb.append("<" + getCommandName() + ">"); sb.append("" + apiException.getErrorCode() + ""); sb.append("" + escapeXml(apiException.getDescription()) + ""); - sb.append(""); + sb.append(""); } return sb.toString(); } @@ -360,10 +360,10 @@ public abstract class BaseCmd { // set up the return value with the name of the response if (RESPONSE_TYPE_JSON.equalsIgnoreCase(responseType)) { - prefixSb.append("{ \"" + getName() + "\" : { \"@attributes\":{\"cloud-stack-version\":\""+ _mgr.getVersion()+"\"},"); + prefixSb.append("{ \"" + getCommandName() + "\" : { \"@attributes\":{\"cloud-stack-version\":\""+ _mgr.getVersion()+"\"},"); } else { prefixSb.append(""); - prefixSb.append("<" + getName() + " cloud-stack-version=\""+_mgr.getVersion()+ "\">"); + prefixSb.append("<" + getCommandName() + " cloud-stack-version=\""+_mgr.getVersion()+ "\">"); } int i = 0; @@ -391,7 +391,7 @@ public abstract class BaseCmd { if (RESPONSE_TYPE_JSON.equalsIgnoreCase(responseType)) { prefixSb.append("} }"); } else { - prefixSb.append(""); + prefixSb.append(""); } return prefixSb.toString(); } diff --git a/api/src/com/cloud/api/commands/AddHostCmd.java b/api/src/com/cloud/api/commands/AddHostCmd.java index 4674c69a14a..2c75d070cc3 100644 --- a/api/src/com/cloud/api/commands/AddHostCmd.java +++ b/api/src/com/cloud/api/commands/AddHostCmd.java @@ -101,7 +101,7 @@ public class AddHostCmd extends BaseCmd { ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -121,7 +121,7 @@ public class AddHostCmd extends BaseCmd { } response.setResponses(hostResponses); - response.setResponseName(getName()); + response.setResponseName(getCommandName()); this.setResponseObject(response); } catch (DiscoveryException ex) { diff --git a/api/src/com/cloud/api/commands/AddSecondaryStorageCmd.java b/api/src/com/cloud/api/commands/AddSecondaryStorageCmd.java index 91a8a380465..24df163a9fb 100644 --- a/api/src/com/cloud/api/commands/AddSecondaryStorageCmd.java +++ b/api/src/com/cloud/api/commands/AddSecondaryStorageCmd.java @@ -63,7 +63,7 @@ public class AddSecondaryStorageCmd extends BaseCmd { ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -76,7 +76,7 @@ public class AddSecondaryStorageCmd extends BaseCmd { for (Host host : result) { // There should only be one secondary storage host per add hostResponse = _responseGenerator.createHostResponse(host); - hostResponse.setResponseName(getName()); + hostResponse.setResponseName(getCommandName()); hostResponse.setObjectName("secondarystorage"); this.setResponseObject(hostResponse); } diff --git a/api/src/com/cloud/api/commands/AddVpnUserCmd.java b/api/src/com/cloud/api/commands/AddVpnUserCmd.java index 61d56fd6ea0..46a00821520 100644 --- a/api/src/com/cloud/api/commands/AddVpnUserCmd.java +++ b/api/src/com/cloud/api/commands/AddVpnUserCmd.java @@ -88,7 +88,7 @@ public class AddVpnUserCmd extends BaseAsyncCmd { ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -139,7 +139,7 @@ public class AddVpnUserCmd extends BaseAsyncCmd { vpnResponse.setDomainName(_entityMgr.findById(Domain.class, accountTemp.getDomainId()).getName()); } - vpnResponse.setResponseName(getName()); + vpnResponse.setResponseName(getCommandName()); vpnResponse.setObjectName("vpnuser"); this.setResponseObject(vpnResponse); } else { diff --git a/api/src/com/cloud/api/commands/AssignToLoadBalancerRuleCmd.java b/api/src/com/cloud/api/commands/AssignToLoadBalancerRuleCmd.java index 9a002104536..30c3e8fd748 100644 --- a/api/src/com/cloud/api/commands/AssignToLoadBalancerRuleCmd.java +++ b/api/src/com/cloud/api/commands/AssignToLoadBalancerRuleCmd.java @@ -74,7 +74,7 @@ public class AssignToLoadBalancerRuleCmd extends BaseAsyncCmd { ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -111,7 +111,7 @@ public class AssignToLoadBalancerRuleCmd extends BaseAsyncCmd { } boolean result = _lbService.assignToLoadBalancer(getLoadBalancerId(), virtualMachineIds); if (result) { - SuccessResponse response = new SuccessResponse(getName()); + SuccessResponse response = new SuccessResponse(getCommandName()); this.setResponseObject(response); } else { throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to assign load balancer rule"); diff --git a/api/src/com/cloud/api/commands/AssociateIPAddrCmd.java b/api/src/com/cloud/api/commands/AssociateIPAddrCmd.java index 7d6cd191f54..fb7d6a2ca25 100644 --- a/api/src/com/cloud/api/commands/AssociateIPAddrCmd.java +++ b/api/src/com/cloud/api/commands/AssociateIPAddrCmd.java @@ -100,7 +100,7 @@ public class AssociateIPAddrCmd extends BaseCmd { @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -114,7 +114,7 @@ public class AssociateIPAddrCmd extends BaseCmd { IpAddress result = _networkService.associateIP(this); if (result != null) { IPAddressResponse ipResponse = _responseGenerator.createIPAddressResponse(result); - ipResponse.setResponseName(getName()); + ipResponse.setResponseName(getCommandName()); this.setResponseObject(ipResponse); } else { throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to assign ip address"); diff --git a/api/src/com/cloud/api/commands/AttachIsoCmd.java b/api/src/com/cloud/api/commands/AttachIsoCmd.java index d2b58e4feeb..d74d1c098f1 100755 --- a/api/src/com/cloud/api/commands/AttachIsoCmd.java +++ b/api/src/com/cloud/api/commands/AttachIsoCmd.java @@ -66,7 +66,7 @@ public class AttachIsoCmd extends BaseAsyncCmd { ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } diff --git a/api/src/com/cloud/api/commands/AttachVolumeCmd.java b/api/src/com/cloud/api/commands/AttachVolumeCmd.java index a753a8e455f..c8f4b0630a3 100755 --- a/api/src/com/cloud/api/commands/AttachVolumeCmd.java +++ b/api/src/com/cloud/api/commands/AttachVolumeCmd.java @@ -83,7 +83,7 @@ public class AttachVolumeCmd extends BaseAsyncCmd { ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -124,7 +124,7 @@ public class AttachVolumeCmd extends BaseAsyncCmd { Volume result = _userVmService.attachVolumeToVM(this); if (result != null) { VolumeResponse response = _responseGenerator.createVolumeResponse(result); - response.setResponseName(getName()); + response.setResponseName(getCommandName()); this.setResponseObject(response); } else { throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to attach volume"); diff --git a/api/src/com/cloud/api/commands/AuthorizeNetworkGroupIngressCmd.java b/api/src/com/cloud/api/commands/AuthorizeNetworkGroupIngressCmd.java index 2f29bffdccc..faaa3e66bde 100644 --- a/api/src/com/cloud/api/commands/AuthorizeNetworkGroupIngressCmd.java +++ b/api/src/com/cloud/api/commands/AuthorizeNetworkGroupIngressCmd.java @@ -144,7 +144,7 @@ public class AuthorizeNetworkGroupIngressCmd extends BaseAsyncCmd { ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } diff --git a/api/src/com/cloud/api/commands/CancelMaintenanceCmd.java b/api/src/com/cloud/api/commands/CancelMaintenanceCmd.java index cd38eb3bd94..835b8de05a2 100644 --- a/api/src/com/cloud/api/commands/CancelMaintenanceCmd.java +++ b/api/src/com/cloud/api/commands/CancelMaintenanceCmd.java @@ -61,7 +61,7 @@ public class CancelMaintenanceCmd extends BaseAsyncCmd { ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -102,7 +102,7 @@ public class CancelMaintenanceCmd extends BaseAsyncCmd { Host result = _resourceService.cancelMaintenance(this); if (result != null) { HostResponse response = _responseGenerator.createHostResponse(result); - response.setResponseName(getName()); + response.setResponseName(getCommandName()); this.setResponseObject(response); } else { throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to cancel host maintenance"); diff --git a/api/src/com/cloud/api/commands/CancelPrimaryStorageMaintenanceCmd.java b/api/src/com/cloud/api/commands/CancelPrimaryStorageMaintenanceCmd.java index 8f6fa8ba033..c571152bc60 100644 --- a/api/src/com/cloud/api/commands/CancelPrimaryStorageMaintenanceCmd.java +++ b/api/src/com/cloud/api/commands/CancelPrimaryStorageMaintenanceCmd.java @@ -61,7 +61,7 @@ public class CancelPrimaryStorageMaintenanceCmd extends BaseAsyncCmd { ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -102,7 +102,7 @@ public class CancelPrimaryStorageMaintenanceCmd extends BaseAsyncCmd { StoragePool result = _storageMgr.cancelPrimaryStorageForMaintenance(this); if (result != null) { StoragePoolResponse response = _responseGenerator.createStoragePoolResponse(result); - response.setResponseName(getName()); + response.setResponseName(getCommandName()); this.setResponseObject(response); } else { throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to cancel primary storage maintenance"); diff --git a/api/src/com/cloud/api/commands/CopyIsoCmd.java b/api/src/com/cloud/api/commands/CopyIsoCmd.java index 50e24c7450b..be1b2570d37 100644 --- a/api/src/com/cloud/api/commands/CopyIsoCmd.java +++ b/api/src/com/cloud/api/commands/CopyIsoCmd.java @@ -72,7 +72,7 @@ public class CopyIsoCmd extends BaseAsyncCmd { ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -114,7 +114,7 @@ public class CopyIsoCmd extends BaseAsyncCmd { try { VirtualMachineTemplate iso = _templateService.copyIso(this); TemplateResponse isoResponse = _responseGenerator.createIsoResponse3(iso, destZoneId); - isoResponse.setResponseName(getName()); + isoResponse.setResponseName(getCommandName()); this.setResponseObject(isoResponse); } catch (StorageUnavailableException ex) { s_logger.warn("Exception: ", ex); diff --git a/api/src/com/cloud/api/commands/CopyTemplateCmd.java b/api/src/com/cloud/api/commands/CopyTemplateCmd.java index 62f502cc3ca..abcb93e8923 100644 --- a/api/src/com/cloud/api/commands/CopyTemplateCmd.java +++ b/api/src/com/cloud/api/commands/CopyTemplateCmd.java @@ -73,7 +73,7 @@ public class CopyTemplateCmd extends BaseAsyncCmd { ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -115,7 +115,7 @@ public class CopyTemplateCmd extends BaseAsyncCmd { try { VirtualMachineTemplate template = _templateService.copyTemplate(this); TemplateResponse templateResponse = _responseGenerator.createTemplateResponse(template, destZoneId); - templateResponse.setResponseName(getName()); + templateResponse.setResponseName(getCommandName()); this.setResponseObject(templateResponse); } catch (StorageUnavailableException ex) { diff --git a/api/src/com/cloud/api/commands/CreateCfgCmd.java b/api/src/com/cloud/api/commands/CreateCfgCmd.java index b7d7afc774d..9d5e790f413 100644 --- a/api/src/com/cloud/api/commands/CreateCfgCmd.java +++ b/api/src/com/cloud/api/commands/CreateCfgCmd.java @@ -89,7 +89,7 @@ public class CreateCfgCmd extends BaseCmd { ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -98,7 +98,7 @@ public class CreateCfgCmd extends BaseCmd { Configuration cfg = _configService.addConfig(this); if (cfg != null) { ConfigurationResponse response = _responseGenerator.createConfigurationResponse(cfg); - response.setResponseName(getName()); + response.setResponseName(getCommandName()); this.setResponseObject(response); } else { throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to add config"); diff --git a/api/src/com/cloud/api/commands/CreateDiskOfferingCmd.java b/api/src/com/cloud/api/commands/CreateDiskOfferingCmd.java index d7cb6279b04..9356f45de78 100755 --- a/api/src/com/cloud/api/commands/CreateDiskOfferingCmd.java +++ b/api/src/com/cloud/api/commands/CreateDiskOfferingCmd.java @@ -88,7 +88,7 @@ public class CreateDiskOfferingCmd extends BaseCmd { ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -97,7 +97,7 @@ public class CreateDiskOfferingCmd extends BaseCmd { DiskOffering offering = _configService.createDiskOffering(this); if (offering != null) { DiskOfferingResponse response = _responseGenerator.createDiskOfferingResponse(offering); - response.setResponseName(getName()); + response.setResponseName(getCommandName()); this.setResponseObject(response); } else { throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to create disk offering"); diff --git a/api/src/com/cloud/api/commands/CreateDomainCmd.java b/api/src/com/cloud/api/commands/CreateDomainCmd.java index 3e28ad1d62e..121ad7431b0 100644 --- a/api/src/com/cloud/api/commands/CreateDomainCmd.java +++ b/api/src/com/cloud/api/commands/CreateDomainCmd.java @@ -62,7 +62,7 @@ public class CreateDomainCmd extends BaseCmd { ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -71,7 +71,7 @@ public class CreateDomainCmd extends BaseCmd { Domain domain = _mgr.createDomain(this); if (domain != null) { DomainResponse response = _responseGenerator.createDomainResponse(domain); - response.setResponseName(getName()); + response.setResponseName(getCommandName()); this.setResponseObject(response); } else { throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to create domain"); diff --git a/api/src/com/cloud/api/commands/CreateIpForwardingRuleCmd.java b/api/src/com/cloud/api/commands/CreateIpForwardingRuleCmd.java index 16a398f459d..5bee10c9aa9 100644 --- a/api/src/com/cloud/api/commands/CreateIpForwardingRuleCmd.java +++ b/api/src/com/cloud/api/commands/CreateIpForwardingRuleCmd.java @@ -69,7 +69,7 @@ public class CreateIpForwardingRuleCmd extends BaseAsyncCreateCmd implements Por ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -86,7 +86,7 @@ public class CreateIpForwardingRuleCmd extends BaseAsyncCreateCmd implements Por if (result) { PortForwardingRule rule = _entityMgr.findById(PortForwardingRule.class, getEntityId()); FirewallRuleResponse fwResponse = _responseGenerator.createFirewallRuleResponse(rule); - fwResponse.setResponseName(getName()); + fwResponse.setResponseName(getCommandName()); this.setResponseObject(fwResponse); } else { throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Error in creating ip forwarding rule on the domr"); diff --git a/api/src/com/cloud/api/commands/CreateLoadBalancerRuleCmd.java b/api/src/com/cloud/api/commands/CreateLoadBalancerRuleCmd.java index aacd44282a4..fa3b6d9ce9b 100644 --- a/api/src/com/cloud/api/commands/CreateLoadBalancerRuleCmd.java +++ b/api/src/com/cloud/api/commands/CreateLoadBalancerRuleCmd.java @@ -23,20 +23,19 @@ import java.util.List; import org.apache.log4j.Logger; import com.cloud.api.ApiConstants; -import com.cloud.api.BaseAsyncCreateCmd; import com.cloud.api.BaseCmd; import com.cloud.api.Implementation; import com.cloud.api.Parameter; import com.cloud.api.ServerApiException; import com.cloud.api.response.LoadBalancerResponse; -import com.cloud.event.EventTypes; import com.cloud.exception.NetworkRuleConflictException; import com.cloud.network.rules.LoadBalancer; +import com.cloud.user.UserContext; import com.cloud.utils.net.Ip; import com.cloud.utils.net.NetUtils; @Implementation(description="Creates a load balancer rule", responseObject=LoadBalancerResponse.class) -public class CreateLoadBalancerRuleCmd extends BaseAsyncCreateCmd implements LoadBalancer { +public class CreateLoadBalancerRuleCmd extends BaseCmd implements LoadBalancer { public static final Logger s_logger = Logger.getLogger(CreateLoadBalancerRuleCmd.class.getName()); private static final String s_name = "createloadbalancerruleresponse"; @@ -93,14 +92,17 @@ public class CreateLoadBalancerRuleCmd extends BaseAsyncCreateCmd implements Lo public String getPublicPort() { return publicPort; } - + + public String getName() { + return loadBalancerRuleName; + } ///////////////////////////////////////////////////// /////////////// API Implementation/////////////////// ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -114,7 +116,7 @@ public class CreateLoadBalancerRuleCmd extends BaseAsyncCreateCmd implements Lo throw new ServerApiException(BaseCmd.NETWORK_RULE_CONFLICT_ERROR, e.getMessage()); } LoadBalancerResponse response = _responseGenerator.createLoadBalancerResponse(result); - response.setResponseName(getName()); + response.setResponseName(getCommandName()); this.setResponseObject(response); } @@ -166,12 +168,12 @@ public class CreateLoadBalancerRuleCmd extends BaseAsyncCreateCmd implements Lo @Override public long getAccountId() { - throw new UnsupportedOperationException("not supported"); + return UserContext.current().getAccount().getId(); } @Override public long getDomainId() { - throw new UnsupportedOperationException("not supported"); + return UserContext.current().getAccount().getDomainId(); } @Override @@ -188,25 +190,5 @@ public class CreateLoadBalancerRuleCmd extends BaseAsyncCreateCmd implements Lo public List getDestinations() { throw new UnsupportedOperationException("not supported"); } - - @Override - public void create() { - // TODO Auto-generated method stub - - } - - @Override - public long getEntityOwnerId() { - return _entityMgr.findById(LoadBalancer.class, getEntityId()).getAccountId(); - } - - @Override - public String getEventType() { - return EventTypes.EVENT_LOAD_BALANCER_CREATE; - } - - @Override - public String getEventDescription() { - return "Create load balancer"; - } + } diff --git a/api/src/com/cloud/api/commands/CreateNetworkCmd.java b/api/src/com/cloud/api/commands/CreateNetworkCmd.java index 6487e4ca97a..e1375abe297 100644 --- a/api/src/com/cloud/api/commands/CreateNetworkCmd.java +++ b/api/src/com/cloud/api/commands/CreateNetworkCmd.java @@ -130,7 +130,7 @@ public class CreateNetworkCmd extends BaseCmd { ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -139,7 +139,7 @@ public class CreateNetworkCmd extends BaseCmd { Network result = _networkService.createNetwork(this); if (result != null) { NetworkResponse response = _responseGenerator.createNetworkResponse(result); - response.setResponseName(getName()); + response.setResponseName(getCommandName()); this.setResponseObject(response); }else { throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to create network"); diff --git a/api/src/com/cloud/api/commands/CreateNetworkGroupCmd.java b/api/src/com/cloud/api/commands/CreateNetworkGroupCmd.java index f6956f27517..38a0f61205b 100644 --- a/api/src/com/cloud/api/commands/CreateNetworkGroupCmd.java +++ b/api/src/com/cloud/api/commands/CreateNetworkGroupCmd.java @@ -77,7 +77,7 @@ public class CreateNetworkGroupCmd extends BaseCmd { ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -86,7 +86,7 @@ public class CreateNetworkGroupCmd extends BaseCmd { NetworkGroup group = _networkGroupMgr.createNetworkGroup(this); if (group != null) { NetworkGroupResponse response = _responseGenerator.createNetworkGroupResponse(group); - response.setResponseName(getName()); + response.setResponseName(getCommandName()); this.setResponseObject(response); } else { throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to create network group"); diff --git a/api/src/com/cloud/api/commands/CreateNetworkOfferingCmd.java b/api/src/com/cloud/api/commands/CreateNetworkOfferingCmd.java index d63c6391082..a322aa2b4fb 100644 --- a/api/src/com/cloud/api/commands/CreateNetworkOfferingCmd.java +++ b/api/src/com/cloud/api/commands/CreateNetworkOfferingCmd.java @@ -94,7 +94,7 @@ public class CreateNetworkOfferingCmd extends BaseCmd { /////////////// API Implementation/////////////////// ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return _name; } @@ -103,7 +103,7 @@ public class CreateNetworkOfferingCmd extends BaseCmd { NetworkOffering result = _configService.createNetworkOffering(this); if (result != null) { NetworkOfferingResponse response = _responseGenerator.createNetworkOfferingResponse(result); - response.setResponseName(getName()); + response.setResponseName(getCommandName()); this.setResponseObject(response); } else { throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to create network offering"); diff --git a/api/src/com/cloud/api/commands/CreatePodCmd.java b/api/src/com/cloud/api/commands/CreatePodCmd.java index 4177e3f8b3f..04ab3678221 100644 --- a/api/src/com/cloud/api/commands/CreatePodCmd.java +++ b/api/src/com/cloud/api/commands/CreatePodCmd.java @@ -91,7 +91,7 @@ public class CreatePodCmd extends BaseCmd { ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -100,7 +100,7 @@ public class CreatePodCmd extends BaseCmd { Pod result = _configService.createPod(this); if (result != null) { PodResponse response = _responseGenerator.createPodResponse(result); - response.setResponseName(getName()); + response.setResponseName(getCommandName()); this.setResponseObject(response); } else { throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to create pod"); diff --git a/api/src/com/cloud/api/commands/CreatePortForwardingRuleCmd.java b/api/src/com/cloud/api/commands/CreatePortForwardingRuleCmd.java index 11f465ac4e3..7598ea259a8 100644 --- a/api/src/com/cloud/api/commands/CreatePortForwardingRuleCmd.java +++ b/api/src/com/cloud/api/commands/CreatePortForwardingRuleCmd.java @@ -91,7 +91,7 @@ public class CreatePortForwardingRuleCmd extends BaseAsyncCreateCmd implements ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -109,7 +109,7 @@ public class CreatePortForwardingRuleCmd extends BaseAsyncCreateCmd implements } } FirewallRuleResponse fwResponse = _responseGenerator.createFirewallRuleResponse(rule); - fwResponse.setResponseName(getName()); + fwResponse.setResponseName(getCommandName()); setResponseObject(fwResponse); } diff --git a/api/src/com/cloud/api/commands/CreateRemoteAccessVpnCmd.java b/api/src/com/cloud/api/commands/CreateRemoteAccessVpnCmd.java index cdc9b9912d4..ecdaab58b87 100644 --- a/api/src/com/cloud/api/commands/CreateRemoteAccessVpnCmd.java +++ b/api/src/com/cloud/api/commands/CreateRemoteAccessVpnCmd.java @@ -100,7 +100,7 @@ public class CreateRemoteAccessVpnCmd extends BaseAsyncCreateCmd { @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -160,7 +160,7 @@ public class CreateRemoteAccessVpnCmd extends BaseAsyncCreateCmd { response.setDomainId(result.getDomainId()); response.setDomainName(_entityMgr.findById(Domain.class, result.getDomainId()).getName()); response.setObjectName("remoteaccessvpn"); - response.setResponseName(getName()); + response.setResponseName(getCommandName()); response.setPresharedKey(result.getIpsecPresharedKey()); this.setResponseObject(response); } else { diff --git a/api/src/com/cloud/api/commands/CreateServiceOfferingCmd.java b/api/src/com/cloud/api/commands/CreateServiceOfferingCmd.java index 99bd1955d1b..e0fdbcbfa7b 100644 --- a/api/src/com/cloud/api/commands/CreateServiceOfferingCmd.java +++ b/api/src/com/cloud/api/commands/CreateServiceOfferingCmd.java @@ -117,7 +117,7 @@ public class CreateServiceOfferingCmd extends BaseCmd { ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return _name; } @@ -126,7 +126,7 @@ public class CreateServiceOfferingCmd extends BaseCmd { ServiceOffering result = _configService.createServiceOffering(this); if (result != null) { ServiceOfferingResponse response = _responseGenerator.createServiceOfferingResponse(result); - response.setResponseName(getName()); + response.setResponseName(getCommandName()); this.setResponseObject(response); } else { throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to create service offering"); diff --git a/api/src/com/cloud/api/commands/CreateSnapshotCmd.java b/api/src/com/cloud/api/commands/CreateSnapshotCmd.java index df5b2038053..d13e32dee6e 100644 --- a/api/src/com/cloud/api/commands/CreateSnapshotCmd.java +++ b/api/src/com/cloud/api/commands/CreateSnapshotCmd.java @@ -84,7 +84,7 @@ public class CreateSnapshotCmd extends BaseAsyncCreateCmd { ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -130,7 +130,7 @@ public class CreateSnapshotCmd extends BaseAsyncCreateCmd { Snapshot snapshot = _snapshotMgr.createSnapshot(this); if (snapshot != null) { SnapshotResponse response = _responseGenerator.createSnapshotResponse(snapshot); - response.setResponseName(getName()); + response.setResponseName(getCommandName()); this.setResponseObject(response); } else { throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to create snapshot due to an internal error creating snapshot for volume " + volumeId); diff --git a/api/src/com/cloud/api/commands/CreateSnapshotPolicyCmd.java b/api/src/com/cloud/api/commands/CreateSnapshotPolicyCmd.java index f353083fa43..576fc415ab7 100644 --- a/api/src/com/cloud/api/commands/CreateSnapshotPolicyCmd.java +++ b/api/src/com/cloud/api/commands/CreateSnapshotPolicyCmd.java @@ -103,7 +103,7 @@ public class CreateSnapshotPolicyCmd extends BaseCmd { ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -112,7 +112,7 @@ public class CreateSnapshotPolicyCmd extends BaseCmd { SnapshotPolicy result = _snapshotMgr.createPolicy(this); if (result != null) { SnapshotPolicyResponse response = _responseGenerator.createSnapshotPolicyResponse(result); - response.setResponseName(getName()); + response.setResponseName(getCommandName()); this.setResponseObject(response); } else { throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to create snapshot policy"); diff --git a/api/src/com/cloud/api/commands/CreateStoragePoolCmd.java b/api/src/com/cloud/api/commands/CreateStoragePoolCmd.java index 0474d395222..7a0585295e5 100644 --- a/api/src/com/cloud/api/commands/CreateStoragePoolCmd.java +++ b/api/src/com/cloud/api/commands/CreateStoragePoolCmd.java @@ -102,7 +102,7 @@ public class CreateStoragePoolCmd extends BaseCmd { ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -112,7 +112,7 @@ public class CreateStoragePoolCmd extends BaseCmd { StoragePool result = _storageMgr.createPool(this); if (result != null) { StoragePoolResponse response = _responseGenerator.createStoragePoolResponse(result); - response.setResponseName(getName()); + response.setResponseName(getCommandName()); this.setResponseObject(response); } else { throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to add storage pool"); diff --git a/api/src/com/cloud/api/commands/CreateTemplateCmd.java b/api/src/com/cloud/api/commands/CreateTemplateCmd.java index b4706e8f94f..23ead7a5ba0 100644 --- a/api/src/com/cloud/api/commands/CreateTemplateCmd.java +++ b/api/src/com/cloud/api/commands/CreateTemplateCmd.java @@ -125,7 +125,7 @@ public class CreateTemplateCmd extends BaseAsyncCreateCmd { ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -182,7 +182,7 @@ public class CreateTemplateCmd extends BaseAsyncCreateCmd { VirtualMachineTemplate template = _userVmService.createPrivateTemplate(this); if (template != null) { TemplateResponse response = _responseGenerator.createTemplateResponse(template, snapshotId, volumeId); - response.setResponseName(getName()); + response.setResponseName(getCommandName()); this.setResponseObject(response); } else { diff --git a/api/src/com/cloud/api/commands/CreateUserCmd.java b/api/src/com/cloud/api/commands/CreateUserCmd.java index c1a02440a81..f517ecb477e 100644 --- a/api/src/com/cloud/api/commands/CreateUserCmd.java +++ b/api/src/com/cloud/api/commands/CreateUserCmd.java @@ -117,7 +117,7 @@ public class CreateUserCmd extends BaseCmd { ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -126,7 +126,7 @@ public class CreateUserCmd extends BaseCmd { UserAccount user = _accountService.createUser(this); if (user != null) { UserResponse response = _responseGenerator.createUserResponse(user); - response.setResponseName(getName()); + response.setResponseName(getCommandName()); this.setResponseObject(response); } else { throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to create a user"); diff --git a/api/src/com/cloud/api/commands/CreateVMGroupCmd.java b/api/src/com/cloud/api/commands/CreateVMGroupCmd.java index 02361703517..9ad303f5a0a 100644 --- a/api/src/com/cloud/api/commands/CreateVMGroupCmd.java +++ b/api/src/com/cloud/api/commands/CreateVMGroupCmd.java @@ -67,7 +67,7 @@ public class CreateVMGroupCmd extends BaseCmd{ ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -76,7 +76,7 @@ public class CreateVMGroupCmd extends BaseCmd{ InstanceGroup result = _userVmService.createVmGroup(this); if (result != null) { InstanceGroupResponse response = _responseGenerator.createInstanceGroupResponse(result); - response.setResponseName(getName()); + response.setResponseName(getCommandName()); this.setResponseObject(response); } else { throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to create vm instance group"); diff --git a/api/src/com/cloud/api/commands/CreateVlanIpRangeCmd.java b/api/src/com/cloud/api/commands/CreateVlanIpRangeCmd.java index 368f8a89282..d746eace132 100644 --- a/api/src/com/cloud/api/commands/CreateVlanIpRangeCmd.java +++ b/api/src/com/cloud/api/commands/CreateVlanIpRangeCmd.java @@ -127,7 +127,7 @@ public class CreateVlanIpRangeCmd extends BaseCmd { } @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -137,7 +137,7 @@ public class CreateVlanIpRangeCmd extends BaseCmd { Vlan result = _configService.createVlanAndPublicIpRange(this); if (result != null) { VlanIpRangeResponse response = _responseGenerator.createVlanIpRangeResponse(result); - response.setResponseName(getName()); + response.setResponseName(getCommandName()); this.setResponseObject(response); }else { throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to create vlan ip range"); diff --git a/api/src/com/cloud/api/commands/CreateVolumeCmd.java b/api/src/com/cloud/api/commands/CreateVolumeCmd.java index 804e07cf084..c41ad2ebd81 100644 --- a/api/src/com/cloud/api/commands/CreateVolumeCmd.java +++ b/api/src/com/cloud/api/commands/CreateVolumeCmd.java @@ -102,7 +102,7 @@ public class CreateVolumeCmd extends BaseAsyncCreateCmd { /////////////// API Implementation/////////////////// ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -165,7 +165,7 @@ public class CreateVolumeCmd extends BaseAsyncCreateCmd { VolumeResponse response = _responseGenerator.createVolumeResponse(volume); //FIXME - have to be moved to ApiResponseHelper response.setSnapshotId(getSnapshotId()); // if the volume was created from a snapshot, snapshotId will be set so we pass it back in the response - response.setResponseName(getName()); + response.setResponseName(getCommandName()); this.setResponseObject(response); } else { throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to create a volume"); diff --git a/api/src/com/cloud/api/commands/CreateZoneCmd.java b/api/src/com/cloud/api/commands/CreateZoneCmd.java index c651d47948a..dc33af2371f 100644 --- a/api/src/com/cloud/api/commands/CreateZoneCmd.java +++ b/api/src/com/cloud/api/commands/CreateZoneCmd.java @@ -116,7 +116,7 @@ public class CreateZoneCmd extends BaseCmd { /////////////// API Implementation/////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -125,7 +125,7 @@ public class CreateZoneCmd extends BaseCmd { DataCenter result = _configService.createZone(this); if (result != null){ ZoneResponse response = _responseGenerator.createZoneResponse(result); - response.setResponseName(getName()); + response.setResponseName(getCommandName()); this.setResponseObject(response); } else { throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to create a zone"); diff --git a/api/src/com/cloud/api/commands/DeleteDiskOfferingCmd.java b/api/src/com/cloud/api/commands/DeleteDiskOfferingCmd.java index 7d219f38db8..b9500701628 100644 --- a/api/src/com/cloud/api/commands/DeleteDiskOfferingCmd.java +++ b/api/src/com/cloud/api/commands/DeleteDiskOfferingCmd.java @@ -52,7 +52,7 @@ public class DeleteDiskOfferingCmd extends BaseCmd { /////////////// API Implementation/////////////////// ///////////////////////////////////////////////////// - public String getName() { + public String getCommandName() { return s_name; } @@ -60,7 +60,7 @@ public class DeleteDiskOfferingCmd extends BaseCmd { public void execute(){ boolean result = _configService.deleteDiskOffering(this); if (result) { - SuccessResponse response = new SuccessResponse(getName()); + SuccessResponse response = new SuccessResponse(getCommandName()); this.setResponseObject(response); } else { throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to delete disk offering"); diff --git a/api/src/com/cloud/api/commands/DeleteDomainCmd.java b/api/src/com/cloud/api/commands/DeleteDomainCmd.java index 335de83503c..55fe622ee74 100644 --- a/api/src/com/cloud/api/commands/DeleteDomainCmd.java +++ b/api/src/com/cloud/api/commands/DeleteDomainCmd.java @@ -63,7 +63,7 @@ public class DeleteDomainCmd extends BaseAsyncCmd { ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -91,7 +91,7 @@ public class DeleteDomainCmd extends BaseAsyncCmd { public void execute(){ boolean result = _mgr.deleteDomain(this); if (result) { - SuccessResponse response = new SuccessResponse(getName()); + SuccessResponse response = new SuccessResponse(getCommandName()); this.setResponseObject(response); } else { throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to delete domain"); diff --git a/api/src/com/cloud/api/commands/DeleteHostCmd.java b/api/src/com/cloud/api/commands/DeleteHostCmd.java index 2cbb27706a0..9eaa58bd520 100644 --- a/api/src/com/cloud/api/commands/DeleteHostCmd.java +++ b/api/src/com/cloud/api/commands/DeleteHostCmd.java @@ -56,7 +56,7 @@ public class DeleteHostCmd extends BaseCmd { ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -64,7 +64,7 @@ public class DeleteHostCmd extends BaseCmd { public void execute(){ boolean result = _resourceService.deleteHost(this); if (result) { - SuccessResponse response = new SuccessResponse(getName()); + SuccessResponse response = new SuccessResponse(getCommandName()); this.setResponseObject(response); } else { throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to delete host"); diff --git a/api/src/com/cloud/api/commands/DeleteIpForwardingRuleCmd.java b/api/src/com/cloud/api/commands/DeleteIpForwardingRuleCmd.java index 8ecadb467b1..901d584791d 100644 --- a/api/src/com/cloud/api/commands/DeleteIpForwardingRuleCmd.java +++ b/api/src/com/cloud/api/commands/DeleteIpForwardingRuleCmd.java @@ -57,7 +57,7 @@ public class DeleteIpForwardingRuleCmd extends BaseAsyncCmd { ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -65,7 +65,7 @@ public class DeleteIpForwardingRuleCmd extends BaseAsyncCmd { public void execute(){ PortForwardingRule rule = _rulesService.revokePortForwardingRule(id, true); if (rule != null) { - SuccessResponse response = new SuccessResponse(getName()); + SuccessResponse response = new SuccessResponse(getCommandName()); this.setResponseObject(response); } else { throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to delete ip forwarding rule"); diff --git a/api/src/com/cloud/api/commands/DeleteIsoCmd.java b/api/src/com/cloud/api/commands/DeleteIsoCmd.java index 01d746d3b2d..898c39857f7 100644 --- a/api/src/com/cloud/api/commands/DeleteIsoCmd.java +++ b/api/src/com/cloud/api/commands/DeleteIsoCmd.java @@ -64,7 +64,7 @@ public class DeleteIsoCmd extends BaseAsyncCmd { ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -104,7 +104,7 @@ public class DeleteIsoCmd extends BaseAsyncCmd { public void execute(){ boolean result = _templateService.deleteIso(this); if (result) { - SuccessResponse response = new SuccessResponse(getName()); + SuccessResponse response = new SuccessResponse(getCommandName()); this.setResponseObject(response); } else { throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to delete iso"); diff --git a/api/src/com/cloud/api/commands/DeleteLoadBalancerRuleCmd.java b/api/src/com/cloud/api/commands/DeleteLoadBalancerRuleCmd.java index 8f3b583596b..b4075cf5451 100644 --- a/api/src/com/cloud/api/commands/DeleteLoadBalancerRuleCmd.java +++ b/api/src/com/cloud/api/commands/DeleteLoadBalancerRuleCmd.java @@ -55,7 +55,7 @@ public class DeleteLoadBalancerRuleCmd extends BaseAsyncCmd { ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -83,7 +83,7 @@ public class DeleteLoadBalancerRuleCmd extends BaseAsyncCmd { public void execute(){ boolean result = _lbService.deleteLoadBalancerRule(id, true); if (result) { - SuccessResponse response = new SuccessResponse(getName()); + SuccessResponse response = new SuccessResponse(getCommandName()); this.setResponseObject(response); } else { throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to delete load balancer"); diff --git a/api/src/com/cloud/api/commands/DeleteNetworkCmd.java b/api/src/com/cloud/api/commands/DeleteNetworkCmd.java index 1291fbe71c2..1d51c8ad167 100644 --- a/api/src/com/cloud/api/commands/DeleteNetworkCmd.java +++ b/api/src/com/cloud/api/commands/DeleteNetworkCmd.java @@ -54,7 +54,7 @@ public class DeleteNetworkCmd extends BaseCmd{ ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -62,7 +62,7 @@ public class DeleteNetworkCmd extends BaseCmd{ public void execute(){ boolean result = _networkService.deleteNetwork(this); if (result) { - SuccessResponse response = new SuccessResponse(getName()); + SuccessResponse response = new SuccessResponse(getCommandName()); this.setResponseObject(response); } else { throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to delete network"); diff --git a/api/src/com/cloud/api/commands/DeleteNetworkGroupCmd.java b/api/src/com/cloud/api/commands/DeleteNetworkGroupCmd.java index 0844f8580ed..c57a8c0a94d 100644 --- a/api/src/com/cloud/api/commands/DeleteNetworkGroupCmd.java +++ b/api/src/com/cloud/api/commands/DeleteNetworkGroupCmd.java @@ -51,7 +51,7 @@ public class DeleteNetworkGroupCmd extends BaseCmd { ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -60,7 +60,7 @@ public class DeleteNetworkGroupCmd extends BaseCmd { try{ boolean result = _networkGroupMgr.deleteNetworkGroup(this); if (result) { - SuccessResponse response = new SuccessResponse(getName()); + SuccessResponse response = new SuccessResponse(getCommandName()); this.setResponseObject(response); } else { throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to delete network group"); diff --git a/api/src/com/cloud/api/commands/DeleteNetworkOfferingCmd.java b/api/src/com/cloud/api/commands/DeleteNetworkOfferingCmd.java index 9719f14badc..9bfa06e56bf 100644 --- a/api/src/com/cloud/api/commands/DeleteNetworkOfferingCmd.java +++ b/api/src/com/cloud/api/commands/DeleteNetworkOfferingCmd.java @@ -54,7 +54,7 @@ public class DeleteNetworkOfferingCmd extends BaseCmd{ ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -62,7 +62,7 @@ public class DeleteNetworkOfferingCmd extends BaseCmd{ public void execute(){ boolean result = _configService.deleteNetworkOffering(this); if (result) { - SuccessResponse response = new SuccessResponse(getName()); + SuccessResponse response = new SuccessResponse(getCommandName()); this.setResponseObject(response); } else { throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to delete service offering"); diff --git a/api/src/com/cloud/api/commands/DeletePodCmd.java b/api/src/com/cloud/api/commands/DeletePodCmd.java index 88b6078f0d0..a3bf4e97614 100644 --- a/api/src/com/cloud/api/commands/DeletePodCmd.java +++ b/api/src/com/cloud/api/commands/DeletePodCmd.java @@ -53,7 +53,7 @@ public class DeletePodCmd extends BaseCmd { /////////////// API Implementation/////////////////// ///////////////////////////////////////////////////// - public String getName() { + public String getCommandName() { return s_name; } @@ -61,7 +61,7 @@ public class DeletePodCmd extends BaseCmd { public void execute(){ boolean result = _configService.deletePod(this); if (result) { - SuccessResponse response = new SuccessResponse(getName()); + SuccessResponse response = new SuccessResponse(getCommandName()); this.setResponseObject(response); } else { throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to delete pod"); diff --git a/api/src/com/cloud/api/commands/DeletePoolCmd.java b/api/src/com/cloud/api/commands/DeletePoolCmd.java index fa08571d038..deeb8b7de44 100644 --- a/api/src/com/cloud/api/commands/DeletePoolCmd.java +++ b/api/src/com/cloud/api/commands/DeletePoolCmd.java @@ -36,7 +36,7 @@ public class DeletePoolCmd extends BaseCmd { ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -44,7 +44,7 @@ public class DeletePoolCmd extends BaseCmd { public void execute(){ boolean result = _storageMgr.deletePool(this); if (result) { - SuccessResponse response = new SuccessResponse(getName()); + SuccessResponse response = new SuccessResponse(getCommandName()); this.setResponseObject(response); } else { throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to delete storage pool"); diff --git a/api/src/com/cloud/api/commands/DeletePortForwardingRuleCmd.java b/api/src/com/cloud/api/commands/DeletePortForwardingRuleCmd.java index ad379fe5269..02176728e64 100644 --- a/api/src/com/cloud/api/commands/DeletePortForwardingRuleCmd.java +++ b/api/src/com/cloud/api/commands/DeletePortForwardingRuleCmd.java @@ -54,7 +54,7 @@ public class DeletePortForwardingRuleCmd extends BaseCmd { ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -62,7 +62,7 @@ public class DeletePortForwardingRuleCmd extends BaseCmd { public void execute() throws ResourceUnavailableException { PortForwardingRule result = _rulesService.revokePortForwardingRule(id, true); if (result != null) { - SuccessResponse response = new SuccessResponse(getName()); + SuccessResponse response = new SuccessResponse(getCommandName()); this.setResponseObject(response); } else { throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to delete port forwarding rule"); diff --git a/api/src/com/cloud/api/commands/DeletePreallocatedLunCmd.java b/api/src/com/cloud/api/commands/DeletePreallocatedLunCmd.java index 76fde8d7d7f..8e1713e08af 100644 --- a/api/src/com/cloud/api/commands/DeletePreallocatedLunCmd.java +++ b/api/src/com/cloud/api/commands/DeletePreallocatedLunCmd.java @@ -48,7 +48,7 @@ public class DeletePreallocatedLunCmd extends BaseCmd { ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -56,7 +56,7 @@ public class DeletePreallocatedLunCmd extends BaseCmd { public void execute(){ boolean result = _mgr.unregisterPreallocatedLun(this); if (result) { - SuccessResponse response = new SuccessResponse(getName()); + SuccessResponse response = new SuccessResponse(getCommandName()); this.setResponseObject(response); } else { throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to delete preallocated lun"); diff --git a/api/src/com/cloud/api/commands/DeleteRemoteAccessVpnCmd.java b/api/src/com/cloud/api/commands/DeleteRemoteAccessVpnCmd.java index d99ca7ace94..ff84ae359d5 100644 --- a/api/src/com/cloud/api/commands/DeleteRemoteAccessVpnCmd.java +++ b/api/src/com/cloud/api/commands/DeleteRemoteAccessVpnCmd.java @@ -74,7 +74,7 @@ public class DeleteRemoteAccessVpnCmd extends BaseAsyncCmd { ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -112,7 +112,7 @@ public class DeleteRemoteAccessVpnCmd extends BaseAsyncCmd { try { boolean result = _networkService.destroyRemoteAccessVpn(this); if (result) { - SuccessResponse response = new SuccessResponse(getName()); + SuccessResponse response = new SuccessResponse(getCommandName()); this.setResponseObject(response); } else { throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to delete remote access vpn"); diff --git a/api/src/com/cloud/api/commands/DeleteServiceOfferingCmd.java b/api/src/com/cloud/api/commands/DeleteServiceOfferingCmd.java index 944aeb3c10f..654e120c602 100644 --- a/api/src/com/cloud/api/commands/DeleteServiceOfferingCmd.java +++ b/api/src/com/cloud/api/commands/DeleteServiceOfferingCmd.java @@ -54,7 +54,7 @@ public class DeleteServiceOfferingCmd extends BaseCmd{ ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -62,7 +62,7 @@ public class DeleteServiceOfferingCmd extends BaseCmd{ public void execute(){ boolean result = _configService.deleteServiceOffering(this); if (result) { - SuccessResponse response = new SuccessResponse(getName()); + SuccessResponse response = new SuccessResponse(getCommandName()); this.setResponseObject(response); } else { throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to delete service offering"); diff --git a/api/src/com/cloud/api/commands/DeleteSnapshotCmd.java b/api/src/com/cloud/api/commands/DeleteSnapshotCmd.java index 5f43f588199..cc6a323e717 100644 --- a/api/src/com/cloud/api/commands/DeleteSnapshotCmd.java +++ b/api/src/com/cloud/api/commands/DeleteSnapshotCmd.java @@ -58,7 +58,7 @@ public class DeleteSnapshotCmd extends BaseAsyncCmd { ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -94,7 +94,7 @@ public class DeleteSnapshotCmd extends BaseAsyncCmd { public void execute(){ boolean result = _snapshotMgr.deleteSnapshot(this); if (result) { - SuccessResponse response = new SuccessResponse(getName()); + SuccessResponse response = new SuccessResponse(getCommandName()); this.setResponseObject(response); } else { throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to delete snapshot"); diff --git a/api/src/com/cloud/api/commands/DeleteSnapshotPoliciesCmd.java b/api/src/com/cloud/api/commands/DeleteSnapshotPoliciesCmd.java index bfb8fd20644..7fe25f4c800 100644 --- a/api/src/com/cloud/api/commands/DeleteSnapshotPoliciesCmd.java +++ b/api/src/com/cloud/api/commands/DeleteSnapshotPoliciesCmd.java @@ -64,7 +64,7 @@ public class DeleteSnapshotPoliciesCmd extends BaseCmd { ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -72,7 +72,7 @@ public class DeleteSnapshotPoliciesCmd extends BaseCmd { public void execute(){ boolean result = _snapshotMgr.deleteSnapshotPolicies(this); if (result) { - SuccessResponse response = new SuccessResponse(getName()); + SuccessResponse response = new SuccessResponse(getCommandName()); this.setResponseObject(response); } else { throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to delete snapshot policy"); diff --git a/api/src/com/cloud/api/commands/DeleteTemplateCmd.java b/api/src/com/cloud/api/commands/DeleteTemplateCmd.java index e913a7ffc6c..c474040608d 100644 --- a/api/src/com/cloud/api/commands/DeleteTemplateCmd.java +++ b/api/src/com/cloud/api/commands/DeleteTemplateCmd.java @@ -66,7 +66,7 @@ public class DeleteTemplateCmd extends BaseAsyncCmd { ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -106,7 +106,7 @@ public class DeleteTemplateCmd extends BaseAsyncCmd { public void execute(){ boolean result = _templateService.deleteTemplate(this); if (result) { - SuccessResponse response = new SuccessResponse(getName()); + SuccessResponse response = new SuccessResponse(getCommandName()); this.setResponseObject(response); } else { throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to delete template"); diff --git a/api/src/com/cloud/api/commands/DeleteUserCmd.java b/api/src/com/cloud/api/commands/DeleteUserCmd.java index 22a95a284fc..a322965f95b 100644 --- a/api/src/com/cloud/api/commands/DeleteUserCmd.java +++ b/api/src/com/cloud/api/commands/DeleteUserCmd.java @@ -63,7 +63,7 @@ public class DeleteUserCmd extends BaseAsyncCmd { } @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -92,7 +92,7 @@ public class DeleteUserCmd extends BaseAsyncCmd { public void execute(){ boolean result = _accountService.deleteUser(this); if (result) { - SuccessResponse response = new SuccessResponse(getName()); + SuccessResponse response = new SuccessResponse(getCommandName()); this.setResponseObject(response); } else { throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to delete user"); diff --git a/api/src/com/cloud/api/commands/DeleteVMGroupCmd.java b/api/src/com/cloud/api/commands/DeleteVMGroupCmd.java index ed3427ccaa7..64e2b6b4a14 100644 --- a/api/src/com/cloud/api/commands/DeleteVMGroupCmd.java +++ b/api/src/com/cloud/api/commands/DeleteVMGroupCmd.java @@ -51,7 +51,7 @@ public class DeleteVMGroupCmd extends BaseCmd{ ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -59,7 +59,7 @@ public class DeleteVMGroupCmd extends BaseCmd{ public void execute(){ boolean result = _userVmService.deleteVmGroup(this); if (result) { - SuccessResponse response = new SuccessResponse(getName()); + SuccessResponse response = new SuccessResponse(getCommandName()); this.setResponseObject(response); } else { throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to delete vm group"); diff --git a/api/src/com/cloud/api/commands/DeleteVlanIpRangeCmd.java b/api/src/com/cloud/api/commands/DeleteVlanIpRangeCmd.java index b4ab1546a39..0cd05f8c886 100644 --- a/api/src/com/cloud/api/commands/DeleteVlanIpRangeCmd.java +++ b/api/src/com/cloud/api/commands/DeleteVlanIpRangeCmd.java @@ -53,7 +53,7 @@ public class DeleteVlanIpRangeCmd extends BaseCmd { ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -61,7 +61,7 @@ public class DeleteVlanIpRangeCmd extends BaseCmd { public void execute(){ boolean result = _configService.deleteVlanIpRange(this); if (result) { - SuccessResponse response = new SuccessResponse(getName()); + SuccessResponse response = new SuccessResponse(getCommandName()); this.setResponseObject(response); } else { throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to delete vlan ip range"); diff --git a/api/src/com/cloud/api/commands/DeleteVolumeCmd.java b/api/src/com/cloud/api/commands/DeleteVolumeCmd.java index fc18f950b5e..488f3fe62ec 100644 --- a/api/src/com/cloud/api/commands/DeleteVolumeCmd.java +++ b/api/src/com/cloud/api/commands/DeleteVolumeCmd.java @@ -54,7 +54,7 @@ public class DeleteVolumeCmd extends BaseCmd { ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -66,7 +66,7 @@ public class DeleteVolumeCmd extends BaseCmd { public void execute(){ boolean result = _storageMgr.deleteVolume(this); if (result) { - SuccessResponse response = new SuccessResponse(getName()); + SuccessResponse response = new SuccessResponse(getCommandName()); this.setResponseObject(response); } else { throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to delete volume"); diff --git a/api/src/com/cloud/api/commands/DeleteZoneCmd.java b/api/src/com/cloud/api/commands/DeleteZoneCmd.java index daa28472ef6..9777aad7a05 100644 --- a/api/src/com/cloud/api/commands/DeleteZoneCmd.java +++ b/api/src/com/cloud/api/commands/DeleteZoneCmd.java @@ -55,7 +55,7 @@ public class DeleteZoneCmd extends BaseCmd { ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -63,7 +63,7 @@ public class DeleteZoneCmd extends BaseCmd { public void execute(){ boolean result = _configService.deleteZone(this); if (result) { - SuccessResponse response = new SuccessResponse(getName()); + SuccessResponse response = new SuccessResponse(getCommandName()); this.setResponseObject(response); } else { throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to delete zone"); diff --git a/api/src/com/cloud/api/commands/DeployVMCmd.java b/api/src/com/cloud/api/commands/DeployVMCmd.java index b298b821118..08923095a4b 100644 --- a/api/src/com/cloud/api/commands/DeployVMCmd.java +++ b/api/src/com/cloud/api/commands/DeployVMCmd.java @@ -172,7 +172,7 @@ public class DeployVMCmd extends BaseAsyncCreateCmd { ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -221,7 +221,7 @@ public class DeployVMCmd extends BaseAsyncCreateCmd { result = _userVmService.startVirtualMachine(this); if (result != null) { UserVmResponse response = _responseGenerator.createUserVmResponse(result); - response.setResponseName(getName()); + response.setResponseName(getCommandName()); this.setResponseObject(response); } else { throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to deploy vm"); diff --git a/api/src/com/cloud/api/commands/DestroyConsoleProxyCmd.java b/api/src/com/cloud/api/commands/DestroyConsoleProxyCmd.java index a325c5d5082..520b68bf570 100644 --- a/api/src/com/cloud/api/commands/DestroyConsoleProxyCmd.java +++ b/api/src/com/cloud/api/commands/DestroyConsoleProxyCmd.java @@ -59,7 +59,7 @@ public class DestroyConsoleProxyCmd extends BaseAsyncCmd { ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -87,7 +87,7 @@ public class DestroyConsoleProxyCmd extends BaseAsyncCmd { public void execute(){ boolean result = _consoleProxyMgr.destroyConsoleProxy(this); if (result) { - SuccessResponse response = new SuccessResponse(getName()); + SuccessResponse response = new SuccessResponse(getCommandName()); this.setResponseObject(response); } else { throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to destroy console proxy"); diff --git a/api/src/com/cloud/api/commands/DestroyVMCmd.java b/api/src/com/cloud/api/commands/DestroyVMCmd.java index 2a877d0317b..07450fbf054 100644 --- a/api/src/com/cloud/api/commands/DestroyVMCmd.java +++ b/api/src/com/cloud/api/commands/DestroyVMCmd.java @@ -59,7 +59,7 @@ public class DestroyVMCmd extends BaseAsyncCmd { ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } diff --git a/api/src/com/cloud/api/commands/DetachIsoCmd.java b/api/src/com/cloud/api/commands/DetachIsoCmd.java index 4e1bf6a9454..2adc6b0be21 100755 --- a/api/src/com/cloud/api/commands/DetachIsoCmd.java +++ b/api/src/com/cloud/api/commands/DetachIsoCmd.java @@ -56,7 +56,7 @@ public class DetachIsoCmd extends BaseAsyncCmd { ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } diff --git a/api/src/com/cloud/api/commands/DetachVolumeCmd.java b/api/src/com/cloud/api/commands/DetachVolumeCmd.java index 0460dcfd82c..4d17b8e1e26 100755 --- a/api/src/com/cloud/api/commands/DetachVolumeCmd.java +++ b/api/src/com/cloud/api/commands/DetachVolumeCmd.java @@ -71,7 +71,7 @@ public class DetachVolumeCmd extends BaseAsyncCmd { ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } diff --git a/api/src/com/cloud/api/commands/DisableAccountCmd.java b/api/src/com/cloud/api/commands/DisableAccountCmd.java index e629a1bc33c..e2d0078405b 100644 --- a/api/src/com/cloud/api/commands/DisableAccountCmd.java +++ b/api/src/com/cloud/api/commands/DisableAccountCmd.java @@ -62,7 +62,7 @@ public class DisableAccountCmd extends BaseAsyncCmd { ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -91,7 +91,7 @@ public class DisableAccountCmd extends BaseAsyncCmd { Account result = _accountService.disableAccount(this); if (result != null){ AccountResponse response = _responseGenerator.createAccountResponse(result); - response.setResponseName(getName()); + response.setResponseName(getCommandName()); this.setResponseObject(response); } else { throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to disable account"); diff --git a/api/src/com/cloud/api/commands/DisableUserCmd.java b/api/src/com/cloud/api/commands/DisableUserCmd.java index 9e76f6f085c..1376c5e036e 100644 --- a/api/src/com/cloud/api/commands/DisableUserCmd.java +++ b/api/src/com/cloud/api/commands/DisableUserCmd.java @@ -56,7 +56,7 @@ public class DisableUserCmd extends BaseAsyncCmd { ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -86,7 +86,7 @@ public class DisableUserCmd extends BaseAsyncCmd { UserAccount user = _accountService.disableUser(this); if (user != null){ UserResponse response = _responseGenerator.createUserResponse(user); - response.setResponseName(getName()); + response.setResponseName(getCommandName()); this.setResponseObject(response); } else { throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to disable user"); diff --git a/api/src/com/cloud/api/commands/DisassociateIPAddrCmd.java b/api/src/com/cloud/api/commands/DisassociateIPAddrCmd.java index b3c69c140d2..6f24f10ea53 100644 --- a/api/src/com/cloud/api/commands/DisassociateIPAddrCmd.java +++ b/api/src/com/cloud/api/commands/DisassociateIPAddrCmd.java @@ -52,7 +52,7 @@ public class DisassociateIPAddrCmd extends BaseCmd { ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -60,7 +60,7 @@ public class DisassociateIPAddrCmd extends BaseCmd { public void execute(){ boolean result = _networkService.disassociateIpAddress(this); if (result) { - SuccessResponse response = new SuccessResponse(getName()); + SuccessResponse response = new SuccessResponse(getCommandName()); this.setResponseObject(response); } else { throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to disassociate ip address"); diff --git a/api/src/com/cloud/api/commands/EnableAccountCmd.java b/api/src/com/cloud/api/commands/EnableAccountCmd.java index 8aff8327ef2..10c5df8b4d9 100644 --- a/api/src/com/cloud/api/commands/EnableAccountCmd.java +++ b/api/src/com/cloud/api/commands/EnableAccountCmd.java @@ -59,7 +59,7 @@ public class EnableAccountCmd extends BaseCmd { ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -68,7 +68,7 @@ public class EnableAccountCmd extends BaseCmd { Account result = _accountService.enableAccount(this); if (result != null){ AccountResponse response = _responseGenerator.createAccountResponse(result); - response.setResponseName(getName()); + response.setResponseName(getCommandName()); this.setResponseObject(response); } else { throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to enable account"); diff --git a/api/src/com/cloud/api/commands/EnableUserCmd.java b/api/src/com/cloud/api/commands/EnableUserCmd.java index d04fb9f8d68..a2e5048a566 100644 --- a/api/src/com/cloud/api/commands/EnableUserCmd.java +++ b/api/src/com/cloud/api/commands/EnableUserCmd.java @@ -54,7 +54,7 @@ public class EnableUserCmd extends BaseCmd { ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -63,7 +63,7 @@ public class EnableUserCmd extends BaseCmd { UserAccount user = _accountService.enableUser(this); if (user != null){ UserResponse response = _responseGenerator.createUserResponse(user); - response.setResponseName(getName()); + response.setResponseName(getCommandName()); this.setResponseObject(response); } else { throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to enable user"); diff --git a/api/src/com/cloud/api/commands/ExtractIsoCmd.java b/api/src/com/cloud/api/commands/ExtractIsoCmd.java index f5021c81779..9e6c9fd4f46 100755 --- a/api/src/com/cloud/api/commands/ExtractIsoCmd.java +++ b/api/src/com/cloud/api/commands/ExtractIsoCmd.java @@ -78,7 +78,7 @@ public class ExtractIsoCmd extends BaseAsyncCmd { ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -121,7 +121,7 @@ public class ExtractIsoCmd extends BaseAsyncCmd { Long uploadId = _templateService.extract(this); if (uploadId != null){ ExtractResponse response = _responseGenerator.createExtractResponse(uploadId, id, zoneId, getEntityOwnerId(), mode); - response.setResponseName(getName()); + response.setResponseName(getCommandName()); response.setObjectName("iso"); this.setResponseObject(response); } else { diff --git a/api/src/com/cloud/api/commands/ExtractTemplateCmd.java b/api/src/com/cloud/api/commands/ExtractTemplateCmd.java index 1f400fd6039..ad3778c0018 100755 --- a/api/src/com/cloud/api/commands/ExtractTemplateCmd.java +++ b/api/src/com/cloud/api/commands/ExtractTemplateCmd.java @@ -79,7 +79,7 @@ public class ExtractTemplateCmd extends BaseAsyncCmd { ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -122,7 +122,7 @@ public class ExtractTemplateCmd extends BaseAsyncCmd { Long uploadId = _templateService.extract(this); if (uploadId != null){ ExtractResponse response = _responseGenerator.createExtractResponse(uploadId, id, zoneId, getEntityOwnerId(), mode); - response.setResponseName(getName()); + response.setResponseName(getCommandName()); this.setResponseObject(response); } else { throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to extract template"); diff --git a/api/src/com/cloud/api/commands/ExtractVolumeCmd.java b/api/src/com/cloud/api/commands/ExtractVolumeCmd.java index d4b47426dfc..6b1bbde097e 100755 --- a/api/src/com/cloud/api/commands/ExtractVolumeCmd.java +++ b/api/src/com/cloud/api/commands/ExtractVolumeCmd.java @@ -85,7 +85,7 @@ public class ExtractVolumeCmd extends BaseAsyncCmd { ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -129,7 +129,7 @@ public class ExtractVolumeCmd extends BaseAsyncCmd { if (uploadId != null){ Upload uploadInfo = _entityMgr.findById(Upload.class, uploadId); ExtractResponse response = new ExtractResponse(); - response.setResponseName(getName()); + response.setResponseName(getCommandName()); response.setObjectName("volume"); response.setId(id); response.setName(_entityMgr.findById(Volume.class, id).getName()); diff --git a/api/src/com/cloud/api/commands/GetCloudIdentifierCmd.java b/api/src/com/cloud/api/commands/GetCloudIdentifierCmd.java index ca5b4a57a51..030d4985014 100644 --- a/api/src/com/cloud/api/commands/GetCloudIdentifierCmd.java +++ b/api/src/com/cloud/api/commands/GetCloudIdentifierCmd.java @@ -55,7 +55,7 @@ public class GetCloudIdentifierCmd extends BaseCmd { /////////////// API Implementation/////////////////// ///////////////////////////////////////////////////// - public String getName() { + public String getCommandName() { return s_name; } @@ -67,7 +67,7 @@ public class GetCloudIdentifierCmd extends BaseCmd { response.setCloudIdentifier(result.get(0)); response.setSignature(result.get(1)); response.setObjectName("cloudidentifier"); - response.setResponseName(getName()); + response.setResponseName(getCommandName()); this.setResponseObject(response); } else { throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to get cloud identifier"); diff --git a/api/src/com/cloud/api/commands/ListAccountsCmd.java b/api/src/com/cloud/api/commands/ListAccountsCmd.java index bf238bba76f..004f62a4952 100644 --- a/api/src/com/cloud/api/commands/ListAccountsCmd.java +++ b/api/src/com/cloud/api/commands/ListAccountsCmd.java @@ -91,7 +91,7 @@ public class ListAccountsCmd extends BaseListCmd { ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -106,7 +106,7 @@ public class ListAccountsCmd extends BaseListCmd { accountResponses.add(acctResponse); } response.setResponses(accountResponses); - response.setResponseName(getName()); + response.setResponseName(getCommandName()); this.setResponseObject(response); } diff --git a/api/src/com/cloud/api/commands/ListAlertsCmd.java b/api/src/com/cloud/api/commands/ListAlertsCmd.java index d446542fa86..8fba5c4801b 100644 --- a/api/src/com/cloud/api/commands/ListAlertsCmd.java +++ b/api/src/com/cloud/api/commands/ListAlertsCmd.java @@ -57,7 +57,7 @@ public class ListAlertsCmd extends BaseListCmd { ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -78,7 +78,7 @@ public class ListAlertsCmd extends BaseListCmd { } response.setResponses(alertResponseList); - response.setResponseName(getName()); + response.setResponseName(getCommandName()); this.setResponseObject(response); } } diff --git a/api/src/com/cloud/api/commands/ListAsyncJobsCmd.java b/api/src/com/cloud/api/commands/ListAsyncJobsCmd.java index ca4f5b76fe3..5a571ddcaf1 100644 --- a/api/src/com/cloud/api/commands/ListAsyncJobsCmd.java +++ b/api/src/com/cloud/api/commands/ListAsyncJobsCmd.java @@ -67,7 +67,7 @@ public class ListAsyncJobsCmd extends BaseListCmd { /////////////// API Implementation/////////////////// ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -81,7 +81,7 @@ public class ListAsyncJobsCmd extends BaseListCmd { } response.setResponses(jobResponses); - response.setResponseName(getName()); + response.setResponseName(getCommandName()); this.setResponseObject(response); } } diff --git a/api/src/com/cloud/api/commands/ListCapabilitiesCmd.java b/api/src/com/cloud/api/commands/ListCapabilitiesCmd.java index 6697ffd7425..edb8c967310 100644 --- a/api/src/com/cloud/api/commands/ListCapabilitiesCmd.java +++ b/api/src/com/cloud/api/commands/ListCapabilitiesCmd.java @@ -32,7 +32,7 @@ public class ListCapabilitiesCmd extends BaseCmd { private static final String s_name = "listcapabilitiesresponse"; @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -43,7 +43,7 @@ public class ListCapabilitiesCmd extends BaseCmd { response.setNetworkGroupsEnabled(capabilities.get("networkGroupsEnabled")); response.setCloudStackVersion(capabilities.get("cloudStackVersion")); response.setObjectName("capability"); - response.setResponseName(getName()); + response.setResponseName(getCommandName()); this.setResponseObject(response); } } diff --git a/api/src/com/cloud/api/commands/ListCapacityCmd.java b/api/src/com/cloud/api/commands/ListCapacityCmd.java index 93a2ab923c3..f0f8efb0697 100644 --- a/api/src/com/cloud/api/commands/ListCapacityCmd.java +++ b/api/src/com/cloud/api/commands/ListCapacityCmd.java @@ -81,7 +81,7 @@ public class ListCapacityCmd extends BaseListCmd { ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -103,7 +103,7 @@ public class ListCapacityCmd extends BaseListCmd { ListResponse response = new ListResponse(); List capacityResponses = _responseGenerator.createCapacityResponse(result, s_percentFormat); response.setResponses(capacityResponses); - response.setResponseName(getName()); + response.setResponseName(getCommandName()); this.setResponseObject(response); } } diff --git a/api/src/com/cloud/api/commands/ListCfgsByCmd.java b/api/src/com/cloud/api/commands/ListCfgsByCmd.java index d1226b6f096..5b143f3ca1b 100644 --- a/api/src/com/cloud/api/commands/ListCfgsByCmd.java +++ b/api/src/com/cloud/api/commands/ListCfgsByCmd.java @@ -66,7 +66,7 @@ public class ListCfgsByCmd extends BaseListCmd { ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -82,7 +82,7 @@ public class ListCfgsByCmd extends BaseListCmd { } response.setResponses(configResponses); - response.setResponseName(getName()); + response.setResponseName(getCommandName()); this.setResponseObject(response); } } diff --git a/api/src/com/cloud/api/commands/ListClustersCmd.java b/api/src/com/cloud/api/commands/ListClustersCmd.java index 9e9c156c250..92061e267e3 100644 --- a/api/src/com/cloud/api/commands/ListClustersCmd.java +++ b/api/src/com/cloud/api/commands/ListClustersCmd.java @@ -79,7 +79,7 @@ public class ListClustersCmd extends BaseListCmd { ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -95,7 +95,7 @@ public class ListClustersCmd extends BaseListCmd { } response.setResponses(clusterResponses); - response.setResponseName(getName()); + response.setResponseName(getCommandName()); this.setResponseObject(response); } } diff --git a/api/src/com/cloud/api/commands/ListDiskOfferingsCmd.java b/api/src/com/cloud/api/commands/ListDiskOfferingsCmd.java index 46cc202d0ee..d6499c3de08 100644 --- a/api/src/com/cloud/api/commands/ListDiskOfferingsCmd.java +++ b/api/src/com/cloud/api/commands/ListDiskOfferingsCmd.java @@ -70,7 +70,7 @@ public class ListDiskOfferingsCmd extends BaseListCmd { ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -86,7 +86,7 @@ public class ListDiskOfferingsCmd extends BaseListCmd { } response.setResponses(diskOfferingResponses); - response.setResponseName(getName()); + response.setResponseName(getCommandName()); this.setResponseObject(response); } } diff --git a/api/src/com/cloud/api/commands/ListDomainChildrenCmd.java b/api/src/com/cloud/api/commands/ListDomainChildrenCmd.java index d00e533070a..b083b979737 100644 --- a/api/src/com/cloud/api/commands/ListDomainChildrenCmd.java +++ b/api/src/com/cloud/api/commands/ListDomainChildrenCmd.java @@ -70,7 +70,7 @@ public class ListDomainChildrenCmd extends BaseListCmd { ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -86,7 +86,7 @@ public class ListDomainChildrenCmd extends BaseListCmd { } response.setResponses(domainResponses); - response.setResponseName(getName()); + response.setResponseName(getCommandName()); this.setResponseObject(response); } } diff --git a/api/src/com/cloud/api/commands/ListDomainsCmd.java b/api/src/com/cloud/api/commands/ListDomainsCmd.java index af5ba803681..d97db72d345 100644 --- a/api/src/com/cloud/api/commands/ListDomainsCmd.java +++ b/api/src/com/cloud/api/commands/ListDomainsCmd.java @@ -70,7 +70,7 @@ public class ListDomainsCmd extends BaseListCmd { ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -86,7 +86,7 @@ public class ListDomainsCmd extends BaseListCmd { } response.setResponses(domainResponses); - response.setResponseName(getName()); + response.setResponseName(getCommandName()); this.setResponseObject(response); } } diff --git a/api/src/com/cloud/api/commands/ListEventsCmd.java b/api/src/com/cloud/api/commands/ListEventsCmd.java index f1d3285a6a5..f5f9254eb09 100644 --- a/api/src/com/cloud/api/commands/ListEventsCmd.java +++ b/api/src/com/cloud/api/commands/ListEventsCmd.java @@ -106,7 +106,7 @@ public class ListEventsCmd extends BaseListCmd { ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -120,7 +120,7 @@ public class ListEventsCmd extends BaseListCmd { } response.setResponses(eventResponses); - response.setResponseName(getName()); + response.setResponseName(getCommandName()); this.setResponseObject(response); } } diff --git a/api/src/com/cloud/api/commands/ListGuestOsCategoriesCmd.java b/api/src/com/cloud/api/commands/ListGuestOsCategoriesCmd.java index 89dab4c4d23..819203356c6 100644 --- a/api/src/com/cloud/api/commands/ListGuestOsCategoriesCmd.java +++ b/api/src/com/cloud/api/commands/ListGuestOsCategoriesCmd.java @@ -59,7 +59,7 @@ public class ListGuestOsCategoriesCmd extends BaseListCmd { ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -78,7 +78,7 @@ public class ListGuestOsCategoriesCmd extends BaseListCmd { } response.setResponses(osCatResponses); - response.setResponseName(getName()); + response.setResponseName(getCommandName()); this.setResponseObject(response); } } diff --git a/api/src/com/cloud/api/commands/ListGuestOsCmd.java b/api/src/com/cloud/api/commands/ListGuestOsCmd.java index c7222213762..3376a3e648d 100644 --- a/api/src/com/cloud/api/commands/ListGuestOsCmd.java +++ b/api/src/com/cloud/api/commands/ListGuestOsCmd.java @@ -76,7 +76,7 @@ public class ListGuestOsCmd extends BaseListCmd { } @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -96,7 +96,7 @@ public class ListGuestOsCmd extends BaseListCmd { } response.setResponses(osResponses); - response.setResponseName(getName()); + response.setResponseName(getCommandName()); this.setResponseObject(response); } } diff --git a/api/src/com/cloud/api/commands/ListHostsCmd.java b/api/src/com/cloud/api/commands/ListHostsCmd.java index 1cb214564ea..ba4586a984c 100644 --- a/api/src/com/cloud/api/commands/ListHostsCmd.java +++ b/api/src/com/cloud/api/commands/ListHostsCmd.java @@ -102,7 +102,7 @@ public class ListHostsCmd extends BaseListCmd { ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -123,7 +123,7 @@ public class ListHostsCmd extends BaseListCmd { } response.setResponses(hostResponses); - response.setResponseName(getName()); + response.setResponseName(getCommandName()); this.setResponseObject(response); } } diff --git a/api/src/com/cloud/api/commands/ListHypervisorsCmd.java b/api/src/com/cloud/api/commands/ListHypervisorsCmd.java index d22d9011d4a..60fc69bfae0 100644 --- a/api/src/com/cloud/api/commands/ListHypervisorsCmd.java +++ b/api/src/com/cloud/api/commands/ListHypervisorsCmd.java @@ -32,7 +32,7 @@ public class ListHypervisorsCmd extends BaseCmd { private static final String s_name = "listhypervisorsresponse"; @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -49,7 +49,7 @@ public class ListHypervisorsCmd extends BaseCmd { } response.setResponses(responses); - response.setResponseName(getName()); + response.setResponseName(getCommandName()); this.setResponseObject(response); } } diff --git a/api/src/com/cloud/api/commands/ListIpForwardingRulesCmd.java b/api/src/com/cloud/api/commands/ListIpForwardingRulesCmd.java index fb950f45760..b1748b4f508 100644 --- a/api/src/com/cloud/api/commands/ListIpForwardingRulesCmd.java +++ b/api/src/com/cloud/api/commands/ListIpForwardingRulesCmd.java @@ -60,7 +60,7 @@ public class ListIpForwardingRulesCmd extends BaseListCmd { /////////////// API Implementation/////////////////// ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -92,7 +92,7 @@ public class ListIpForwardingRulesCmd extends BaseListCmd { } } response.setResponses(ipForwardingResponses); - response.setResponseName(getName()); + response.setResponseName(getCommandName()); this.setResponseObject(response); } diff --git a/api/src/com/cloud/api/commands/ListIsosCmd.java b/api/src/com/cloud/api/commands/ListIsosCmd.java index 619cbdbad78..00161decc08 100755 --- a/api/src/com/cloud/api/commands/ListIsosCmd.java +++ b/api/src/com/cloud/api/commands/ListIsosCmd.java @@ -129,7 +129,7 @@ public class ListIsosCmd extends BaseListCmd { ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -160,7 +160,7 @@ public class ListIsosCmd extends BaseListCmd { } ListResponse response = _responseGenerator.createIsoResponse(isoZonePairSet, isAdmin, account); - response.setResponseName(getName()); + response.setResponseName(getCommandName()); this.setResponseObject(response); } } diff --git a/api/src/com/cloud/api/commands/ListLoadBalancerRuleInstancesCmd.java b/api/src/com/cloud/api/commands/ListLoadBalancerRuleInstancesCmd.java index d7b8563b876..958b8fb380d 100644 --- a/api/src/com/cloud/api/commands/ListLoadBalancerRuleInstancesCmd.java +++ b/api/src/com/cloud/api/commands/ListLoadBalancerRuleInstancesCmd.java @@ -63,7 +63,7 @@ public class ListLoadBalancerRuleInstancesCmd extends BaseListCmd { ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -72,14 +72,15 @@ public class ListLoadBalancerRuleInstancesCmd extends BaseListCmd { List result = _lbService.listLoadBalancerInstances(this); ListResponse response = new ListResponse(); List vmResponses = new ArrayList(); - for (UserVm instance : result) { - UserVmResponse userVmResponse = _responseGenerator.createUserVmResponse(instance); - userVmResponse.setObjectName("loadbalancerruleinstance"); - vmResponses.add(userVmResponse); + if (result != null) { + for (UserVm instance : result) { + UserVmResponse userVmResponse = _responseGenerator.createUserVmResponse(instance); + userVmResponse.setObjectName("loadbalancerruleinstance"); + vmResponses.add(userVmResponse); + } } - response.setResponses(vmResponses); - response.setResponseName(getName()); + response.setResponseName(getCommandName()); this.setResponseObject(response); } } diff --git a/api/src/com/cloud/api/commands/ListLoadBalancerRulesCmd.java b/api/src/com/cloud/api/commands/ListLoadBalancerRulesCmd.java index 87f4f544b71..d2358a0e56e 100644 --- a/api/src/com/cloud/api/commands/ListLoadBalancerRulesCmd.java +++ b/api/src/com/cloud/api/commands/ListLoadBalancerRulesCmd.java @@ -92,7 +92,7 @@ public class ListLoadBalancerRulesCmd extends BaseListCmd { ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -109,7 +109,7 @@ public class ListLoadBalancerRulesCmd extends BaseListCmd { } } response.setResponses(lbResponses); - response.setResponseName(getName()); + response.setResponseName(getCommandName()); this.setResponseObject(response); } } diff --git a/api/src/com/cloud/api/commands/ListNetworkGroupsCmd.java b/api/src/com/cloud/api/commands/ListNetworkGroupsCmd.java index ef5129d42a7..fbc25af7735 100644 --- a/api/src/com/cloud/api/commands/ListNetworkGroupsCmd.java +++ b/api/src/com/cloud/api/commands/ListNetworkGroupsCmd.java @@ -76,7 +76,7 @@ public class ListNetworkGroupsCmd extends BaseListCmd { ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -85,7 +85,7 @@ public class ListNetworkGroupsCmd extends BaseListCmd { List networkGroups = _networkGroupMgr.searchForNetworkGroupRules(this); ListResponse response = _responseGenerator.createNetworkGroupResponses(networkGroups); - response.setResponseName(getName()); + response.setResponseName(getCommandName()); this.setResponseObject(response); } } diff --git a/api/src/com/cloud/api/commands/ListNetworkOfferingsCmd.java b/api/src/com/cloud/api/commands/ListNetworkOfferingsCmd.java index 563fd6ec1ee..bc28dd90e63 100644 --- a/api/src/com/cloud/api/commands/ListNetworkOfferingsCmd.java +++ b/api/src/com/cloud/api/commands/ListNetworkOfferingsCmd.java @@ -104,7 +104,7 @@ public class ListNetworkOfferingsCmd extends BaseListCmd { /////////////// API Implementation/////////////////// ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return _name; } @@ -119,7 +119,7 @@ public class ListNetworkOfferingsCmd extends BaseListCmd { } response.setResponses(offeringResponses); - response.setResponseName(getName()); + response.setResponseName(getCommandName()); this.setResponseObject(response); } } diff --git a/api/src/com/cloud/api/commands/ListNetworksCmd.java b/api/src/com/cloud/api/commands/ListNetworksCmd.java index 39eb25f3db7..0b959f55098 100644 --- a/api/src/com/cloud/api/commands/ListNetworksCmd.java +++ b/api/src/com/cloud/api/commands/ListNetworksCmd.java @@ -90,7 +90,7 @@ public class ListNetworksCmd extends BaseListCmd { /////////////// API Implementation/////////////////// ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return _name; } @@ -105,7 +105,7 @@ public class ListNetworksCmd extends BaseListCmd { } response.setResponses(networkResponses); - response.setResponseName(getName()); + response.setResponseName(getCommandName()); this.setResponseObject(response); } } diff --git a/api/src/com/cloud/api/commands/ListPodsByCmd.java b/api/src/com/cloud/api/commands/ListPodsByCmd.java index 4d24c1f5663..efc96e2f404 100644 --- a/api/src/com/cloud/api/commands/ListPodsByCmd.java +++ b/api/src/com/cloud/api/commands/ListPodsByCmd.java @@ -72,7 +72,7 @@ public class ListPodsByCmd extends BaseListCmd { ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -88,7 +88,7 @@ public class ListPodsByCmd extends BaseListCmd { } response.setResponses(podResponses); - response.setResponseName(getName()); + response.setResponseName(getCommandName()); this.setResponseObject(response); } } diff --git a/api/src/com/cloud/api/commands/ListPortForwardingRulesCmd.java b/api/src/com/cloud/api/commands/ListPortForwardingRulesCmd.java index 230f9c67f4d..1c39444bdff 100644 --- a/api/src/com/cloud/api/commands/ListPortForwardingRulesCmd.java +++ b/api/src/com/cloud/api/commands/ListPortForwardingRulesCmd.java @@ -56,7 +56,7 @@ public class ListPortForwardingRulesCmd extends BaseListCmd { ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -72,7 +72,7 @@ public class ListPortForwardingRulesCmd extends BaseListCmd { fwResponses.add(ruleData); } response.setResponses(fwResponses); - response.setResponseName(getName()); + response.setResponseName(getCommandName()); this.setResponseObject(response); } } diff --git a/api/src/com/cloud/api/commands/ListPreallocatedLunsCmd.java b/api/src/com/cloud/api/commands/ListPreallocatedLunsCmd.java index 9a2666e4e14..645f0a6ca5b 100644 --- a/api/src/com/cloud/api/commands/ListPreallocatedLunsCmd.java +++ b/api/src/com/cloud/api/commands/ListPreallocatedLunsCmd.java @@ -65,7 +65,7 @@ public class ListPreallocatedLunsCmd extends BaseListCmd { ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -82,7 +82,7 @@ public class ListPreallocatedLunsCmd extends BaseListCmd { } response.setResponses(lunResponses); - response.setResponseName(getName()); + response.setResponseName(getCommandName()); this.setResponseObject(response); } } diff --git a/api/src/com/cloud/api/commands/ListPublicIpAddressesCmd.java b/api/src/com/cloud/api/commands/ListPublicIpAddressesCmd.java index a6896571ce2..0d9d801b0ba 100644 --- a/api/src/com/cloud/api/commands/ListPublicIpAddressesCmd.java +++ b/api/src/com/cloud/api/commands/ListPublicIpAddressesCmd.java @@ -99,7 +99,7 @@ public class ListPublicIpAddressesCmd extends BaseListCmd { ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -115,7 +115,7 @@ public class ListPublicIpAddressesCmd extends BaseListCmd { } response.setResponses(ipAddrResponses); - response.setResponseName(getName()); + response.setResponseName(getCommandName()); this.setResponseObject(response); } } diff --git a/api/src/com/cloud/api/commands/ListRecurringSnapshotScheduleCmd.java b/api/src/com/cloud/api/commands/ListRecurringSnapshotScheduleCmd.java index 10b76090b50..c555548618a 100644 --- a/api/src/com/cloud/api/commands/ListRecurringSnapshotScheduleCmd.java +++ b/api/src/com/cloud/api/commands/ListRecurringSnapshotScheduleCmd.java @@ -59,7 +59,7 @@ public class ListRecurringSnapshotScheduleCmd extends BaseListCmd { ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -80,7 +80,7 @@ public class ListRecurringSnapshotScheduleCmd extends BaseListCmd { } response.setResponses(snapshotScheduleResponses); - response.setResponseName(getName()); + response.setResponseName(getCommandName()); this.setResponseObject(response); } } diff --git a/api/src/com/cloud/api/commands/ListRemoteAccessVpnsCmd.java b/api/src/com/cloud/api/commands/ListRemoteAccessVpnsCmd.java index 400ebd18201..58cd691689a 100644 --- a/api/src/com/cloud/api/commands/ListRemoteAccessVpnsCmd.java +++ b/api/src/com/cloud/api/commands/ListRemoteAccessVpnsCmd.java @@ -90,7 +90,7 @@ public class ListRemoteAccessVpnsCmd extends BaseListCmd { ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -104,7 +104,7 @@ public class ListRemoteAccessVpnsCmd extends BaseListCmd { } response.setResponses(vpnResponses); - response.setResponseName(getName()); + response.setResponseName(getCommandName()); this.setResponseObject(response); } } diff --git a/api/src/com/cloud/api/commands/ListResourceLimitsCmd.java b/api/src/com/cloud/api/commands/ListResourceLimitsCmd.java index 4b2e2f26f49..d47a3e9637c 100644 --- a/api/src/com/cloud/api/commands/ListResourceLimitsCmd.java +++ b/api/src/com/cloud/api/commands/ListResourceLimitsCmd.java @@ -82,7 +82,7 @@ public class ListResourceLimitsCmd extends BaseListCmd { ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -98,7 +98,7 @@ public class ListResourceLimitsCmd extends BaseListCmd { } response.setResponses(limitResponses); - response.setResponseName(getName()); + response.setResponseName(getCommandName()); this.setResponseObject(response); } } diff --git a/api/src/com/cloud/api/commands/ListRoutersCmd.java b/api/src/com/cloud/api/commands/ListRoutersCmd.java index 35e3550a5c5..d1d6e6be4e8 100644 --- a/api/src/com/cloud/api/commands/ListRoutersCmd.java +++ b/api/src/com/cloud/api/commands/ListRoutersCmd.java @@ -100,7 +100,7 @@ public class ListRoutersCmd extends BaseListCmd { ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -120,7 +120,7 @@ public class ListRoutersCmd extends BaseListCmd { } response.setResponses(routerResponses); - response.setResponseName(getName()); + response.setResponseName(getCommandName()); this.setResponseObject(response); } } diff --git a/api/src/com/cloud/api/commands/ListServiceOfferingsCmd.java b/api/src/com/cloud/api/commands/ListServiceOfferingsCmd.java index 1c81a02c9f2..a6aa8cbdf6d 100644 --- a/api/src/com/cloud/api/commands/ListServiceOfferingsCmd.java +++ b/api/src/com/cloud/api/commands/ListServiceOfferingsCmd.java @@ -77,7 +77,7 @@ public class ListServiceOfferingsCmd extends BaseListCmd { ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -93,7 +93,7 @@ public class ListServiceOfferingsCmd extends BaseListCmd { } response.setResponses(offeringResponses); - response.setResponseName(getName()); + response.setResponseName(getCommandName()); this.setResponseObject(response); } } diff --git a/api/src/com/cloud/api/commands/ListSnapshotPoliciesCmd.java b/api/src/com/cloud/api/commands/ListSnapshotPoliciesCmd.java index c5b65cda1a0..6952adaf502 100644 --- a/api/src/com/cloud/api/commands/ListSnapshotPoliciesCmd.java +++ b/api/src/com/cloud/api/commands/ListSnapshotPoliciesCmd.java @@ -71,7 +71,7 @@ public class ListSnapshotPoliciesCmd extends BaseListCmd { ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -86,7 +86,7 @@ public class ListSnapshotPoliciesCmd extends BaseListCmd { policyResponses.add(policyResponse); } response.setResponses(policyResponses); - response.setResponseName(getName()); + response.setResponseName(getCommandName()); this.setResponseObject(response); } } diff --git a/api/src/com/cloud/api/commands/ListSnapshotsCmd.java b/api/src/com/cloud/api/commands/ListSnapshotsCmd.java index f7bb87a57fe..9a8823af80a 100644 --- a/api/src/com/cloud/api/commands/ListSnapshotsCmd.java +++ b/api/src/com/cloud/api/commands/ListSnapshotsCmd.java @@ -99,7 +99,7 @@ public class ListSnapshotsCmd extends BaseListCmd { ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -118,7 +118,7 @@ public class ListSnapshotsCmd extends BaseListCmd { snapshotResponses.add(snapshotResponse); } response.setResponses(snapshotResponses); - response.setResponseName(getName()); + response.setResponseName(getCommandName()); this.setResponseObject(response); } diff --git a/api/src/com/cloud/api/commands/ListStoragePoolsCmd.java b/api/src/com/cloud/api/commands/ListStoragePoolsCmd.java index d52b1569a15..6f3cc241b71 100644 --- a/api/src/com/cloud/api/commands/ListStoragePoolsCmd.java +++ b/api/src/com/cloud/api/commands/ListStoragePoolsCmd.java @@ -93,7 +93,7 @@ public class ListStoragePoolsCmd extends BaseListCmd { ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -113,7 +113,7 @@ public class ListStoragePoolsCmd extends BaseListCmd { } response.setResponses(poolResponses); - response.setResponseName(getName()); + response.setResponseName(getCommandName()); this.setResponseObject(response); } } diff --git a/api/src/com/cloud/api/commands/ListSystemVMsCmd.java b/api/src/com/cloud/api/commands/ListSystemVMsCmd.java index d2f60282aa4..b736671d51e 100644 --- a/api/src/com/cloud/api/commands/ListSystemVMsCmd.java +++ b/api/src/com/cloud/api/commands/ListSystemVMsCmd.java @@ -99,7 +99,7 @@ public class ListSystemVMsCmd extends BaseListCmd { ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -119,7 +119,7 @@ public class ListSystemVMsCmd extends BaseListCmd { } response.setResponses(vmResponses); - response.setResponseName(getName()); + response.setResponseName(getCommandName()); this.setResponseObject(response); } } diff --git a/api/src/com/cloud/api/commands/ListTemplateOrIsoPermissionsCmd.java b/api/src/com/cloud/api/commands/ListTemplateOrIsoPermissionsCmd.java index c9f221004ef..b1f04d1cd3d 100644 --- a/api/src/com/cloud/api/commands/ListTemplateOrIsoPermissionsCmd.java +++ b/api/src/com/cloud/api/commands/ListTemplateOrIsoPermissionsCmd.java @@ -69,7 +69,7 @@ public class ListTemplateOrIsoPermissionsCmd extends BaseCmd { ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -93,7 +93,7 @@ public class ListTemplateOrIsoPermissionsCmd extends BaseCmd { boolean isAdmin = ((account == null) || isAdmin(account.getType())); TemplatePermissionsResponse response = _responseGenerator.createTemplatePermissionsResponse(accountNames, id, isAdmin); - response.setResponseName(getName()); + response.setResponseName(getCommandName()); this.setResponseObject(response); } } diff --git a/api/src/com/cloud/api/commands/ListTemplatesCmd.java b/api/src/com/cloud/api/commands/ListTemplatesCmd.java index dc538d9d3a8..81460c625c8 100644 --- a/api/src/com/cloud/api/commands/ListTemplatesCmd.java +++ b/api/src/com/cloud/api/commands/ListTemplatesCmd.java @@ -110,7 +110,7 @@ public class ListTemplatesCmd extends BaseListCmd { ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -136,7 +136,7 @@ public class ListTemplatesCmd extends BaseListCmd { } response.setResponses(templateResponses); - response.setResponseName(getName()); + response.setResponseName(getCommandName()); this.setResponseObject(response); } } diff --git a/api/src/com/cloud/api/commands/ListUsersCmd.java b/api/src/com/cloud/api/commands/ListUsersCmd.java index 4d52eaf50cf..d7d796f0238 100644 --- a/api/src/com/cloud/api/commands/ListUsersCmd.java +++ b/api/src/com/cloud/api/commands/ListUsersCmd.java @@ -92,7 +92,7 @@ public class ListUsersCmd extends BaseListCmd { ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -107,7 +107,7 @@ public class ListUsersCmd extends BaseListCmd { userResponses.add(userResponse); } response.setResponses(userResponses); - response.setResponseName(getName()); + response.setResponseName(getCommandName()); this.setResponseObject(response); } } diff --git a/api/src/com/cloud/api/commands/ListVMGroupsCmd.java b/api/src/com/cloud/api/commands/ListVMGroupsCmd.java index e44179a7518..9aa5f3f87a5 100644 --- a/api/src/com/cloud/api/commands/ListVMGroupsCmd.java +++ b/api/src/com/cloud/api/commands/ListVMGroupsCmd.java @@ -77,7 +77,7 @@ public class ListVMGroupsCmd extends BaseListCmd { ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -93,7 +93,7 @@ public class ListVMGroupsCmd extends BaseListCmd { } response.setResponses(responses); - response.setResponseName(getName()); + response.setResponseName(getCommandName()); this.setResponseObject(response); } } diff --git a/api/src/com/cloud/api/commands/ListVMsCmd.java b/api/src/com/cloud/api/commands/ListVMsCmd.java index a40bf3802a1..681b1cdef48 100644 --- a/api/src/com/cloud/api/commands/ListVMsCmd.java +++ b/api/src/com/cloud/api/commands/ListVMsCmd.java @@ -130,7 +130,7 @@ public class ListVMsCmd extends BaseListCmd { /////////////// API Implementation/////////////////// ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -151,7 +151,7 @@ public class ListVMsCmd extends BaseListCmd { } } response.setResponses(vmResponses); - response.setResponseName(getName()); + response.setResponseName(getCommandName()); this.setResponseObject(response); } diff --git a/api/src/com/cloud/api/commands/ListVlanIpRangesCmd.java b/api/src/com/cloud/api/commands/ListVlanIpRangesCmd.java index 4bfcdf2e796..a742a283795 100644 --- a/api/src/com/cloud/api/commands/ListVlanIpRangesCmd.java +++ b/api/src/com/cloud/api/commands/ListVlanIpRangesCmd.java @@ -107,7 +107,7 @@ public class ListVlanIpRangesCmd extends BaseListCmd { ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -123,7 +123,7 @@ public class ListVlanIpRangesCmd extends BaseListCmd { } response.setResponses(vlanResponses); - response.setResponseName(getName()); + response.setResponseName(getCommandName()); this.setResponseObject(response); } } diff --git a/api/src/com/cloud/api/commands/ListVolumesCmd.java b/api/src/com/cloud/api/commands/ListVolumesCmd.java index 1f30ddbd9d1..368aeade8fe 100755 --- a/api/src/com/cloud/api/commands/ListVolumesCmd.java +++ b/api/src/com/cloud/api/commands/ListVolumesCmd.java @@ -113,7 +113,7 @@ public class ListVolumesCmd extends BaseListCmd { ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -134,7 +134,7 @@ public class ListVolumesCmd extends BaseListCmd { } response.setResponses(volResponses); - response.setResponseName(getName()); + response.setResponseName(getCommandName()); this.setResponseObject(response); } } diff --git a/api/src/com/cloud/api/commands/ListVpnUsersCmd.java b/api/src/com/cloud/api/commands/ListVpnUsersCmd.java index 933ebc1fb7b..0090fd095a0 100644 --- a/api/src/com/cloud/api/commands/ListVpnUsersCmd.java +++ b/api/src/com/cloud/api/commands/ListVpnUsersCmd.java @@ -77,7 +77,7 @@ public class ListVpnUsersCmd extends BaseListCmd { ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -92,7 +92,7 @@ public class ListVpnUsersCmd extends BaseListCmd { } response.setResponses(vpnResponses); - response.setResponseName(getName()); + response.setResponseName(getCommandName()); this.setResponseObject(response); } } diff --git a/api/src/com/cloud/api/commands/ListZonesByCmd.java b/api/src/com/cloud/api/commands/ListZonesByCmd.java index fb39cb07ced..0b52edcf512 100644 --- a/api/src/com/cloud/api/commands/ListZonesByCmd.java +++ b/api/src/com/cloud/api/commands/ListZonesByCmd.java @@ -68,7 +68,7 @@ public class ListZonesByCmd extends BaseListCmd { ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -84,7 +84,7 @@ public class ListZonesByCmd extends BaseListCmd { } response.setResponses(zoneResponses); - response.setResponseName(getName()); + response.setResponseName(getCommandName()); this.setResponseObject(response); } } diff --git a/api/src/com/cloud/api/commands/LockAccountCmd.java b/api/src/com/cloud/api/commands/LockAccountCmd.java index 0a4831b6d24..bae25b09c94 100644 --- a/api/src/com/cloud/api/commands/LockAccountCmd.java +++ b/api/src/com/cloud/api/commands/LockAccountCmd.java @@ -60,7 +60,7 @@ public class LockAccountCmd extends BaseCmd { ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -69,7 +69,7 @@ public class LockAccountCmd extends BaseCmd { Account result = _accountService.lockAccount(this); if (result != null){ AccountResponse response = _responseGenerator.createAccountResponse(result); - response.setResponseName(getName()); + response.setResponseName(getCommandName()); this.setResponseObject(response); } else { throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to lock account"); diff --git a/api/src/com/cloud/api/commands/LockUserCmd.java b/api/src/com/cloud/api/commands/LockUserCmd.java index 1a2da6bc0fd..5f46bc8f56c 100644 --- a/api/src/com/cloud/api/commands/LockUserCmd.java +++ b/api/src/com/cloud/api/commands/LockUserCmd.java @@ -53,7 +53,7 @@ public class LockUserCmd extends BaseCmd { ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -62,7 +62,7 @@ public class LockUserCmd extends BaseCmd { UserAccount user = _accountService.lockUser(this); if (user != null){ UserResponse response = _responseGenerator.createUserResponse(user); - response.setResponseName(getName()); + response.setResponseName(getCommandName()); this.setResponseObject(response); } else { throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to lock user"); diff --git a/api/src/com/cloud/api/commands/PrepareForMaintenanceCmd.java b/api/src/com/cloud/api/commands/PrepareForMaintenanceCmd.java index 36626f0a310..1e9b8dd24ed 100644 --- a/api/src/com/cloud/api/commands/PrepareForMaintenanceCmd.java +++ b/api/src/com/cloud/api/commands/PrepareForMaintenanceCmd.java @@ -58,7 +58,7 @@ public class PrepareForMaintenanceCmd extends BaseAsyncCmd { ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } diff --git a/api/src/com/cloud/api/commands/PreparePrimaryStorageForMaintenanceCmd.java b/api/src/com/cloud/api/commands/PreparePrimaryStorageForMaintenanceCmd.java index 50c832aba13..f6dd08121f6 100644 --- a/api/src/com/cloud/api/commands/PreparePrimaryStorageForMaintenanceCmd.java +++ b/api/src/com/cloud/api/commands/PreparePrimaryStorageForMaintenanceCmd.java @@ -57,7 +57,7 @@ public class PreparePrimaryStorageForMaintenanceCmd extends BaseAsyncCmd { ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } diff --git a/api/src/com/cloud/api/commands/QueryAsyncJobResultCmd.java b/api/src/com/cloud/api/commands/QueryAsyncJobResultCmd.java index 85d74a6c017..95694874cde 100644 --- a/api/src/com/cloud/api/commands/QueryAsyncJobResultCmd.java +++ b/api/src/com/cloud/api/commands/QueryAsyncJobResultCmd.java @@ -52,14 +52,14 @@ public class QueryAsyncJobResultCmd extends BaseCmd { ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @Override public void execute(){ AsyncJobResponse response = _responseGenerator.queryJobResult(this); - response.setResponseName(getName()); + response.setResponseName(getCommandName()); this.setResponseObject(response); } } diff --git a/api/src/com/cloud/api/commands/RebootRouterCmd.java b/api/src/com/cloud/api/commands/RebootRouterCmd.java index 8d3230993db..f2baa4ce2b5 100644 --- a/api/src/com/cloud/api/commands/RebootRouterCmd.java +++ b/api/src/com/cloud/api/commands/RebootRouterCmd.java @@ -57,7 +57,7 @@ public class RebootRouterCmd extends BaseAsyncCmd { ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } diff --git a/api/src/com/cloud/api/commands/RebootSystemVmCmd.java b/api/src/com/cloud/api/commands/RebootSystemVmCmd.java index b4ba6667a16..5de212ec3b7 100644 --- a/api/src/com/cloud/api/commands/RebootSystemVmCmd.java +++ b/api/src/com/cloud/api/commands/RebootSystemVmCmd.java @@ -59,7 +59,7 @@ public class RebootSystemVmCmd extends BaseAsyncCmd { ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -96,7 +96,7 @@ public class RebootSystemVmCmd extends BaseAsyncCmd { VirtualMachine result = _mgr.rebootSystemVM(this); if (result != null) { SystemVmResponse response = _responseGenerator.createSystemVmResponse(result); - response.setResponseName(getName()); + response.setResponseName(getCommandName()); this.setResponseObject(response); } else { throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Fail to reboot system vm"); diff --git a/api/src/com/cloud/api/commands/RebootVMCmd.java b/api/src/com/cloud/api/commands/RebootVMCmd.java index 1205634ed1d..f63833f7bec 100644 --- a/api/src/com/cloud/api/commands/RebootVMCmd.java +++ b/api/src/com/cloud/api/commands/RebootVMCmd.java @@ -56,7 +56,7 @@ public class RebootVMCmd extends BaseAsyncCmd { ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -93,7 +93,7 @@ public class RebootVMCmd extends BaseAsyncCmd { UserVm result = _userVmService.rebootVirtualMachine(this); if (result !=null){ UserVmResponse response = _responseGenerator.createUserVmResponse(result); - response.setResponseName(getName()); + response.setResponseName(getCommandName()); this.setResponseObject(response); } else { throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to reboot vm instance"); diff --git a/api/src/com/cloud/api/commands/ReconnectHostCmd.java b/api/src/com/cloud/api/commands/ReconnectHostCmd.java index 332fe23b07a..414394d62b4 100644 --- a/api/src/com/cloud/api/commands/ReconnectHostCmd.java +++ b/api/src/com/cloud/api/commands/ReconnectHostCmd.java @@ -60,7 +60,7 @@ public class ReconnectHostCmd extends BaseAsyncCmd { ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -102,7 +102,7 @@ public class ReconnectHostCmd extends BaseAsyncCmd { Host result = _resourceService.reconnectHost(this); if (result != null){ HostResponse response = _responseGenerator.createHostResponse(result); - response.setResponseName(getName()); + response.setResponseName(getCommandName()); this.setResponseObject(response); } else { throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to reconnect host"); diff --git a/api/src/com/cloud/api/commands/RecoverVMCmd.java b/api/src/com/cloud/api/commands/RecoverVMCmd.java index 9549cb8c63a..9555b078314 100644 --- a/api/src/com/cloud/api/commands/RecoverVMCmd.java +++ b/api/src/com/cloud/api/commands/RecoverVMCmd.java @@ -55,7 +55,7 @@ public class RecoverVMCmd extends BaseCmd { ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -65,7 +65,7 @@ public class RecoverVMCmd extends BaseCmd { UserVm result = _userVmService.recoverVirtualMachine(this); if (result != null){ UserVmResponse recoverVmResponse = _responseGenerator.createUserVmResponse(result); - recoverVmResponse.setResponseName(getName()); + recoverVmResponse.setResponseName(getCommandName()); this.setResponseObject(recoverVmResponse); } else { throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to recover vm"); diff --git a/api/src/com/cloud/api/commands/RegisterCmd.java b/api/src/com/cloud/api/commands/RegisterCmd.java index e5b74315b8f..62db077944e 100644 --- a/api/src/com/cloud/api/commands/RegisterCmd.java +++ b/api/src/com/cloud/api/commands/RegisterCmd.java @@ -51,7 +51,7 @@ public class RegisterCmd extends BaseCmd { /////////////// API Implementation/////////////////// ///////////////////////////////////////////////////// - public String getName() { + public String getCommandName() { return s_name; } @@ -62,7 +62,7 @@ public class RegisterCmd extends BaseCmd { response.setApiKey(keys[0]); response.setSecretKey(keys[1]); response.setObjectName("userkeys"); - response.setResponseName(getName()); + response.setResponseName(getCommandName()); this.setResponseObject(response); } } diff --git a/api/src/com/cloud/api/commands/RegisterIsoCmd.java b/api/src/com/cloud/api/commands/RegisterIsoCmd.java index 9f7f9bca459..6d1fdf30f60 100755 --- a/api/src/com/cloud/api/commands/RegisterIsoCmd.java +++ b/api/src/com/cloud/api/commands/RegisterIsoCmd.java @@ -118,7 +118,7 @@ public class RegisterIsoCmd extends BaseCmd { ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -128,7 +128,7 @@ public class RegisterIsoCmd extends BaseCmd { VirtualMachineTemplate template = _templateService.registerIso(this); if (template != null) { ListResponse response = _responseGenerator.createIsoResponses(template, zoneId); - response.setResponseName(getName()); + response.setResponseName(getCommandName()); this.setResponseObject(response); } else { throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to register iso"); diff --git a/api/src/com/cloud/api/commands/RegisterPreallocatedLunCmd.java b/api/src/com/cloud/api/commands/RegisterPreallocatedLunCmd.java index 21cc99f0d8c..e7d7f72d118 100644 --- a/api/src/com/cloud/api/commands/RegisterPreallocatedLunCmd.java +++ b/api/src/com/cloud/api/commands/RegisterPreallocatedLunCmd.java @@ -88,7 +88,7 @@ public class RegisterPreallocatedLunCmd extends BaseCmd { ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -97,7 +97,7 @@ public class RegisterPreallocatedLunCmd extends BaseCmd { Object result = _mgr.registerPreallocatedLun(this); if (result != null){ PreallocatedLunResponse response = _responseGenerator.createPreallocatedLunResponse(result); - response.setResponseName(getName()); + response.setResponseName(getCommandName()); this.setResponseObject(response); } else { throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to register preallocated lun"); diff --git a/api/src/com/cloud/api/commands/RegisterTemplateCmd.java b/api/src/com/cloud/api/commands/RegisterTemplateCmd.java index 9cf02d18afb..92abe0d210f 100755 --- a/api/src/com/cloud/api/commands/RegisterTemplateCmd.java +++ b/api/src/com/cloud/api/commands/RegisterTemplateCmd.java @@ -156,7 +156,7 @@ public class RegisterTemplateCmd extends BaseCmd { ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -170,7 +170,7 @@ public class RegisterTemplateCmd extends BaseCmd { VirtualMachineTemplate template = _templateService.registerTemplate(this); if (template != null){ ListResponse response = _responseGenerator.createTemplateResponse2(template, zoneId); - response.setResponseName(getName()); + response.setResponseName(getCommandName()); this.setResponseObject(response); } else { diff --git a/api/src/com/cloud/api/commands/RemoveFromLoadBalancerRuleCmd.java b/api/src/com/cloud/api/commands/RemoveFromLoadBalancerRuleCmd.java index 7fc4dd8a890..c72b79cf197 100644 --- a/api/src/com/cloud/api/commands/RemoveFromLoadBalancerRuleCmd.java +++ b/api/src/com/cloud/api/commands/RemoveFromLoadBalancerRuleCmd.java @@ -75,7 +75,7 @@ public class RemoveFromLoadBalancerRuleCmd extends BaseAsyncCmd { ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -119,7 +119,7 @@ public class RemoveFromLoadBalancerRuleCmd extends BaseAsyncCmd { boolean result = _lbService.removeFromLoadBalancer(id, virtualMachineIds); if (result) { - SuccessResponse response = new SuccessResponse(getName()); + SuccessResponse response = new SuccessResponse(getCommandName()); this.setResponseObject(response); } else { throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to remove instance from load balancer rule"); diff --git a/api/src/com/cloud/api/commands/RemoveVpnUserCmd.java b/api/src/com/cloud/api/commands/RemoveVpnUserCmd.java index 35c1c094af0..d7de8242edf 100644 --- a/api/src/com/cloud/api/commands/RemoveVpnUserCmd.java +++ b/api/src/com/cloud/api/commands/RemoveVpnUserCmd.java @@ -76,7 +76,7 @@ public class RemoveVpnUserCmd extends BaseAsyncCmd { ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -115,7 +115,7 @@ public class RemoveVpnUserCmd extends BaseAsyncCmd { try { boolean result = _networkService.removeVpnUser(this); if (result) { - SuccessResponse response = new SuccessResponse(getName()); + SuccessResponse response = new SuccessResponse(getCommandName()); this.setResponseObject(response); } else { throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to remove vpn user"); diff --git a/api/src/com/cloud/api/commands/ResetVMPasswordCmd.java b/api/src/com/cloud/api/commands/ResetVMPasswordCmd.java index 32e73d726e0..234156fd7ec 100644 --- a/api/src/com/cloud/api/commands/ResetVMPasswordCmd.java +++ b/api/src/com/cloud/api/commands/ResetVMPasswordCmd.java @@ -73,7 +73,7 @@ public class ResetVMPasswordCmd extends BaseAsyncCmd { ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -112,7 +112,7 @@ public class ResetVMPasswordCmd extends BaseAsyncCmd { UserVm result = _userVmService.resetVMPassword(this, password); if (result != null){ UserVmResponse response = _responseGenerator.createUserVmResponse(result); - response.setResponseName(getName()); + response.setResponseName(getCommandName()); this.setResponseObject(response); } else { throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to reset vm password"); diff --git a/api/src/com/cloud/api/commands/RevokeNetworkGroupIngressCmd.java b/api/src/com/cloud/api/commands/RevokeNetworkGroupIngressCmd.java index c105f3ade59..66f77bbb024 100644 --- a/api/src/com/cloud/api/commands/RevokeNetworkGroupIngressCmd.java +++ b/api/src/com/cloud/api/commands/RevokeNetworkGroupIngressCmd.java @@ -118,7 +118,7 @@ public class RevokeNetworkGroupIngressCmd extends BaseAsyncCmd { ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -182,7 +182,7 @@ public class RevokeNetworkGroupIngressCmd extends BaseAsyncCmd { public void execute(){ boolean result = _networkGroupMgr.revokeNetworkGroupIngress(this); if (result) { - SuccessResponse response = new SuccessResponse(getName()); + SuccessResponse response = new SuccessResponse(getCommandName()); this.setResponseObject(response); } else { throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to revoke security group ingress rule"); diff --git a/api/src/com/cloud/api/commands/SetVMOSTypeCmd.java b/api/src/com/cloud/api/commands/SetVMOSTypeCmd.java index fdc7bbc5d14..1ec4e961eb8 100644 --- a/api/src/com/cloud/api/commands/SetVMOSTypeCmd.java +++ b/api/src/com/cloud/api/commands/SetVMOSTypeCmd.java @@ -61,7 +61,7 @@ public class SetVMOSTypeCmd extends BaseCmd { ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } diff --git a/api/src/com/cloud/api/commands/StartRouterCmd.java b/api/src/com/cloud/api/commands/StartRouterCmd.java index 0d09f76c6ed..8f257c90ac0 100644 --- a/api/src/com/cloud/api/commands/StartRouterCmd.java +++ b/api/src/com/cloud/api/commands/StartRouterCmd.java @@ -63,7 +63,7 @@ public class StartRouterCmd extends BaseAsyncCmd { ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -104,7 +104,7 @@ public class StartRouterCmd extends BaseAsyncCmd { VirtualRouter result = _routerService.startRouter(this); if (result != null){ DomainRouterResponse routerResponse = _responseGenerator.createDomainRouterResponse(result); - routerResponse.setResponseName(getName()); + routerResponse.setResponseName(getCommandName()); this.setResponseObject(routerResponse); } else { throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to start router"); diff --git a/api/src/com/cloud/api/commands/StartSystemVMCmd.java b/api/src/com/cloud/api/commands/StartSystemVMCmd.java index 456db974442..351f9664622 100644 --- a/api/src/com/cloud/api/commands/StartSystemVMCmd.java +++ b/api/src/com/cloud/api/commands/StartSystemVMCmd.java @@ -59,7 +59,7 @@ public class StartSystemVMCmd extends BaseAsyncCmd { ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -100,7 +100,7 @@ public class StartSystemVMCmd extends BaseAsyncCmd { VirtualMachine instance = _mgr.startSystemVM(this); if (instance != null) { SystemVmResponse response = _responseGenerator.createSystemVmResponse(instance); - response.setResponseName(getName()); + response.setResponseName(getCommandName()); this.setResponseObject(response); } else { throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Fail to start system vm"); diff --git a/api/src/com/cloud/api/commands/StartVMCmd.java b/api/src/com/cloud/api/commands/StartVMCmd.java index cacef59582f..533ac77aec1 100644 --- a/api/src/com/cloud/api/commands/StartVMCmd.java +++ b/api/src/com/cloud/api/commands/StartVMCmd.java @@ -62,7 +62,7 @@ public class StartVMCmd extends BaseAsyncCmd { ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -104,7 +104,7 @@ public class StartVMCmd extends BaseAsyncCmd { UserVm result = _userVmService.startVirtualMachine(this); if (result != null){ UserVmResponse response = _responseGenerator.createUserVmResponse(result); - response.setResponseName(getName()); + response.setResponseName(getCommandName()); this.setResponseObject(response); } else { throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to start a vm"); diff --git a/api/src/com/cloud/api/commands/StopRouterCmd.java b/api/src/com/cloud/api/commands/StopRouterCmd.java index ade73cd4607..c3b94afa758 100644 --- a/api/src/com/cloud/api/commands/StopRouterCmd.java +++ b/api/src/com/cloud/api/commands/StopRouterCmd.java @@ -61,7 +61,7 @@ public class StopRouterCmd extends BaseAsyncCmd { ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -98,7 +98,7 @@ public class StopRouterCmd extends BaseAsyncCmd { VirtualRouter result = _routerService.stopRouter(this); if (result != null){ DomainRouterResponse response =_responseGenerator.createDomainRouterResponse(result); - response.setResponseName(getName()); + response.setResponseName(getCommandName()); this.setResponseObject(response); } else { throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to stop router"); diff --git a/api/src/com/cloud/api/commands/StopSystemVmCmd.java b/api/src/com/cloud/api/commands/StopSystemVmCmd.java index b2869b538ad..b5e6a41cb42 100644 --- a/api/src/com/cloud/api/commands/StopSystemVmCmd.java +++ b/api/src/com/cloud/api/commands/StopSystemVmCmd.java @@ -59,7 +59,7 @@ public class StopSystemVmCmd extends BaseAsyncCmd { ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -96,7 +96,7 @@ public class StopSystemVmCmd extends BaseAsyncCmd { VirtualMachine result = _mgr.stopSystemVM(this); if (result != null) { SystemVmResponse response = _responseGenerator.createSystemVmResponse(result); - response.setResponseName(getName()); + response.setResponseName(getCommandName()); this.setResponseObject(response); } else { throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Fail to stop system vm"); diff --git a/api/src/com/cloud/api/commands/StopVMCmd.java b/api/src/com/cloud/api/commands/StopVMCmd.java index 7493384d815..81d35428909 100644 --- a/api/src/com/cloud/api/commands/StopVMCmd.java +++ b/api/src/com/cloud/api/commands/StopVMCmd.java @@ -58,7 +58,7 @@ public class StopVMCmd extends BaseAsyncCmd { ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -99,7 +99,7 @@ public class StopVMCmd extends BaseAsyncCmd { UserVm result = _userVmService.stopVirtualMachine(this); if (result != null) { UserVmResponse response = _responseGenerator.createUserVmResponse(result); - response.setResponseName(getName()); + response.setResponseName(getCommandName()); this.setResponseObject(response); } else { throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to stop vm"); diff --git a/api/src/com/cloud/api/commands/UpdateAccountCmd.java b/api/src/com/cloud/api/commands/UpdateAccountCmd.java index 49d8ed0575d..1553b379c7a 100644 --- a/api/src/com/cloud/api/commands/UpdateAccountCmd.java +++ b/api/src/com/cloud/api/commands/UpdateAccountCmd.java @@ -66,7 +66,7 @@ public class UpdateAccountCmd extends BaseCmd{ ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -75,7 +75,7 @@ public class UpdateAccountCmd extends BaseCmd{ Account result = _accountService.updateAccount(this); if (result != null){ AccountResponse response = _responseGenerator.createAccountResponse(result); - response.setResponseName(getName()); + response.setResponseName(getCommandName()); this.setResponseObject(response); } else { throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to update account"); diff --git a/api/src/com/cloud/api/commands/UpdateCfgCmd.java b/api/src/com/cloud/api/commands/UpdateCfgCmd.java index 4b08ed05bd0..a563be4b93d 100644 --- a/api/src/com/cloud/api/commands/UpdateCfgCmd.java +++ b/api/src/com/cloud/api/commands/UpdateCfgCmd.java @@ -60,7 +60,7 @@ public class UpdateCfgCmd extends BaseCmd { ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -69,7 +69,7 @@ public class UpdateCfgCmd extends BaseCmd { Configuration cfg = _configService.updateConfiguration(this); if (cfg != null) { ConfigurationResponse response = _responseGenerator.createConfigurationResponse(cfg); - response.setResponseName(getName()); + response.setResponseName(getCommandName()); this.setResponseObject(response); } else { throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to update config"); diff --git a/api/src/com/cloud/api/commands/UpdateDiskOfferingCmd.java b/api/src/com/cloud/api/commands/UpdateDiskOfferingCmd.java index 41a3c67d481..b0d7652bbba 100644 --- a/api/src/com/cloud/api/commands/UpdateDiskOfferingCmd.java +++ b/api/src/com/cloud/api/commands/UpdateDiskOfferingCmd.java @@ -81,7 +81,7 @@ public class UpdateDiskOfferingCmd extends BaseCmd{ ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -90,7 +90,7 @@ public class UpdateDiskOfferingCmd extends BaseCmd{ DiskOffering result = _configService.updateDiskOffering(this); if (result != null){ DiskOfferingResponse response = _responseGenerator.createDiskOfferingResponse(result); - response.setResponseName(getName()); + response.setResponseName(getCommandName()); this.setResponseObject(response); } else { throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to update disk offering"); diff --git a/api/src/com/cloud/api/commands/UpdateDomainCmd.java b/api/src/com/cloud/api/commands/UpdateDomainCmd.java index aae39c6bcaf..f2ebe4179b0 100644 --- a/api/src/com/cloud/api/commands/UpdateDomainCmd.java +++ b/api/src/com/cloud/api/commands/UpdateDomainCmd.java @@ -59,7 +59,7 @@ public class UpdateDomainCmd extends BaseCmd { ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -68,7 +68,7 @@ public class UpdateDomainCmd extends BaseCmd { Domain domain = _mgr.updateDomain(this); if (domain != null) { DomainResponse response = _responseGenerator.createDomainResponse(domain); - response.setResponseName(getName()); + response.setResponseName(getCommandName()); this.setResponseObject(response); } else { throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to update domain"); diff --git a/api/src/com/cloud/api/commands/UpdateHostCmd.java b/api/src/com/cloud/api/commands/UpdateHostCmd.java index 3ec4f816328..5869e8f224a 100644 --- a/api/src/com/cloud/api/commands/UpdateHostCmd.java +++ b/api/src/com/cloud/api/commands/UpdateHostCmd.java @@ -60,7 +60,7 @@ public class UpdateHostCmd extends BaseCmd { ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -73,7 +73,7 @@ public class UpdateHostCmd extends BaseCmd { Host result = _resourceService.updateHost(this); if (result != null) { HostResponse hostResponse = _responseGenerator.createHostResponse(result); - hostResponse.setResponseName(getName()); + hostResponse.setResponseName(getCommandName()); this.setResponseObject(hostResponse); } else { throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to update host"); diff --git a/api/src/com/cloud/api/commands/UpdateIsoCmd.java b/api/src/com/cloud/api/commands/UpdateIsoCmd.java index eba2135a761..27ac88735c9 100755 --- a/api/src/com/cloud/api/commands/UpdateIsoCmd.java +++ b/api/src/com/cloud/api/commands/UpdateIsoCmd.java @@ -49,7 +49,7 @@ public class UpdateIsoCmd extends UpdateTemplateOrIsoCmd { ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -58,7 +58,7 @@ public class UpdateIsoCmd extends UpdateTemplateOrIsoCmd { VirtualMachineTemplate result = _mgr.updateTemplate(this); if (result != null) { TemplateResponse response = _responseGenerator.createIsoResponse(result); - response.setResponseName(getName()); + response.setResponseName(getCommandName()); this.setResponseObject(response); } else { throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to update iso"); diff --git a/api/src/com/cloud/api/commands/UpdateIsoPermissionsCmd.java b/api/src/com/cloud/api/commands/UpdateIsoPermissionsCmd.java index 326431cd180..a98fd336a84 100644 --- a/api/src/com/cloud/api/commands/UpdateIsoPermissionsCmd.java +++ b/api/src/com/cloud/api/commands/UpdateIsoPermissionsCmd.java @@ -21,7 +21,7 @@ public class UpdateIsoPermissionsCmd extends UpdateTemplateOrIsoPermissionsCmd { public void execute(){ boolean result = _mgr.updateTemplatePermissions(this); if (result) { - SuccessResponse response = new SuccessResponse(getName()); + SuccessResponse response = new SuccessResponse(getCommandName()); this.setResponseObject(response); } else { throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to update iso permissinos"); diff --git a/api/src/com/cloud/api/commands/UpdateLoadBalancerRuleCmd.java b/api/src/com/cloud/api/commands/UpdateLoadBalancerRuleCmd.java index ef8575095a7..87a4027bc2c 100644 --- a/api/src/com/cloud/api/commands/UpdateLoadBalancerRuleCmd.java +++ b/api/src/com/cloud/api/commands/UpdateLoadBalancerRuleCmd.java @@ -83,7 +83,7 @@ public class UpdateLoadBalancerRuleCmd extends BaseAsyncCmd { ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -111,7 +111,7 @@ public class UpdateLoadBalancerRuleCmd extends BaseAsyncCmd { LoadBalancer result = _lbService.updateLoadBalancerRule(this); if (result != null){ LoadBalancerResponse response = _responseGenerator.createLoadBalancerResponse(result); - response.setResponseName(getName()); + response.setResponseName(getCommandName()); this.setResponseObject(response); } else { throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to update load balancer rule"); diff --git a/api/src/com/cloud/api/commands/UpdatePodCmd.java b/api/src/com/cloud/api/commands/UpdatePodCmd.java index df132eac885..b149c6d5aa4 100644 --- a/api/src/com/cloud/api/commands/UpdatePodCmd.java +++ b/api/src/com/cloud/api/commands/UpdatePodCmd.java @@ -89,7 +89,7 @@ public class UpdatePodCmd extends BaseCmd { ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -98,7 +98,7 @@ public class UpdatePodCmd extends BaseCmd { Pod result = _configService.editPod(this); if (result != null) { PodResponse response = _responseGenerator.createPodResponse(result); - response.setResponseName(getName()); + response.setResponseName(getCommandName()); this.setResponseObject(response); } else { throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to update pod"); diff --git a/api/src/com/cloud/api/commands/UpdatePortForwardingRuleCmd.java b/api/src/com/cloud/api/commands/UpdatePortForwardingRuleCmd.java index 610f34d4e62..052d9a5d721 100644 --- a/api/src/com/cloud/api/commands/UpdatePortForwardingRuleCmd.java +++ b/api/src/com/cloud/api/commands/UpdatePortForwardingRuleCmd.java @@ -71,7 +71,7 @@ public class UpdatePortForwardingRuleCmd extends BaseAsyncCmd { ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } diff --git a/api/src/com/cloud/api/commands/UpdateResourceLimitCmd.java b/api/src/com/cloud/api/commands/UpdateResourceLimitCmd.java index 7de7444f03e..0cb5da1ae8a 100644 --- a/api/src/com/cloud/api/commands/UpdateResourceLimitCmd.java +++ b/api/src/com/cloud/api/commands/UpdateResourceLimitCmd.java @@ -80,7 +80,7 @@ public class UpdateResourceLimitCmd extends BaseCmd { ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -89,7 +89,7 @@ public class UpdateResourceLimitCmd extends BaseCmd { ResourceLimit result = _accountService.updateResourceLimit(this); if (result != null){ ResourceLimitResponse response = _responseGenerator.createResourceLimitResponse(result); - response.setResponseName(getName()); + response.setResponseName(getCommandName()); this.setResponseObject(response); } else { throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to update resource limit"); diff --git a/api/src/com/cloud/api/commands/UpdateServiceOfferingCmd.java b/api/src/com/cloud/api/commands/UpdateServiceOfferingCmd.java index 96db774da5e..9719cda1028 100644 --- a/api/src/com/cloud/api/commands/UpdateServiceOfferingCmd.java +++ b/api/src/com/cloud/api/commands/UpdateServiceOfferingCmd.java @@ -97,7 +97,7 @@ public class UpdateServiceOfferingCmd extends BaseCmd { @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -108,7 +108,7 @@ public class UpdateServiceOfferingCmd extends BaseCmd { ServiceOffering result = _configService.updateServiceOffering(this); if (result != null){ ServiceOfferingResponse response = _responseGenerator.createServiceOfferingResponse(result); - response.setResponseName(getName()); + response.setResponseName(getCommandName()); this.setResponseObject(response); } else { throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to update service offering"); diff --git a/api/src/com/cloud/api/commands/UpdateStoragePoolCmd.java b/api/src/com/cloud/api/commands/UpdateStoragePoolCmd.java index 9ccd59181b8..cfc2b096999 100644 --- a/api/src/com/cloud/api/commands/UpdateStoragePoolCmd.java +++ b/api/src/com/cloud/api/commands/UpdateStoragePoolCmd.java @@ -61,7 +61,7 @@ public class UpdateStoragePoolCmd extends BaseCmd { ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -70,7 +70,7 @@ public class UpdateStoragePoolCmd extends BaseCmd { StoragePool result = _storageMgr.updateStoragePool(this); if (result != null){ StoragePoolResponse response = _responseGenerator.createStoragePoolResponse(result); - response.setResponseName(getName()); + response.setResponseName(getCommandName()); this.setResponseObject(response); } else { throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to update storage pool"); diff --git a/api/src/com/cloud/api/commands/UpdateTemplateCmd.java b/api/src/com/cloud/api/commands/UpdateTemplateCmd.java index 3dbf9d4ced3..3b1e3532729 100755 --- a/api/src/com/cloud/api/commands/UpdateTemplateCmd.java +++ b/api/src/com/cloud/api/commands/UpdateTemplateCmd.java @@ -44,7 +44,7 @@ public class UpdateTemplateCmd extends UpdateTemplateOrIsoCmd { ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -59,7 +59,7 @@ public class UpdateTemplateCmd extends UpdateTemplateOrIsoCmd { if (result != null) { TemplateResponse response = _responseGenerator.createIsoResponse(result); response.setObjectName("template"); - response.setResponseName(getName()); + response.setResponseName(getCommandName()); this.setResponseObject(response); } else { throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to update template"); diff --git a/api/src/com/cloud/api/commands/UpdateTemplateOrIsoPermissionsCmd.java b/api/src/com/cloud/api/commands/UpdateTemplateOrIsoPermissionsCmd.java index 77a39f5fb11..eb54c844e4d 100644 --- a/api/src/com/cloud/api/commands/UpdateTemplateOrIsoPermissionsCmd.java +++ b/api/src/com/cloud/api/commands/UpdateTemplateOrIsoPermissionsCmd.java @@ -62,7 +62,7 @@ public abstract class UpdateTemplateOrIsoPermissionsCmd extends BaseCmd { ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } diff --git a/api/src/com/cloud/api/commands/UpdateTemplatePermissionsCmd.java b/api/src/com/cloud/api/commands/UpdateTemplatePermissionsCmd.java index cf68f3ef60a..53e4881b750 100644 --- a/api/src/com/cloud/api/commands/UpdateTemplatePermissionsCmd.java +++ b/api/src/com/cloud/api/commands/UpdateTemplatePermissionsCmd.java @@ -43,7 +43,7 @@ public class UpdateTemplatePermissionsCmd extends UpdateTemplateOrIsoPermissions public void execute(){ boolean result = _mgr.updateTemplatePermissions(this); if (result) { - SuccessResponse response = new SuccessResponse(getName()); + SuccessResponse response = new SuccessResponse(getCommandName()); this.setResponseObject(response); } else { throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to delete template permissions"); diff --git a/api/src/com/cloud/api/commands/UpdateUserCmd.java b/api/src/com/cloud/api/commands/UpdateUserCmd.java index e614bd33009..6c43d12b2f0 100644 --- a/api/src/com/cloud/api/commands/UpdateUserCmd.java +++ b/api/src/com/cloud/api/commands/UpdateUserCmd.java @@ -110,7 +110,7 @@ public class UpdateUserCmd extends BaseCmd { ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -119,7 +119,7 @@ public class UpdateUserCmd extends BaseCmd { UserAccount user = _accountService.updateUser(this); if (user != null){ UserResponse response = _responseGenerator.createUserResponse(user); - response.setResponseName(getName()); + response.setResponseName(getCommandName()); this.setResponseObject(response); } else { throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to update user"); diff --git a/api/src/com/cloud/api/commands/UpdateVMCmd.java b/api/src/com/cloud/api/commands/UpdateVMCmd.java index 16fdd2a4c15..9d081691d85 100644 --- a/api/src/com/cloud/api/commands/UpdateVMCmd.java +++ b/api/src/com/cloud/api/commands/UpdateVMCmd.java @@ -73,7 +73,7 @@ public class UpdateVMCmd extends BaseCmd{ ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -86,7 +86,7 @@ public class UpdateVMCmd extends BaseCmd{ UserVm result = _userVmService.updateVirtualMachine(this); if (result != null){ UserVmResponse response = _responseGenerator.createUserVmResponse(result); - response.setResponseName(getName()); + response.setResponseName(getCommandName()); this.setResponseObject(response); } else { throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to update vm"); diff --git a/api/src/com/cloud/api/commands/UpdateVMGroupCmd.java b/api/src/com/cloud/api/commands/UpdateVMGroupCmd.java index 2ad067c2262..6b7b2777a91 100644 --- a/api/src/com/cloud/api/commands/UpdateVMGroupCmd.java +++ b/api/src/com/cloud/api/commands/UpdateVMGroupCmd.java @@ -60,7 +60,7 @@ public class UpdateVMGroupCmd extends BaseCmd{ ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -69,7 +69,7 @@ public class UpdateVMGroupCmd extends BaseCmd{ InstanceGroup result = _mgr.updateVmGroup(this); if (result != null){ InstanceGroupResponse response = _responseGenerator.createInstanceGroupResponse(result); - response.setResponseName(getName()); + response.setResponseName(getCommandName()); this.setResponseObject(response); } else { throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to update vm instance group"); diff --git a/api/src/com/cloud/api/commands/UpdateZoneCmd.java b/api/src/com/cloud/api/commands/UpdateZoneCmd.java index ef238e91a15..94bc14ea079 100644 --- a/api/src/com/cloud/api/commands/UpdateZoneCmd.java +++ b/api/src/com/cloud/api/commands/UpdateZoneCmd.java @@ -121,7 +121,7 @@ public class UpdateZoneCmd extends BaseCmd { @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -130,7 +130,7 @@ public class UpdateZoneCmd extends BaseCmd { DataCenter result = _configService.editZone(this); if (result != null) { ZoneResponse response = _responseGenerator.createZoneResponse(result); - response.setResponseName(getName()); + response.setResponseName(getCommandName()); this.setResponseObject(response); } else { throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to update zone; internal error."); diff --git a/api/src/com/cloud/api/commands/UpgradeRouterCmd.java b/api/src/com/cloud/api/commands/UpgradeRouterCmd.java index 84ee4b714da..11ee5c60325 100644 --- a/api/src/com/cloud/api/commands/UpgradeRouterCmd.java +++ b/api/src/com/cloud/api/commands/UpgradeRouterCmd.java @@ -59,7 +59,7 @@ public class UpgradeRouterCmd extends BaseCmd { ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -68,7 +68,7 @@ public class UpgradeRouterCmd extends BaseCmd { VirtualRouter router = _routerService.upgradeRouter(this); if (router != null){ DomainRouterResponse routerResponse = _responseGenerator.createDomainRouterResponse(router); - routerResponse.setResponseName(getName()); + routerResponse.setResponseName(getCommandName()); this.setResponseObject(routerResponse); } else { throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to upgrade router"); diff --git a/api/src/com/cloud/api/commands/UpgradeVMCmd.java b/api/src/com/cloud/api/commands/UpgradeVMCmd.java index ebb8bfef1af..b5856291c61 100644 --- a/api/src/com/cloud/api/commands/UpgradeVMCmd.java +++ b/api/src/com/cloud/api/commands/UpgradeVMCmd.java @@ -61,7 +61,7 @@ public class UpgradeVMCmd extends BaseCmd { ///////////////////////////////////////////////////// @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -74,7 +74,7 @@ public class UpgradeVMCmd extends BaseCmd { UserVm result = _userVmService.upgradeVirtualMachine(this); if (result != null){ UserVmResponse response = _responseGenerator.createUserVmResponse(result); - response.setResponseName(getName()); + response.setResponseName(getCommandName()); this.setResponseObject(response); } else { throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to upgrade vm"); diff --git a/api/src/com/cloud/api/commands/UploadCustomCertificateCmd.java b/api/src/com/cloud/api/commands/UploadCustomCertificateCmd.java index 37cf90186e2..c70e1c74153 100644 --- a/api/src/com/cloud/api/commands/UploadCustomCertificateCmd.java +++ b/api/src/com/cloud/api/commands/UploadCustomCertificateCmd.java @@ -53,7 +53,7 @@ public class UploadCustomCertificateCmd extends BaseAsyncCmd { } @Override - public String getName() { + public String getCommandName() { return s_name; } @@ -71,7 +71,7 @@ public class UploadCustomCertificateCmd extends BaseAsyncCmd { String result = _mgr.uploadCertificate(this); if (result != null){ CustomCertificateResponse response = new CustomCertificateResponse(); - response.setResponseName(getName()); + response.setResponseName(getCommandName()); response.setUpdatedConsoleProxyIdList(result); response.setObjectName("customcertificate"); this.setResponseObject(response); diff --git a/server/src/com/cloud/api/ApiDispatcher.java b/server/src/com/cloud/api/ApiDispatcher.java index 23059e1d703..b18558b194f 100644 --- a/server/src/com/cloud/api/ApiDispatcher.java +++ b/server/src/com/cloud/api/ApiDispatcher.java @@ -71,7 +71,7 @@ public class ApiDispatcher { s_logger.info(t.getMessage()); throw new ServerApiException(BaseCmd.PARAM_ERROR, t.getMessage()); }else if (t instanceof PermissionDeniedException) { - s_logger.info(t.getMessage()); + s_logger.info("PermissionDenied: " + t.getMessage()); throw new ServerApiException(BaseCmd.ACCOUNT_ERROR, t.getMessage()); }else if (t instanceof AccountLimitException) { s_logger.info(t.getMessage()); @@ -109,7 +109,7 @@ public class ApiDispatcher { s_logger.info(t.getMessage()); throw new ServerApiException(BaseCmd.PARAM_ERROR, t.getMessage()); }else if (t instanceof PermissionDeniedException) { - s_logger.info(t.getMessage()); + s_logger.info("PermissionDenied: " + t.getMessage()); throw new ServerApiException(BaseCmd.ACCOUNT_ERROR, t.getMessage()); }else if (t instanceof AccountLimitException) { s_logger.info(t.getMessage()); @@ -171,7 +171,7 @@ public class ApiDispatcher { Object paramObj = unpackedParams.get(parameterAnnotation.name()); if (paramObj == null) { if (parameterAnnotation.required()) { - throw new ServerApiException(BaseCmd.PARAM_ERROR, "Unable to execute API command " + cmd.getName() + " due to missing parameter " + parameterAnnotation.name()); + throw new ServerApiException(BaseCmd.PARAM_ERROR, "Unable to execute API command " + cmd.getCommandName() + " due to missing parameter " + parameterAnnotation.name()); } continue; } @@ -181,19 +181,19 @@ public class ApiDispatcher { setFieldValue(field, cmd, paramObj, parameterAnnotation); } catch (IllegalArgumentException argEx) { if (s_logger.isDebugEnabled()) { - s_logger.debug("Unable to execute API command " + cmd.getName() + " due to invalid value " + paramObj + " for parameter " + parameterAnnotation.name()); + s_logger.debug("Unable to execute API command " + cmd.getCommandName() + " due to invalid value " + paramObj + " for parameter " + parameterAnnotation.name()); } - throw new ServerApiException(BaseCmd.PARAM_ERROR, "Unable to execute API command " + cmd.getName() + " due to invalid value " + paramObj + " for parameter " + parameterAnnotation.name()); + throw new ServerApiException(BaseCmd.PARAM_ERROR, "Unable to execute API command " + cmd.getCommandName() + " due to invalid value " + paramObj + " for parameter " + parameterAnnotation.name()); } catch (ParseException parseEx) { if (s_logger.isDebugEnabled()) { - s_logger.debug("Invalid date parameter " + paramObj + " passed to command " + cmd.getName()); + s_logger.debug("Invalid date parameter " + paramObj + " passed to command " + cmd.getCommandName()); } - throw new ServerApiException(BaseCmd.PARAM_ERROR, "Unable to parse date " + paramObj + " for command " + cmd.getName() + ", please pass dates in the format yyyy-MM-dd"); + throw new ServerApiException(BaseCmd.PARAM_ERROR, "Unable to parse date " + paramObj + " for command " + cmd.getCommandName() + ", please pass dates in the format yyyy-MM-dd"); } catch (CloudRuntimeException cloudEx) { // FIXME: Better error message? This only happens if the API command is not executable, which typically means // there was // and IllegalAccessException setting one of the parameters. - throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Internal error executing API command " + cmd.getName()); + throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Internal error executing API command " + cmd.getCommandName()); } } } @@ -254,8 +254,8 @@ public class ApiDispatcher { break; } } catch (IllegalAccessException ex) { - s_logger.error("Error initializing command " + cmdObj.getName() + ", field " + field.getName() + " is not accessible."); - throw new CloudRuntimeException("Internal error initializing parameters for command " + cmdObj.getName() + " [field " + field.getName() + " is not accessible]"); + s_logger.error("Error initializing command " + cmdObj.getCommandName() + ", field " + field.getName() + " is not accessible."); + throw new CloudRuntimeException("Internal error initializing parameters for command " + cmdObj.getCommandName() + " [field " + field.getName() + " is not accessible]"); } } } diff --git a/server/src/com/cloud/async/AsyncJobManagerImpl.java b/server/src/com/cloud/async/AsyncJobManagerImpl.java index 78f7a061f12..c30bc060426 100644 --- a/server/src/com/cloud/async/AsyncJobManagerImpl.java +++ b/server/src/com/cloud/async/AsyncJobManagerImpl.java @@ -412,7 +412,7 @@ public class AsyncJobManagerImpl implements AsyncJobManager { ExceptionResponse response = new ExceptionResponse(); response.setErrorCode(errorCode); response.setErrorText(errorMsg); - response.setResponseName((cmdObj == null) ? "unknowncommandresponse" : cmdObj.getName()); + response.setResponseName((cmdObj == null) ? "unknowncommandresponse" : cmdObj.getCommandName()); // FIXME: setting resultCode to BaseCmd.INTERNAL_ERROR is not right, usually executors have their exception handling // and we need to preserve that as much as possible here diff --git a/server/src/com/cloud/network/LoadBalancerVO.java b/server/src/com/cloud/network/LoadBalancerVO.java index a0c6e0be4cb..f3affe8c630 100644 --- a/server/src/com/cloud/network/LoadBalancerVO.java +++ b/server/src/com/cloud/network/LoadBalancerVO.java @@ -32,7 +32,7 @@ import com.cloud.utils.net.Ip; import com.cloud.utils.net.NetUtils; @Entity -@Table(name=("load_balancer")) +@Table(name=("load_balancing_rules")) @DiscriminatorValue(value="LoadBalancing") @PrimaryKeyJoinColumn(name="id") public class LoadBalancerVO extends FirewallRuleVO implements LoadBalancer { @@ -46,10 +46,10 @@ public class LoadBalancerVO extends FirewallRuleVO implements LoadBalancer { @Column(name="algorithm") private String algorithm; - @Column(name="dest_port_start") + @Column(name="default_port_start") private int defaultPortStart; - @Column(name="dest_port_end") + @Column(name="default_port_end") private int defaultPortEnd; public LoadBalancerVO() { diff --git a/server/src/com/cloud/network/NetworkManagerImpl.java b/server/src/com/cloud/network/NetworkManagerImpl.java index f5b8057d011..9ed9a41ac78 100755 --- a/server/src/com/cloud/network/NetworkManagerImpl.java +++ b/server/src/com/cloud/network/NetworkManagerImpl.java @@ -223,6 +223,8 @@ public class NetworkManagerImpl implements NetworkManager, NetworkService, Manag if (vlanUse == VlanType.DirectAttached) { addr.setState(IpAddress.State.Allocated); + } else { + addr.setAssociatedNetworkId(networkId); } if (!_ipAddressDao.update(addr.getAddress(), addr)) { @@ -582,11 +584,12 @@ public class NetworkManagerImpl implements NetworkManager, NetworkService, Manag } txn.start(); - ip = fetchNewPublicIp(zoneId, VlanType.VirtualNetwork, owner, network.getId(), false); + if (ip == null) { throw new InsufficientAddressCapacityException("Unable to find available public IP addresses", DataCenter.class, zoneId); } + _accountMgr.incrementResourceCount(ownerId, ResourceType.public_ip); String ipAddress = ip.getAddress(); @@ -841,10 +844,7 @@ public class NetworkManagerImpl implements NetworkManager, NetworkService, Manag } return configs; } - } else if (predefined != null && predefined.getBroadcastUri() != null) { - //don't allow duplicated vlans in the same zone - List configs = _networksDao.listBy(owner.getId(), offering.getId(), plan.getDataCenterId()); - } + } List configs = new ArrayList(); diff --git a/server/src/com/cloud/network/lb/LoadBalancingRulesManagerImpl.java b/server/src/com/cloud/network/lb/LoadBalancingRulesManagerImpl.java index 3292eb55070..ff02f4777a5 100644 --- a/server/src/com/cloud/network/lb/LoadBalancingRulesManagerImpl.java +++ b/server/src/com/cloud/network/lb/LoadBalancingRulesManagerImpl.java @@ -33,6 +33,8 @@ import com.cloud.api.commands.ListLoadBalancerRuleInstancesCmd; import com.cloud.api.commands.ListLoadBalancerRulesCmd; import com.cloud.api.commands.UpdateLoadBalancerRuleCmd; import com.cloud.dc.dao.VlanDao; +import com.cloud.domain.DomainVO; +import com.cloud.domain.dao.DomainDao; import com.cloud.event.EventTypes; import com.cloud.event.EventVO; import com.cloud.event.dao.EventDao; @@ -49,14 +51,21 @@ import com.cloud.network.dao.IPAddressDao; import com.cloud.network.dao.LoadBalancerDao; import com.cloud.network.dao.LoadBalancerVMMapDao; import com.cloud.network.rules.FirewallRule; +import com.cloud.network.rules.FirewallRuleVO; import com.cloud.network.rules.LoadBalancer; import com.cloud.network.rules.RulesManager; +import com.cloud.user.Account; import com.cloud.user.AccountManager; import com.cloud.user.UserContext; +import com.cloud.user.dao.AccountDao; import com.cloud.uservm.UserVm; import com.cloud.utils.component.Inject; import com.cloud.utils.component.Manager; import com.cloud.utils.db.DB; +import com.cloud.utils.db.Filter; +import com.cloud.utils.db.JoinBuilder; +import com.cloud.utils.db.SearchBuilder; +import com.cloud.utils.db.SearchCriteria; import com.cloud.utils.db.Transaction; import com.cloud.utils.exception.CloudRuntimeException; import com.cloud.utils.net.Ip; @@ -91,6 +100,8 @@ public class LoadBalancingRulesManagerImpl implements LoadBalancingRulesManager, @Inject LoadBalancerVMMapDao _lb2VmMapDao; @Inject UserVmDao _vmDao; + @Inject AccountDao _accountDao; + @Inject DomainDao _domainDao; @Override @DB public boolean assignToLoadBalancer(long loadBalancerId, List instanceIds) { @@ -207,7 +218,7 @@ public class LoadBalancingRulesManagerImpl implements LoadBalancingRulesManager, // make sure ip address exists IPAddressVO ipAddr = _ipAddressDao.findById(srcIp.addr()); - if (ipAddr == null || ipAddr.getAllocatedTime() == null || ipAddr.getAllocatedToAccountId() == null) { + if (ipAddr == null || !ipAddr.readyToUse()) { throw new InvalidParameterValueException("Unable to create load balancer rule, invalid IP address " + srcIp); } @@ -237,9 +248,14 @@ public class LoadBalancingRulesManagerImpl implements LoadBalancingRulesManager, if ((lb.getAlgorithm() == null) || !NetUtils.isValidAlgorithm(lb.getAlgorithm())) { throw new InvalidParameterValueException("Invalid algorithm: " + lb.getAlgorithm()); } - + + Long networkId = lb.getNetworkId(); + if (networkId == -1 ) { + networkId = ipAddr.getAssociatedNetworkId(); + } + _accountMgr.checkAccess(caller.getAccount(), ipAddr); LoadBalancerVO newRule = new LoadBalancerVO(lb.getXid(), lb.getName(), lb.getDescription(), lb.getSourceIpAddress(), lb.getSourcePortEnd(), - lb.getDefaultPortStart(), lb.getAlgorithm(), lb.getNetworkId(), lb.getAccountId(), lb.getDomainId()); + lb.getDefaultPortStart(), lb.getAlgorithm(), networkId, ipAddr.getAccountId(), ipAddr.getDomainId()); newRule = _lbDao.persist(newRule); @@ -1001,181 +1017,152 @@ public class LoadBalancingRulesManagerImpl implements LoadBalancingRulesManager, @Override public List listLoadBalancerInstances(ListLoadBalancerRuleInstancesCmd cmd) throws PermissionDeniedException { -// Account account = UserContext.current().getAccount(); -// Long loadBalancerId = cmd.getId(); -// Boolean applied = cmd.isApplied(); -// -// if (applied == null) { -// applied = Boolean.TRUE; -// } -// -// LoadBalancerVO loadBalancer = _loadBalancerDao.findById(loadBalancerId); -// if (loadBalancer == null) { -// return null; -// } -// -// if (account != null) { -// long lbAcctId = loadBalancer.getAccountId(); -// if (isAdmin(account.getType())) { -// Account userAccount = _accountDao.findById(lbAcctId); -// if (!_domainDao.isChildDomain(account.getDomainId(), userAccount.getDomainId())) { -// throw new PermissionDeniedException("Invalid load balancer rule id (" + loadBalancerId + ") given, unable to list load balancer instances."); -// } -// } else if (account.getId() != lbAcctId) { -// throw new PermissionDeniedException("Unable to list load balancer instances, account " + account.getAccountName() + " does not own load balancer rule " + loadBalancer.getName()); -// } -// } -// -// List loadBalancerInstances = new ArrayList(); -// List vmLoadBalancerMappings = null; -// if (applied) { -// // List only the instances that have actually been applied to the load balancer (pending is false). -// vmLoadBalancerMappings = _loadBalancerVMMapDao.listByLoadBalancerId(loadBalancerId, false); -// } else { -// // List all instances applied, even pending ones that are currently being assigned, so that the semantics -// // of "what instances can I apply to this load balancer" are maintained. -// vmLoadBalancerMappings = _loadBalancerVMMapDao.listByLoadBalancerId(loadBalancerId); -// } -// List appliedInstanceIdList = new ArrayList(); -// if ((vmLoadBalancerMappings != null) && !vmLoadBalancerMappings.isEmpty()) { -// for (LoadBalancerVMMapVO vmLoadBalancerMapping : vmLoadBalancerMappings) { -// appliedInstanceIdList.add(vmLoadBalancerMapping.getInstanceId()); -// } -// } -// -// IPAddressVO addr = _publicIpAddressDao.findById(loadBalancer.getIpAddress()); -// List userVms = _userVmDao.listVirtualNetworkInstancesByAcctAndZone(loadBalancer.getAccountId(), addr.getDataCenterId()); -// -// for (UserVmVO userVm : userVms) { -// // if the VM is destroyed, being expunged, in an error state, or in an unknown state, skip it -// switch (userVm.getState()) { -// case Destroyed: -// case Expunging: -// case Error: -// case Unknown: -// continue; -// } -// -// boolean isApplied = appliedInstanceIdList.contains(userVm.getId()); -// if (!applied && !isApplied) { -// loadBalancerInstances.add(userVm); -// } else if (applied && isApplied) { -// loadBalancerInstances.add(userVm); -// } -// } -// -// return loadBalancerInstances; - return null; + Account account = UserContext.current().getAccount(); + Long loadBalancerId = cmd.getId(); + Boolean applied = cmd.isApplied(); + + if (applied == null) { + applied = Boolean.TRUE; + } + + LoadBalancerVO loadBalancer = _lbDao.findById(loadBalancerId); + if (loadBalancer == null) { + return null; + } + + if (account != null) { + long lbAcctId = loadBalancer.getAccountId(); + if (account.getType() == Account.ACCOUNT_TYPE_DOMAIN_ADMIN) { + Account userAccount = _accountDao.findById(lbAcctId); + if (!_domainDao.isChildDomain(account.getDomainId(), userAccount.getDomainId())) { + throw new PermissionDeniedException("Invalid load balancer rule id (" + loadBalancerId + ") given, unable to list load balancer instances."); + } + } else if (account.getId() != lbAcctId) { + throw new PermissionDeniedException("Unable to list load balancer instances, account " + account.getAccountName() + " does not own load balancer rule " + loadBalancer.getName()); + } + } + + List loadBalancerInstances = new ArrayList(); + List vmLoadBalancerMappings = null; + if (applied) { + // List only the instances that have actually been applied to the load balancer (pending is false). + vmLoadBalancerMappings = _lb2VmMapDao.listByLoadBalancerId(loadBalancerId, false); + } else { + // List all instances applied, even pending ones that are currently being assigned, so that the semantics + // of "what instances can I apply to this load balancer" are maintained. + vmLoadBalancerMappings = _lb2VmMapDao.listByLoadBalancerId(loadBalancerId); + } + List appliedInstanceIdList = new ArrayList(); + if ((vmLoadBalancerMappings != null) && !vmLoadBalancerMappings.isEmpty()) { + for (LoadBalancerVMMapVO vmLoadBalancerMapping : vmLoadBalancerMappings) { + appliedInstanceIdList.add(vmLoadBalancerMapping.getInstanceId()); + } + } + + IPAddressVO addr = _ipAddressDao.findById(loadBalancer.getSourceIpAddress().toString()); + List userVms = _vmDao.listVirtualNetworkInstancesByAcctAndZone(loadBalancer.getAccountId(), addr.getDataCenterId()); + + for (UserVmVO userVm : userVms) { + // if the VM is destroyed, being expunged, in an error state, or in an unknown state, skip it + switch (userVm.getState()) { + case Destroyed: + case Expunging: + case Error: + case Unknown: + continue; + } + + boolean isApplied = appliedInstanceIdList.contains(userVm.getId()); + if (!applied && !isApplied) { + loadBalancerInstances.add(userVm); + } else if (applied && isApplied) { + loadBalancerInstances.add(userVm); + } + } + + return loadBalancerInstances; } @Override public List searchForLoadBalancers(ListLoadBalancerRulesCmd cmd) throws InvalidParameterValueException, PermissionDeniedException { - // do some parameter validation -// Account account = UserContext.current().getAccount(); -// String accountName = cmd.getAccountName(); -// Long domainId = cmd.getDomainId(); -// Long accountId = null; -// Account ipAddressOwner = null; -// String ipAddress = cmd.getPublicIp(); -// -// if (ipAddress != null) { -// IPAddressVO ipAddressVO = _publicIpAddressDao.findById(ipAddress); -// if (ipAddressVO == null) { -// throw new InvalidParameterValueException("Unable to list load balancers, IP address " + ipAddress + " not found."); -// } else { -// Long ipAddrAcctId = ipAddressVO.getAccountId(); -// if (ipAddrAcctId == null) { -// throw new InvalidParameterValueException("Unable to list load balancers, IP address " + ipAddress + " is not associated with an account."); -// } -// ipAddressOwner = _accountDao.findById(ipAddrAcctId); -// } -// } -// -// if ((account == null) || isAdmin(account.getType())) { -// // validate domainId before proceeding -// if (domainId != null) { -// if ((account != null) && !_domainDao.isChildDomain(account.getDomainId(), domainId)) { -// throw new PermissionDeniedException("Unable to list load balancers for domain id " + domainId + ", permission denied."); -// } -// if (accountName != null) { -// Account userAccount = _accountDao.findActiveAccount(accountName, domainId); -// if (userAccount != null) { -// accountId = userAccount.getId(); -// } else { -// throw new InvalidParameterValueException("Unable to find account " + accountName + " in domain " + domainId); -// } -// } -// } else if (ipAddressOwner != null) { -// if ((account != null) && !_domainDao.isChildDomain(account.getDomainId(), ipAddressOwner.getDomainId())) { -// throw new PermissionDeniedException("Unable to list load balancer rules for IP address " + ipAddress + ", permission denied."); -// } -// } else { -// domainId = ((account == null) ? DomainVO.ROOT_DOMAIN : account.getDomainId()); -// } -// } else { -// accountId = account.getId(); -// } -// -// Filter searchFilter = new Filter(LoadBalancerVO.class, "ipAddress", true, cmd.getStartIndex(), cmd.getPageSizeVal()); -// -// Object id = cmd.getId(); -// Object name = cmd.getLoadBalancerRuleName(); -// Object keyword = cmd.getKeyword(); -// Object instanceId = cmd.getVirtualMachineId(); -// -// SearchBuilder sb = _loadBalancerDao.createSearchBuilder(); -// sb.and("id", sb.entity().getId(), SearchCriteria.Op.EQ); -// sb.and("nameEQ", sb.entity().getName(), SearchCriteria.Op.EQ); -// sb.and("accountId", sb.entity().getAccountId(), SearchCriteria.Op.EQ); -// sb.and("ipAddress", sb.entity().getIpAddress(), SearchCriteria.Op.EQ); -// -// if ((accountId == null) && (domainId != null)) { -// // if accountId isn't specified, we can do a domain match for the admin case -// SearchBuilder domainSearch = _domainDao.createSearchBuilder(); -// domainSearch.and("path", domainSearch.entity().getPath(), SearchCriteria.Op.LIKE); -// sb.join("domainSearch", domainSearch, sb.entity().getDomainId(), domainSearch.entity().getId(), JoinBuilder.JoinType.INNER); -// } -// -// if (instanceId != null) { -// SearchBuilder lbVMSearch = _loadBalancerVMMapDao.createSearchBuilder(); -// lbVMSearch.and("instanceId", lbVMSearch.entity().getInstanceId(), SearchCriteria.Op.EQ); -// sb.join("lbVMSearch", lbVMSearch, sb.entity().getId(), lbVMSearch.entity().getLoadBalancerId(), JoinBuilder.JoinType.INNER); -// } -// -// SearchCriteria sc = sb.create(); -// if (keyword != null) { -// SearchCriteria ssc = _loadBalancerDao.createSearchCriteria(); -// ssc.addOr("name", SearchCriteria.Op.LIKE, "%" + keyword + "%"); -// ssc.addOr("description", SearchCriteria.Op.LIKE, "%" + keyword + "%"); -// -// sc.addAnd("name", SearchCriteria.Op.SC, ssc); -// } -// -// if (name != null) { -// sc.setParameters("nameEQ", name); -// } -// -// if (id != null) { -// sc.setParameters("id", id); -// } -// -// if (ipAddress != null) { -// sc.setParameters("ipAddress", ipAddress); -// } -// -// if (accountId != null) { -// sc.setParameters("accountId", accountId); -// } else if (domainId != null) { -// DomainVO domain = _domainDao.findById(domainId); -// sc.setJoinParameters("domainSearch", "path", domain.getPath() + "%"); -// } -// -// if (instanceId != null) { -// sc.setJoinParameters("lbVMSearch", "instanceId", instanceId); -// } -// -// return _loadBalancerDao.search(sc, searchFilter); - return null; + Account caller = UserContext.current().getAccount(); + Account owner = null; + Long domainId = cmd.getDomainId(); + String accountName = cmd.getAccountName(); + Long accountId = null; + String ipString = cmd.getPublicIp(); + Ip ipAddress = null; + if (ipString != null) { + ipAddress = new Ip(cmd.getPublicIp()); + } + + if (accountName != null && domainId != null) { + owner = _accountDao.findActiveAccount(accountName, domainId); + if (owner == null) { + accountId = -1L; + } + } + + if (caller.getType() == Account.ACCOUNT_TYPE_NORMAL) { + accountId = caller.getAccountId(); + } else if (caller.getType() == Account.ACCOUNT_TYPE_ADMIN && owner != null) { + accountId = owner.getId(); + } else if (owner != null && caller.getType() == Account.ACCOUNT_TYPE_DOMAIN_ADMIN){ + _accountMgr.checkAccess(caller, owner); + } + + Filter searchFilter = new Filter(LoadBalancerVO.class, "id", true, cmd.getStartIndex(), cmd.getPageSizeVal()); + + Object id = cmd.getId(); + Object name = cmd.getLoadBalancerRuleName(); + Object keyword = cmd.getKeyword(); + Object instanceId = cmd.getVirtualMachineId(); + + SearchBuilder sb = _lbDao.createSearchBuilder(); + sb.and("id", sb.entity().getId(), SearchCriteria.Op.EQ); + sb.and("name", sb.entity().getName(), SearchCriteria.Op.LIKE); + sb.and("sourceIpAddress", sb.entity().getSourceIpAddress(), SearchCriteria.Op.EQ); + sb.and("accountId", sb.entity().getAccountId(), SearchCriteria.Op.EQ); + sb.and("domainId", sb.entity().getDomainId(), SearchCriteria.Op.EQ); + + if (instanceId != null) { + SearchBuilder lbVMSearch = _lb2VmMapDao.createSearchBuilder(); + lbVMSearch.and("instanceId", lbVMSearch.entity().getInstanceId(), SearchCriteria.Op.EQ); + sb.join("lbVMSearch", lbVMSearch, sb.entity().getId(), lbVMSearch.entity().getLoadBalancerId(), JoinBuilder.JoinType.INNER); + } + + SearchCriteria sc = sb.create(); + if (keyword != null) { + SearchCriteria ssc = _lbDao.createSearchCriteria(); + ssc.addOr("name", SearchCriteria.Op.LIKE, "%" + keyword + "%"); + ssc.addOr("description", SearchCriteria.Op.LIKE, "%" + keyword + "%"); + + sc.addAnd("name", SearchCriteria.Op.SC, ssc); + } + + if (name != null) { + sc.setParameters("name", "%" + name + "%"); + } + + if (id != null) { + sc.setParameters("id", id); + } + + if (ipAddress != null) { + sc.setParameters("sourceIpAddress", ipAddress); + } + + if (instanceId != null) { + sc.setJoinParameters("lbVMSearch", "instanceId", instanceId); + } + + if (accountId != null) { + sc.setParameters("accountId", accountId); + } else if (domainId != null) { + sc.setParameters("domainId", domainId); + } + + return _lbDao.search(sc, searchFilter); } // @Override diff --git a/server/src/com/cloud/server/ManagementServerImpl.java b/server/src/com/cloud/server/ManagementServerImpl.java index 359f1f2344f..16bb10a9419 100755 --- a/server/src/com/cloud/server/ManagementServerImpl.java +++ b/server/src/com/cloud/server/ManagementServerImpl.java @@ -4625,7 +4625,7 @@ public class ManagementServerImpl implements ManagementServer { // Update the async Job ExtractResponse resultObj = new ExtractResponse(volumeId, volume.getName(), accountId, UploadVO.Status.COPY_IN_PROGRESS.toString(), uploadJob.getId()); - resultObj.setResponseName(cmd.getName()); + resultObj.setResponseName(cmd.getCommandName()); AsyncJobExecutor asyncExecutor = BaseAsyncJobExecutor.getCurrentExecutor(); if (asyncExecutor != null) { job = asyncExecutor.getJob();