Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Index: exchange-core/src/main/java/com/funambol/exchange/items/accessor/ews/CalendarEwsExchangeAccessor.java
- ===================================================================
- --- exchange-core/src/main/java/com/funambol/exchange/items/accessor/ews/CalendarEwsExchangeAccessor.java (revision 513)
- +++ exchange-core/src/main/java/com/funambol/exchange/items/accessor/ews/CalendarEwsExchangeAccessor.java (working copy)
- @@ -40,10 +40,14 @@
- protected Date since;
- protected Date until;
- + protected boolean suppressItemFailures;
- +
- public CalendarEwsExchangeAccessor(ExchangeUser exuser) {
- super(exuser);
- +
- since = null;
- until = null;
- + suppressItemFailures = false;
- }
- /**
- @@ -73,6 +77,10 @@
- this.until = until;
- }
- + public void setSuppressItemErrors(boolean suppressItemFailures) {
- + this.suppressItemFailures = suppressItemFailures;
- + }
- +
- /**
- * Add the attendees in the EWS array of attendee objects to the given ExchangeCalendar.
- *
- @@ -110,7 +118,7 @@
- exchangeItems.addAll(getOccurrencesFromCalendar(calendar));
- }
- ExchangeCalendar exchCal = getExchangeCalendarFromCalendarItem(calendar);
- - if (eventCouldOccurInRange(exchCal)) {
- + if (exchCal != null && eventCouldOccurInRange(exchCal)) {
- exchangeItems.add(exchCal);
- }
- }
- @@ -132,7 +140,7 @@
- for (OccurrenceInfoType occurrence : modified.getOccurrence()) {
- CalendarItemType calOccurrence = (CalendarItemType) getItem(occurrence.getItemId());
- ExchangeCalendar exchCal = getExchangeCalendarFromCalendarItem(calOccurrence);
- - if (eventCouldOccurInRange(exchCal)) {
- + if (exchCal != null && eventCouldOccurInRange(exchCal)) {
- exchangeItems.add(exchCal);
- }
- }
- @@ -498,6 +506,29 @@
- return recurType;
- }
- +
- + /**
- + * Get the Exchange calendar from the given calendar item while checking for errors. If an error
- + * is encountered and error supressing is on, return null.
- + *
- + * @param cal The EWS item to get the Exchange calendar from
- + * @return An ExchangeCalendar or null
- + * @throws DataAccessException when the calendar item cannot be converted and errors are not
- + * suppressed
- + */
- + protected ExchangeCalendar getExchangeCalendarFromCalendarItem(CalendarItemType cal) throws DataAccessException {
- + ExchangeCalendar exchCal;
- + try {
- + exchCal = convertCalendarItem(cal);
- + } catch (DataAccessException e) {
- + if (!suppressItemFailures) {
- + throw e;
- + } else {
- + exchCal = null;
- + }
- + }
- + return exchCal;
- + }
- /**
- * Convert an EWS calendar to an ExchangeCalendar.
- @@ -506,7 +537,7 @@
- * @return An ExchangeCalendar version of the given EWS calendar
- * @throws DataAccessException
- */
- - protected ExchangeCalendar getExchangeCalendarFromCalendarItem(CalendarItemType cal) throws DataAccessException {
- + protected ExchangeCalendar convertCalendarItem(CalendarItemType cal) throws DataAccessException {
- String id = cal.getItemId().getId();
- String lastModifiedString = getLastModifiedTimeFromItem(cal);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement