Search in sources :

Example 1 with ArrayOfCalendarEvent

use of com.microsoft.schemas.exchange.services._2006.types.ArrayOfCalendarEvent in project zm-mailbox by Zimbra.

the class ExchangeEWSFreeBusyProvider method parseDetailedFreeBusyResponse.

/*
    * This method parse the Detailed and FreeBusy view response information for each individual user,
    * who has those view information.
    */
private static void parseDetailedFreeBusyResponse(String name, long start, long end, FreeBusyResponseType freeBusyResponse, ArrayList<FreeBusy> ret) {
    ArrayOfCalendarEvent arrayOfCalendarEvent = null;
    List<CalendarEvent> calendarEvents = null;
    if (freeBusyResponse.getFreeBusyView() != null) {
        arrayOfCalendarEvent = freeBusyResponse.getFreeBusyView().getCalendarEventArray();
        if (arrayOfCalendarEvent != null) {
            calendarEvents = arrayOfCalendarEvent.getCalendarEvent();
            LegacyFreeBusyType legacyType;
            if (calendarEvents != null && calendarEvents.size() > 0) {
                for (CalendarEvent event : calendarEvents) {
                    legacyType = event.getBusyType();
                    FreeBusy.Interval interval = getFreeBusyInterval(ret, event);
                    ZimbraLog.fb.debug("For user %s FB data received is: legacyType : %s, startTime : %s, " + "endTime : %s", name, legacyType, event.getStartTime(), event.getEndTime());
                    if (event.getCalendarEventDetails() != null && interval != null) {
                        CalendarEventDetails calendarEventDetails = event.getCalendarEventDetails();
                        interval.id = calendarEventDetails.getID();
                        interval.location = calendarEventDetails.getLocation();
                        interval.subject = calendarEventDetails.getSubject();
                        interval.isMeeting = calendarEventDetails.isIsMeeting();
                        interval.isRecurring = calendarEventDetails.isIsRecurring();
                        interval.isException = calendarEventDetails.isIsException();
                        interval.isReminderSet = calendarEventDetails.isIsReminderSet();
                        interval.isPrivate = calendarEventDetails.isIsPrivate();
                        interval.detailsExist = true;
                        ZimbraLog.fb.debug("eventID : %s, location : %s, subject : %s, isMeeting : %b, " + "isRecurring : %b, isException : %b, isReminderSet : %b, isPrivate : %b", interval.id, interval.location, interval.subject, interval.isMeeting, interval.isRecurring, interval.isException, interval.isReminderSet, interval.isPrivate);
                    } else {
                        ZimbraLog.fb.debug("Calendar Event details not found for the user %s", name);
                    }
                }
            } else {
                ZimbraLog.fb.debug("No Calendar Information available for the user : %s", name);
            }
        }
    }
}
Also used : CalendarEventDetails(com.microsoft.schemas.exchange.services._2006.types.CalendarEventDetails) ArrayOfCalendarEvent(com.microsoft.schemas.exchange.services._2006.types.ArrayOfCalendarEvent) CalendarEvent(com.microsoft.schemas.exchange.services._2006.types.CalendarEvent) ArrayOfCalendarEvent(com.microsoft.schemas.exchange.services._2006.types.ArrayOfCalendarEvent) LegacyFreeBusyType(com.microsoft.schemas.exchange.services._2006.types.LegacyFreeBusyType)

Aggregations

ArrayOfCalendarEvent (com.microsoft.schemas.exchange.services._2006.types.ArrayOfCalendarEvent)1 CalendarEvent (com.microsoft.schemas.exchange.services._2006.types.CalendarEvent)1 CalendarEventDetails (com.microsoft.schemas.exchange.services._2006.types.CalendarEventDetails)1 LegacyFreeBusyType (com.microsoft.schemas.exchange.services._2006.types.LegacyFreeBusyType)1