use of com.cloud.api.response.ListResponse in project CloudStack-archive by CloudStack-extras.
the class ListTrafficTypesCmd method execute.
@Override
public void execute() {
List<? extends PhysicalNetworkTrafficType> trafficTypes = _networkService.listTrafficTypes(getPhysicalNetworkId());
ListResponse<TrafficTypeResponse> response = new ListResponse<TrafficTypeResponse>();
List<TrafficTypeResponse> trafficTypesResponses = new ArrayList<TrafficTypeResponse>();
for (PhysicalNetworkTrafficType trafficType : trafficTypes) {
TrafficTypeResponse trafficTypeResponse = _responseGenerator.createTrafficTypeResponse(trafficType);
trafficTypesResponses.add(trafficTypeResponse);
}
response.setResponses(trafficTypesResponses);
response.setResponseName(getCommandName());
this.setResponseObject(response);
}
use of com.cloud.api.response.ListResponse in project CloudStack-archive by CloudStack-extras.
the class ListUsersCmd method execute.
@Override
public void execute() {
List<? extends UserAccount> result = _accountService.searchForUsers(this);
ListResponse<UserResponse> response = new ListResponse<UserResponse>();
List<UserResponse> userResponses = new ArrayList<UserResponse>();
for (UserAccount user : result) {
UserResponse userResponse = _responseGenerator.createUserResponse(user);
userResponses.add(userResponse);
}
response.setResponses(userResponses);
response.setResponseName(getCommandName());
this.setResponseObject(response);
}
use of com.cloud.api.response.ListResponse in project CloudStack-archive by CloudStack-extras.
the class ListVMGroupsCmd method execute.
@Override
public void execute() {
List<? extends InstanceGroup> groups = _mgr.searchForVmGroups(this);
ListResponse<InstanceGroupResponse> response = new ListResponse<InstanceGroupResponse>();
List<InstanceGroupResponse> responses = new ArrayList<InstanceGroupResponse>();
for (InstanceGroup group : groups) {
InstanceGroupResponse groupResponse = _responseGenerator.createInstanceGroupResponse(group);
groupResponse.setObjectName("instancegroup");
responses.add(groupResponse);
}
response.setResponses(responses);
response.setResponseName(getCommandName());
this.setResponseObject(response);
}
use of com.cloud.api.response.ListResponse in project CloudStack-archive by CloudStack-extras.
the class ListLoadBalancerRulesCmd method execute.
@Override
public void execute() {
List<? extends LoadBalancer> loadBalancers = _lbService.searchForLoadBalancers(this);
ListResponse<LoadBalancerResponse> response = new ListResponse<LoadBalancerResponse>();
List<LoadBalancerResponse> lbResponses = new ArrayList<LoadBalancerResponse>();
if (loadBalancers != null) {
for (LoadBalancer loadBalancer : loadBalancers) {
LoadBalancerResponse lbResponse = _responseGenerator.createLoadBalancerResponse(loadBalancer);
lbResponse.setObjectName("loadbalancerrule");
lbResponses.add(lbResponse);
}
}
response.setResponses(lbResponses);
response.setResponseName(getCommandName());
this.setResponseObject(response);
}
use of com.cloud.api.response.ListResponse in project CloudStack-archive by CloudStack-extras.
the class ListNetworkServiceProvidersCmd method execute.
@Override
public void execute() {
List<? extends PhysicalNetworkServiceProvider> serviceProviders = _networkService.listNetworkServiceProviders(getPhysicalNetworkId(), getName(), getState(), this.getStartIndex(), this.getPageSizeVal());
ListResponse<ProviderResponse> response = new ListResponse<ProviderResponse>();
List<ProviderResponse> serviceProvidersResponses = new ArrayList<ProviderResponse>();
for (PhysicalNetworkServiceProvider serviceProvider : serviceProviders) {
ProviderResponse serviceProviderResponse = _responseGenerator.createNetworkServiceProviderResponse(serviceProvider);
serviceProvidersResponses.add(serviceProviderResponse);
}
response.setResponses(serviceProvidersResponses);
response.setResponseName(getCommandName());
this.setResponseObject(response);
}
Aggregations