Search in sources :

Example 1 with TrafficTypeImplementorResponse

use of com.cloud.api.response.TrafficTypeImplementorResponse in project CloudStack-archive by CloudStack-extras.

the class ListTrafficTypeImplementorsCmd method execute.

@Override
public void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException, ConcurrentOperationException, ResourceAllocationException {
    List<Pair<TrafficType, String>> results = _networkService.listTrafficTypeImplementor(this);
    ListResponse<TrafficTypeImplementorResponse> response = new ListResponse<TrafficTypeImplementorResponse>();
    List<TrafficTypeImplementorResponse> responses = new ArrayList<TrafficTypeImplementorResponse>();
    for (Pair<TrafficType, String> r : results) {
        TrafficTypeImplementorResponse p = new TrafficTypeImplementorResponse();
        p.setTrafficType(r.first().toString());
        p.setImplementor(r.second());
        p.setObjectName("traffictypeimplementorresponse");
        responses.add(p);
    }
    response.setResponses(responses);
    response.setResponseName(getCommandName());
    this.setResponseObject(response);
}
Also used : ListResponse(com.cloud.api.response.ListResponse) TrafficTypeImplementorResponse(com.cloud.api.response.TrafficTypeImplementorResponse) ArrayList(java.util.ArrayList) Pair(com.cloud.utils.Pair) TrafficType(com.cloud.network.Networks.TrafficType)

Aggregations

ListResponse (com.cloud.api.response.ListResponse)1 TrafficTypeImplementorResponse (com.cloud.api.response.TrafficTypeImplementorResponse)1 TrafficType (com.cloud.network.Networks.TrafficType)1 Pair (com.cloud.utils.Pair)1 ArrayList (java.util.ArrayList)1