@Override
 public void execute() throws ResourceUnavailableException, ConcurrentOperationException {
   UserContext.current().setEventDetails("Vm Id: " + getId());
   VirtualMachine result = _mgr.stopSystemVM(this);
   if (result != null) {
     SystemVmResponse response = _responseGenerator.createSystemVmResponse(result);
     response.setResponseName(getCommandName());
     this.setResponseObject(response);
   } else {
     throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Fail to stop system vm");
   }
 }
Esempio n. 2
0
 @Override
 public void execute() {
   UserContext.current().setEventDetails("Vm Id: " + getId());
   VirtualMachine instance = _mgr.startSystemVM(getId());
   if (instance != null) {
     SystemVmResponse response = _responseGenerator.createSystemVmResponse(instance);
     response.setResponseName(getCommandName());
     this.setResponseObject(response);
   } else {
     throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Fail to start system vm");
   }
 }