Search in sources :

Example 1 with Event

use of util.Event in project coprhd-controller by CoprHD.

the class ExecutionWindows method events.

public static void events(int timezoneOffsetInMinutes, String start, String end) {
    // NOSONAR
    List<ExecutionWindowRestRep> executionWindows = ExecutionWindowUtils.getExecutionWindows(uri(Models.currentAdminTenant()));
    // ("Suppressing Sonar violation of Method invoking inefficient number constructor. Method events is invoked with int which is not inefficient")
    DateTimeZone tz = TimeUtils.getLocalTimeZone(timezoneOffsetInMinutes);
    DateTimeFormatter formatter = ISODateTimeFormat.date().withZone(tz);
    DateTime startDateTime = DateTime.parse(start, formatter);
    DateTime endDateTime = DateTime.parse(end, formatter);
    List<Event> events = ExecutionWindowUtils.asEvents(executionWindows, startDateTime, endDateTime, tz);
    renderJSON(events);
}
Also used : ExecutionWindowRestRep(com.emc.vipr.model.catalog.ExecutionWindowRestRep) Event(util.Event) DateTimeFormatter(org.joda.time.format.DateTimeFormatter) DateTimeZone(org.joda.time.DateTimeZone) DateTime(org.joda.time.DateTime)

Aggregations

ExecutionWindowRestRep (com.emc.vipr.model.catalog.ExecutionWindowRestRep)1 DateTime (org.joda.time.DateTime)1 DateTimeZone (org.joda.time.DateTimeZone)1 DateTimeFormatter (org.joda.time.format.DateTimeFormatter)1 Event (util.Event)1