예제 #1
0
 @Override
 public void execute() throws InsufficientCapacityException, ConcurrentOperationException {
   Network result = _networkService.createNetwork(this);
   if (result != null) {
     NetworkResponse response = _responseGenerator.createNetworkResponse(result);
     response.setResponseName(getCommandName());
     this.setResponseObject(response);
   } else {
     throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to create network");
   }
 }
예제 #2
0
 @Override
 public void execute() throws InsufficientCapacityException, ConcurrentOperationException {
   User callerUser = _accountService.getActiveUser(UserContext.current().getCallerUserId());
   Account callerAccount = _accountService.getActiveAccountById(callerUser.getAccountId());
   Network result =
       _networkService.updateGuestNetwork(
           getId(),
           getNetworkName(),
           getDisplayText(),
           callerAccount,
           callerUser,
           getNetworkDomain(),
           getNetworkOfferingId(),
           getChangeCidr());
   if (result != null) {
     NetworkResponse response = _responseGenerator.createNetworkResponse(result);
     response.setResponseName(getCommandName());
     this.setResponseObject(response);
   } else {
     throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to update network");
   }
 }