mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-02 20:02:29 +01:00
bug 8675: Added action events for Domain commands
status 8675: resolved fixed
This commit is contained in:
parent
db7a0ddb75
commit
a61a92b0fe
@ -27,6 +27,7 @@ import com.cloud.api.ServerApiException;
|
||||
import com.cloud.api.response.DomainResponse;
|
||||
import com.cloud.domain.Domain;
|
||||
import com.cloud.user.Account;
|
||||
import com.cloud.user.UserContext;
|
||||
|
||||
@Implementation(description="Creates a domain", responseObject=DomainResponse.class)
|
||||
public class CreateDomainCmd extends BaseCmd {
|
||||
@ -74,6 +75,7 @@ public class CreateDomainCmd extends BaseCmd {
|
||||
|
||||
@Override
|
||||
public void execute(){
|
||||
UserContext.current().setEventDetails("Domain Name: "+getDomainName()+((getParentDomainId()!=null)?", Parent DomainId :"+getParentDomainId():""));
|
||||
Domain domain = _mgr.createDomain(this);
|
||||
if (domain != null) {
|
||||
DomainResponse response = _responseGenerator.createDomainResponse(domain);
|
||||
|
||||
@ -29,6 +29,7 @@ import com.cloud.api.response.SuccessResponse;
|
||||
import com.cloud.domain.Domain;
|
||||
import com.cloud.event.EventTypes;
|
||||
import com.cloud.user.Account;
|
||||
import com.cloud.user.UserContext;
|
||||
|
||||
@Implementation(description="Deletes a specified domain", responseObject=SuccessResponse.class)
|
||||
public class DeleteDomainCmd extends BaseAsyncCmd {
|
||||
@ -89,6 +90,7 @@ public class DeleteDomainCmd extends BaseAsyncCmd {
|
||||
|
||||
@Override
|
||||
public void execute(){
|
||||
UserContext.current().setEventDetails("Domain Id: "+getId());
|
||||
boolean result = _mgr.deleteDomain(this);
|
||||
if (result) {
|
||||
SuccessResponse response = new SuccessResponse(getCommandName());
|
||||
|
||||
@ -27,6 +27,7 @@ import com.cloud.api.ServerApiException;
|
||||
import com.cloud.api.response.DomainResponse;
|
||||
import com.cloud.domain.Domain;
|
||||
import com.cloud.user.Account;
|
||||
import com.cloud.user.UserContext;
|
||||
|
||||
@Implementation(description="Updates a domain with a new name", responseObject=DomainResponse.class)
|
||||
public class UpdateDomainCmd extends BaseCmd {
|
||||
@ -71,6 +72,7 @@ public class UpdateDomainCmd extends BaseCmd {
|
||||
|
||||
@Override
|
||||
public void execute(){
|
||||
UserContext.current().setEventDetails("Domain Id: "+getId());
|
||||
Domain domain = _mgr.updateDomain(this);
|
||||
if (domain != null) {
|
||||
DomainResponse response = _responseGenerator.createDomainResponse(domain);
|
||||
|
||||
@ -2904,7 +2904,7 @@ public class ManagementServerImpl implements ManagementServer {
|
||||
return _domainDao.search(sc, searchFilter);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Override @ActionEvent (eventType=EventTypes.EVENT_DOMAIN_CREATE, eventDescription="creating Domain")
|
||||
public DomainVO createDomain(CreateDomainCmd cmd) throws InvalidParameterValueException, PermissionDeniedException {
|
||||
String name = cmd.getDomainName();
|
||||
Long parentId = cmd.getParentDomainId();
|
||||
@ -2945,7 +2945,7 @@ public class ManagementServerImpl implements ManagementServer {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Override @ActionEvent (eventType=EventTypes.EVENT_DOMAIN_DELETE, eventDescription="deleting Domain", async=true)
|
||||
public boolean deleteDomain(DeleteDomainCmd cmd) throws InvalidParameterValueException, PermissionDeniedException {
|
||||
Account account = UserContext.current().getCaller();
|
||||
Long domainId = cmd.getId();
|
||||
@ -3049,7 +3049,7 @@ public class ManagementServerImpl implements ManagementServer {
|
||||
return success && deleteDomainSuccess;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Override @ActionEvent (eventType=EventTypes.EVENT_DOMAIN_UPDATE, eventDescription="updating Domain")
|
||||
public DomainVO updateDomain(UpdateDomainCmd cmd) throws InvalidParameterValueException, PermissionDeniedException{
|
||||
Long domainId = cmd.getId();
|
||||
String domainName = cmd.getDomainName();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user