Search in sources :

Example 1 with EventTypes

use of com.cloud.event.EventTypes in project cloudstack by apache.

the class ManagementServerImpl method listEventTypes.

@Override
public String[] listEventTypes() {
    final Object eventObj = new EventTypes();
    final Class<EventTypes> c = EventTypes.class;
    final Field[] fields = c.getFields();
    final String[] eventTypes = new String[fields.length];
    try {
        int i = 0;
        for (final Field field : fields) {
            eventTypes[i++] = field.get(eventObj).toString();
        }
        return eventTypes;
    } catch (final IllegalArgumentException e) {
        s_logger.error("Error while listing Event Types", e);
    } catch (final IllegalAccessException e) {
        s_logger.error("Error while listing Event Types", e);
    }
    return null;
}
Also used : Field(java.lang.reflect.Field) EventTypes(com.cloud.event.EventTypes)

Aggregations

EventTypes (com.cloud.event.EventTypes)1 Field (java.lang.reflect.Field)1