private void processEvents(List<SyncResponseEvent> events) throws ServiceException { Stats stats = new Stats(); int errors = 0; for (SyncResponseEvent event : events) { if (!event.isAddressBookReset()) { try { processEvent(event, stats); } catch (ServiceException e) { String msg = String.format("Contact event:\n%s", event); localData.syncContactFailed(e, -1, msg); errors++; } } } LOG.debug("Processed %d remote contact changes: %s", stats.total(), stats); if (errors > 0) { LOG.debug("%d contact changes could not be processed due to errors", errors); } }
private void processContactResults(List<SyncRequestEvent> events) throws ServiceException { Stats stats = new Stats(); int errors = 0; for (int i = 0; i < events.size(); i++) { SyncRequestEvent event = events.get(i); if (event.isContact()) { int itemId = eventItemIds.get(i); if (checkErrorResult(event, itemId)) { processContactResult(event, itemId, stats); } else { errors++; } } } LOG.debug("Pushed %d contact changes: %s", stats.total(), stats); if (errors > 0) { LOG.debug("%d contact changes failed due to errors", errors); } }