Search in sources :

Example 1 with WebDAVSyncHandler

use of org.apache.openmeetings.service.calendar.caldav.handler.WebDAVSyncHandler in project openmeetings by apache.

the class AppointmentManager method syncItem.

/**
 * Function which when called performs syncing based on the type of Syncing detected.
 *
 * @param client - {@link HttpClient} to discover calendar
 * @param calendar Calendar who's sync has to take place
 */
public void syncItem(HttpClient client, OmCalendar calendar) {
    cleanupIdleConnections();
    if (calendar.getSyncType() != SyncType.NONE) {
        CalendarHandler calendarHandler;
        String path = getPathfromCalendar(client, calendar);
        switch(calendar.getSyncType()) {
            case WEBDAV_SYNC:
                calendarHandler = new WebDAVSyncHandler(path, calendar, client, appointmentDao, utils);
                break;
            case CTAG:
                calendarHandler = new CtagHandler(path, calendar, client, appointmentDao, utils);
                break;
            case ETAG:
            default:
                // Default is the EtagsHandler.
                calendarHandler = new EtagsHandler(path, calendar, client, appointmentDao, utils);
                break;
        }
        calendarHandler.syncItems();
        calendarDao.update(calendar);
    }
}
Also used : EtagsHandler(org.apache.openmeetings.service.calendar.caldav.handler.EtagsHandler) WebDAVSyncHandler(org.apache.openmeetings.service.calendar.caldav.handler.WebDAVSyncHandler) CalendarHandler(org.apache.openmeetings.service.calendar.caldav.handler.CalendarHandler) CtagHandler(org.apache.openmeetings.service.calendar.caldav.handler.CtagHandler)

Aggregations

CalendarHandler (org.apache.openmeetings.service.calendar.caldav.handler.CalendarHandler)1 CtagHandler (org.apache.openmeetings.service.calendar.caldav.handler.CtagHandler)1 EtagsHandler (org.apache.openmeetings.service.calendar.caldav.handler.EtagsHandler)1 WebDAVSyncHandler (org.apache.openmeetings.service.calendar.caldav.handler.WebDAVSyncHandler)1