Search in sources :

Example 1 with EventResponse

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

the class ListEventsCmd method execute.

@Override
public void execute() {
    List<? extends Event> result = _mgr.searchForEvents(this);
    ListResponse<EventResponse> response = new ListResponse<EventResponse>();
    List<EventResponse> eventResponses = new ArrayList<EventResponse>();
    for (Event event : result) {
        eventResponses.add(_responseGenerator.createEventResponse(event));
    }
    response.setResponses(eventResponses);
    response.setResponseName(getCommandName());
    this.setResponseObject(response);
}
Also used : ListResponse(com.cloud.api.response.ListResponse) EventResponse(com.cloud.api.response.EventResponse) ArrayList(java.util.ArrayList) Event(com.cloud.event.Event)

Aggregations

EventResponse (com.cloud.api.response.EventResponse)1 ListResponse (com.cloud.api.response.ListResponse)1 Event (com.cloud.event.Event)1 ArrayList (java.util.ArrayList)1