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);
}
}
Aggregations