use of com.cloud.api.response.AccountResponse in project CloudStack-archive by CloudStack-extras.
the class DisableAccountCmd method execute.
@Override
public void execute() throws ConcurrentOperationException, ResourceUnavailableException {
UserContext.current().setEventDetails("Account Name: " + getAccountName() + ", Domain Id:" + getDomainId());
Account result = null;
if (lockRequested)
result = _accountService.lockAccount(getAccountName(), getDomainId(), getId());
else
result = _accountService.disableAccount(getAccountName(), getDomainId(), getId());
if (result != null) {
AccountResponse response = _responseGenerator.createAccountResponse(result);
response.setResponseName(getCommandName());
this.setResponseObject(response);
} else {
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, lockRequested == true ? "Failed to lock account" : "Failed to disable account");
}
}
Aggregations