use of com.cloud.user.UserAccount in project CloudStack-archive by CloudStack-extras.
the class DisableUserCmd method execute.
@Override
public void execute() {
UserContext.current().setEventDetails("UserId: " + getId());
UserAccount user = _accountService.disableUser(getId());
if (user != null) {
UserResponse response = _responseGenerator.createUserResponse(user);
response.setResponseName(getCommandName());
this.setResponseObject(response);
} else {
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to disable user");
}
}
use of com.cloud.user.UserAccount in project CloudStack-archive by CloudStack-extras.
the class EnableUserCmd method execute.
@Override
public void execute() {
UserContext.current().setEventDetails("UserId: " + getId());
UserAccount user = _accountService.enableUser(getId());
if (user != null) {
UserResponse response = _responseGenerator.createUserResponse(user);
response.setResponseName(getCommandName());
this.setResponseObject(response);
} else {
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to enable user");
}
}
use of com.cloud.user.UserAccount in project CloudStack-archive by CloudStack-extras.
the class LockUserCmd method execute.
@Override
public void execute() {
UserAccount user = _accountService.lockUser(getId());
if (user != null) {
UserResponse response = _responseGenerator.createUserResponse(user);
response.setResponseName(getCommandName());
this.setResponseObject(response);
} else {
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to lock user");
}
}
use of com.cloud.user.UserAccount in project cloudstack by apache.
the class EnableUserCmd method execute.
@Override
public void execute() {
CallContext.current().setEventDetails("UserId: " + getId());
UserAccount user = _regionService.enableUser(this);
if (user != null) {
UserResponse response = _responseGenerator.createUserResponse(user);
response.setResponseName(getCommandName());
this.setResponseObject(response);
} else {
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to enable user");
}
}
use of com.cloud.user.UserAccount in project cloudstack by apache.
the class LockUserCmd method execute.
@Override
public void execute() {
UserAccount user = _accountService.lockUser(getId());
if (user != null) {
UserResponse response = _responseGenerator.createUserResponse(user);
response.setResponseName(getCommandName());
this.setResponseObject(response);
} else {
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to lock user");
}
}
Aggregations