bug 8675: Added action events for Domain commands

status 8675: resolved fixed
This commit is contained in:
kishan 2011-03-04 16:59:19 +05:30
parent db7a0ddb75
commit a61a92b0fe
4 changed files with 9 additions and 3 deletions

View File

@ -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);

View File

@ -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());

View File

@ -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);

View File

@ -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();