use of com.cloud.api.response.VirtualRouterProviderResponse in project CloudStack-archive by CloudStack-extras.
the class ListVirtualRouterElementsCmd method execute.
@Override
public void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException, ConcurrentOperationException, ResourceAllocationException {
List<? extends VirtualRouterProvider> providers = _service.searchForVirtualRouterElement(this);
ListResponse<VirtualRouterProviderResponse> response = new ListResponse<VirtualRouterProviderResponse>();
List<VirtualRouterProviderResponse> providerResponses = new ArrayList<VirtualRouterProviderResponse>();
for (VirtualRouterProvider provider : providers) {
VirtualRouterProviderResponse providerResponse = _responseGenerator.createVirtualRouterProviderResponse(provider);
providerResponses.add(providerResponse);
}
response.setResponses(providerResponses);
response.setResponseName(getCommandName());
this.setResponseObject(response);
}
use of com.cloud.api.response.VirtualRouterProviderResponse in project CloudStack-archive by CloudStack-extras.
the class ConfigureVirtualRouterElementCmd method execute.
@Override
public void execute() throws ConcurrentOperationException, ResourceUnavailableException, InsufficientCapacityException {
UserContext.current().setEventDetails("Virtual router element: " + id);
VirtualRouterProvider result = _service.configure(this);
if (result != null) {
VirtualRouterProviderResponse routerResponse = _responseGenerator.createVirtualRouterProviderResponse(result);
routerResponse.setResponseName(getCommandName());
this.setResponseObject(routerResponse);
} else {
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to configure the virtual router provider");
}
}
use of com.cloud.api.response.VirtualRouterProviderResponse in project CloudStack-archive by CloudStack-extras.
the class CreateVirtualRouterElementCmd method execute.
@Override
public void execute() {
UserContext.current().setEventDetails("Virtual router element Id: " + getEntityId());
VirtualRouterProvider result = _service.getCreatedElement(getEntityId());
if (result != null) {
VirtualRouterProviderResponse response = _responseGenerator.createVirtualRouterProviderResponse(result);
response.setResponseName(getCommandName());
this.setResponseObject(response);
} else {
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to add Virtual Router entity to physical network");
}
}
Aggregations