Class BlueMindCalendarImportClient

java.lang.Object
org.exoplatform.caldav.client.bluemind.BlueMindCalendarImportClient

@Component public class BlueMindCalendarImportClient extends Object
Writes and removes calendar objects through BlueMind's own calendar REST API — the door whose every change carries sendNotification=false (EXO-90307).

What is called, and why it is safe to call (verified in BlueMind's source, bluemind-public master):

  • Import: PUT /api/calendars/vevent/{containerUid}, the raw ICS as the body (IVEvent.java:31,53; a Stream parameter is read as the raw body whatever the media type, DefaultBodyParameterCodecs.StreamBodyCodec). The service runs MultipleCalendarICSImport in Mode.IMPORT (VEventService.java:114-116) — never Mode.SYNC, which would delete everything the file does not carry (ICSImportTask.java:90-103). Each series is matched by ICS UID, merged, and applied with sendNotification=false on the add, the modify and the delete of an attendee-side series (EventChangesMerge.java:102,238,240), so IcsHook.mustSendNotification returns before any REQUEST, UPDATE, CANCEL or REPLY is built (IcsHook.java:1099-1117).
  • Its answer is a task: a TaskRef whose status is read at GET /api/tasks/{id} (ITask.java) until state.ended. The task's result is the first end the monitor received (TaskMonitor.java:85-92 ignores a second one), and in import mode that is an ImportStats — uids of what was added or updated, total of everything the file carried, unhandled included (ICSImportTask.java:83-89). A UID missing from uids was not written, whatever the HTTP status said.
  • Removal: DELETE /api/calendars/{containerUid}/{uid}?sendNotifications=false (ICalendar.java:125-128).
  • Faults are {errorCode, errorType, message} bodies: 500, or 403 for PERMISSION_DENIED (ResponseBuilder.java:70-76); a dead session is 401 (RestResponse.invalidSession).

Bounded waiting, never a hang: the task is polled at a fixed interval until it ends or a deadline passes, and a task still running at the deadline is a failed write — the caller's sweep retries it, and the import is idempotent by UID so a retry over a late success changes nothing.

  • Field Details

    • IMPORT_TIMEOUT_PROPERTY

      public static final String IMPORT_TIMEOUT_PROPERTY
      The deployment property bounding the wait for one import task, in seconds.
      See Also:
  • Constructor Details

    • BlueMindCalendarImportClient

      @Autowired public BlueMindCalendarImportClient(BlueMindRestSession session)
      The client Spring builds: real sleeps, the system clock, the configured deadline.
      Parameters:
      session - the REST session every BlueMind conversation shares
  • Method Details

    • importIcs

      public BlueMindCalendarImportClient.ImportReport importIcs(CalDavEndpoint endpoint, String containerUid, String ics)
      Imports one ICS document into a calendar container and waits for BlueMind to finish applying it.
      Parameters:
      endpoint - the account's DAV endpoint, minted from the registry
      containerUid - the calendar container, the last segment of the collection's path
      ics - the iCalendar text, exactly as it should be applied
      Returns:
      what the task reported
      Throws:
      IllegalArgumentException - when the container or the document is blank
      CalDavAuthenticationException - when BlueMind refuses the login or the session
      CalDavForbiddenException - when the account may not write the container
      CalDavException - when the import is refused, ends in error, or does not end within the deadline
    • deleteEvent

      public int deleteEvent(CalDavEndpoint endpoint, String containerUid, String uid)
      Removes one series from a calendar container without notifying anybody.
      Parameters:
      endpoint - the account's DAV endpoint, minted from the registry
      containerUid - the calendar container
      uid - the item uid, which is the ICS UID
      Returns:
      204 when removed — or when BlueMind holds no such item, which its calendar service only logs (CalendarService.java:466-471); 404 when the container itself is unknown (CalendarServiceBaseFactory.java:60)
      Throws:
      IllegalArgumentException - when the container or the uid is blank
      CalDavAuthenticationException - when BlueMind refuses the login or the session
      CalDavForbiddenException - when the account may not write the container
      CalDavException - when the removal is refused for any other reason