Search in sources :

Example 1 with EventTypeResponse

use of com.cloud.api.response.EventTypeResponse in project cosmic by MissionCriticalCloud.

the class ListEventTypesCmd method execute.

@Override
public void execute() {
    final String[] result = _mgr.listEventTypes();
    final ListResponse<EventTypeResponse> response = new ListResponse<>();
    final ArrayList<EventTypeResponse> responses = new ArrayList<>();
    if (result != null) {
        for (final String eventType : result) {
            final EventTypeResponse eventTypeResponse = new EventTypeResponse();
            eventTypeResponse.setName(eventType);
            eventTypeResponse.setObjectName("eventtype");
            responses.add(eventTypeResponse);
        }
    }
    response.setResponses(responses);
    response.setResponseName(getCommandName());
    this.setResponseObject(response);
}
Also used : EventTypeResponse(com.cloud.api.response.EventTypeResponse) ListResponse(com.cloud.api.response.ListResponse) ArrayList(java.util.ArrayList)

Example 2 with EventTypeResponse

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

the class ListEventTypesCmd method execute.

@Override
public void execute() {
    String[] result = _mgr.listEventTypes();
    ListResponse<EventTypeResponse> response = new ListResponse<EventTypeResponse>();
    ArrayList<EventTypeResponse> responses = new ArrayList<EventTypeResponse>();
    if (result != null) {
        for (String eventType : result) {
            EventTypeResponse eventTypeResponse = new EventTypeResponse();
            eventTypeResponse.setName(eventType);
            eventTypeResponse.setObjectName("eventtype");
            responses.add(eventTypeResponse);
        }
    }
    response.setResponses(responses);
    response.setResponseName(getCommandName());
    this.setResponseObject(response);
}
Also used : EventTypeResponse(com.cloud.api.response.EventTypeResponse) ListResponse(com.cloud.api.response.ListResponse) ArrayList(java.util.ArrayList)

Aggregations

EventTypeResponse (com.cloud.api.response.EventTypeResponse)2 ListResponse (com.cloud.api.response.ListResponse)2 ArrayList (java.util.ArrayList)2