cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject [1/2] git commit: updated refs/heads/4.7 to d9ce59f
Date Wed, 20 Jan 2016 12:47:39 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/4.7 0b5aa7871 -> d9ce59f11


CLOUDSTACK-9239 throw exception on deprecated command


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

Branch: refs/heads/4.7
Commit: 9e72796e96161444b861b146c19d6c1f6d7aa88a
Parents: 57a2a0b
Author: Daan Hoogland <daan@onecht.net>
Authored: Mon Jan 18 15:01:33 2016 +0100
Committer: Daan Hoogland <daan@onecht.net>
Committed: Tue Jan 19 10:29:43 2016 +0100

----------------------------------------------------------------------
 .../command/admin/account/LockAccountCmd.java   | 25 +++++++++-----------
 1 file changed, 11 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9e72796e/api/src/org/apache/cloudstack/api/command/admin/account/LockAccountCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/account/LockAccountCmd.java b/api/src/org/apache/cloudstack/api/command/admin/account/LockAccountCmd.java
index 3c185e4..05b370a 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/account/LockAccountCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/account/LockAccountCmd.java
@@ -16,7 +16,7 @@
 // under the License.
 package org.apache.cloudstack.api.command.admin.account;
 
-import org.apache.log4j.Logger;
+import java.util.logging.Logger;
 
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -26,9 +26,14 @@ import org.apache.cloudstack.api.response.AccountResponse;
 import org.apache.cloudstack.api.response.DomainResponse;
 
 import com.cloud.user.Account;
-
-@APICommand(name = "lockAccount", description = "Locks an account", responseObject = AccountResponse.class,
entityType = {Account.class},
-        requestHasSensitiveInfo = false, responseHasSensitiveInfo = true)
+import com.cloud.utils.exception.CloudRuntimeException;
+
+@APICommand(name = "lockAccount",
+            description = "This deprecated function used to locks an account. Look for the
API DisableAccount instead",
+            responseObject = AccountResponse.class,
+            entityType = {Account.class},
+            requestHasSensitiveInfo = false,
+            responseHasSensitiveInfo = true)
 public class LockAccountCmd extends BaseCmd {
     public static final Logger s_logger = Logger.getLogger(LockAccountCmd.class.getName());
 
@@ -71,7 +76,7 @@ public class LockAccountCmd extends BaseCmd {
 
     @Override
     public long getEntityOwnerId() {
-        Account account = _accountService.getActiveAccountByName(getAccountName(), getDomainId());
+        final Account account = _accountService.getActiveAccountByName(getAccountName(),
getDomainId());
         if (account != null) {
             return account.getAccountId();
         }
@@ -81,14 +86,6 @@ public class LockAccountCmd extends BaseCmd {
 
     @Override
     public void execute() {
-//        Account result = null;
-        //result = _accountService.lockAccount(this);
-//        if (result != null){
-//            AccountResponse response = _responseGenerator.createAccountResponse(result);
-//            response.setResponseName(getCommandName());
-//            this.setResponseObject(response);
-//        } else {
-//            throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to lock account");
-//        }
+        throw new CloudRuntimeException("LockAccount does not lock accounts. Its implementation
is disabled. Use DisableAccount instead");
     }
 }


Mime
View raw message