@Override public void execute() { Account owner = _accountService.getAccount(getEntityOwnerId()); boolean result = _ravService.removeVpnUser(owner.getId(), userName, CallContext.current().getCallingAccount()); if (!result) { throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to remove vpn user"); } try { if (!_ravService.applyVpnUsers(owner.getId(), userName)) { throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to apply vpn user removal"); } }catch (Exception ex) { throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to remove vpn user due to resource unavailable"); } SuccessResponse response = new SuccessResponse(getCommandName()); setResponseObject(response); } }