@Override // an exception thrown by createNetwork() will be caught by the dispatcher. public void execute() throws InsufficientCapacityException, ConcurrentOperationException, ResourceAllocationException{ Network result = _networkService.createGuestNetwork(this); if (result != null) { NetworkResponse response = _responseGenerator.createNetworkResponse(ResponseView.Full, result); response.setResponseName(getCommandName()); setResponseObject(response); }else { throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to create network"); } } }
@Override public void execute(){ Pair<List<? extends Network>, Integer> networks = _networkService.searchForNetworks(this); ListResponse<NetworkResponse> response = new ListResponse<NetworkResponse>(); List<NetworkResponse> networkResponses = new ArrayList<NetworkResponse>(); for (Network network : networks.first()) { NetworkResponse networkResponse = _responseGenerator.createNetworkResponse(ResponseView.Full, network); networkResponses.add(networkResponse); } response.setResponses(networkResponses, networks.second()); response.setResponseName(getCommandName()); setResponseObject(response); } }
@Override public void execute() { Pair<List<? extends Network>, Integer> networks = _networkService.searchForNetworks(this); ListResponse<NetworkResponse> response = new ListResponse<NetworkResponse>(); List<NetworkResponse> networkResponses = new ArrayList<NetworkResponse>(); for (Network network : networks.first()) { NetworkResponse networkResponse = _responseGenerator.createNetworkResponse(ResponseView.Restricted, network); networkResponses.add(networkResponse); } response.setResponses(networkResponses, networks.second()); response.setResponseName(getCommandName()); setResponseObject(response); } }
@Override // an exception thrown by createNetwork() will be caught by the dispatcher. public void execute() throws InsufficientCapacityException, ConcurrentOperationException, ResourceAllocationException { Network result = _networkService.createGuestNetwork(this); if (result != null) { NetworkResponse response = _responseGenerator.createNetworkResponse(ResponseView.Restricted, result); response.setResponseName(getCommandName()); setResponseObject(response); } else { throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to create network"); } } }
@Override public void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException, ConcurrentOperationException, ResourceAllocationException { try { List<? extends Network> networks = niciraNvpElementService.listNiciraNvpDeviceNetworks(this); ListResponse<NetworkResponse> response = new ListResponse<NetworkResponse>(); List<NetworkResponse> networkResponses = new ArrayList<NetworkResponse>(); if (networks != null && !networks.isEmpty()) { for (Network network : networks) { NetworkResponse networkResponse = _responseGenerator.createNetworkResponse(ResponseView.Full, network); networkResponses.add(networkResponse); } } response.setResponses(networkResponses); response.setResponseName(getCommandName()); setResponseObject(response); } catch (InvalidParameterValueException invalidParamExcp) { throw new ServerApiException(ApiErrorCode.PARAM_ERROR, invalidParamExcp.getMessage()); } catch (CloudRuntimeException runtimeExcp) { throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, runtimeExcp.getMessage()); } }
@Override public void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException, ConcurrentOperationException, ResourceAllocationException { try { List<? extends Network> networks = _paFwService.listNetworks(this); ListResponse<NetworkResponse> response = new ListResponse<NetworkResponse>(); List<NetworkResponse> networkResponses = new ArrayList<NetworkResponse>(); if (networks != null && !networks.isEmpty()) { for (Network network : networks) { NetworkResponse networkResponse = _responseGenerator.createNetworkResponse(ResponseView.Full, network); networkResponses.add(networkResponse); } } response.setResponses(networkResponses); response.setResponseName(getCommandName()); setResponseObject(response); } catch (InvalidParameterValueException invalidParamExcp) { throw new ServerApiException(ApiErrorCode.PARAM_ERROR, invalidParamExcp.getMessage()); } catch (CloudRuntimeException runtimeExcp) { throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, runtimeExcp.getMessage()); } }
@Override public void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException, ConcurrentOperationException, ResourceAllocationException { try { List<? extends Network> networks = brocadeVcsElementService.listBrocadeVcsDeviceNetworks(this); ListResponse<NetworkResponse> response = new ListResponse<NetworkResponse>(); List<NetworkResponse> networkResponses = new ArrayList<NetworkResponse>(); if (networks != null && !networks.isEmpty()) { for (Network network : networks) { NetworkResponse networkResponse = _responseGenerator.createNetworkResponse(ResponseView.Full, network); networkResponses.add(networkResponse); } } response.setResponses(networkResponses); response.setResponseName(getCommandName()); setResponseObject(response); } catch (InvalidParameterValueException invalidParamExcp) { throw new ServerApiException(ApiErrorCode.PARAM_ERROR, invalidParamExcp.getMessage()); } catch (CloudRuntimeException runtimeExcp) { throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, runtimeExcp.getMessage()); } }
@Override public void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException, ConcurrentOperationException, ResourceAllocationException { try { List<? extends Network> networks = _netsclarLbService.listNetworks(this); ListResponse<NetworkResponse> response = new ListResponse<NetworkResponse>(); List<NetworkResponse> networkResponses = new ArrayList<NetworkResponse>(); if (networks != null && !networks.isEmpty()) { for (Network network : networks) { NetworkResponse networkResponse = _responseGenerator.createNetworkResponse(ResponseView.Full, network); networkResponses.add(networkResponse); } } response.setResponses(networkResponses); response.setResponseName(getCommandName()); setResponseObject(response); } catch (InvalidParameterValueException invalidParamExcp) { throw new ServerApiException(ApiErrorCode.PARAM_ERROR, invalidParamExcp.getMessage()); } catch (CloudRuntimeException runtimeExcp) { throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, runtimeExcp.getMessage()); } }
@Override public void execute() { User callerUser = _accountService.getActiveUser(CallContext.current().getCallingUserId()); Account callerAccount = _accountService.getActiveAccountById(callerUser.getAccountId()); Network network = _networkService.getNetwork(id); if (network == null) { throw new InvalidParameterValueException("Couldn't find network by id"); } Network result = _networkService.migrateGuestNetwork(getId(), getNetworkOfferingId(), callerAccount, callerUser, getResume()); if (result != null) { NetworkResponse response = _responseGenerator.createNetworkResponse(ResponseView.Restricted, result); response.setResponseName(getCommandName()); setResponseObject(response); } else { throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to update network"); } }
@Override public void execute() throws InsufficientCapacityException, ConcurrentOperationException{ User callerUser = _accountService.getActiveUser(CallContext.current().getCallingUserId()); Account callerAccount = _accountService.getActiveAccountById(callerUser.getAccountId()); Network network = _networkService.getNetwork(id); if (network == null) { throw new InvalidParameterValueException("Couldn't find network by id"); } Network result = _networkService.updateGuestNetwork(getId(), getNetworkName(), getDisplayText(), callerAccount, callerUser, getNetworkDomain(), getNetworkOfferingId(), getChangeCidr(), getGuestVmCidr(), getDisplayNetwork(), getCustomId(), getUpdateInSequence(),getForced()); if (result != null) { NetworkResponse response = _responseGenerator.createNetworkResponse(ResponseView.Full, result); response.setResponseName(getCommandName()); setResponseObject(response); } else { throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to update network"); } }
@Override public void execute() throws InsufficientCapacityException, ConcurrentOperationException { User callerUser = _accountService.getActiveUser(CallContext.current().getCallingUserId()); Account callerAccount = _accountService.getActiveAccountById(callerUser.getAccountId()); Network network = _networkService.getNetwork(id); if (network == null) { throw new InvalidParameterValueException("Couldn't find network by ID"); } Network result = _networkService.updateGuestNetwork(getId(), getNetworkName(), getDisplayText(), callerAccount, callerUser, getNetworkDomain(), getNetworkOfferingId(), getChangeCidr(), getGuestVmCidr(), getDisplayNetwork(), getCustomId(), getUpdateInSequence(), getForced()); if (result != null) { NetworkResponse response = _responseGenerator.createNetworkResponse(ResponseView.Restricted, result); response.setResponseName(getCommandName()); setResponseObject(response); } else { throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to update network"); } }