Class BlueMindCalendarImportClient
java.lang.Object
org.exoplatform.caldav.client.bluemind.BlueMindCalendarImportClient
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; aStreamparameter is read as the raw body whatever the media type,DefaultBodyParameterCodecs.StreamBodyCodec). The service runsMultipleCalendarICSImportinMode.IMPORT(VEventService.java:114-116) — neverMode.SYNC, which would delete everything the file does not carry (ICSImportTask.java:90-103). Each series is matched by ICS UID, merged, and applied withsendNotification=falseon the add, the modify and the delete of an attendee-side series (EventChangesMerge.java:102,238,240), soIcsHook.mustSendNotificationreturns before any REQUEST, UPDATE, CANCEL or REPLY is built (IcsHook.java:1099-1117). - Its answer is a task: a
TaskRefwhose status is read atGET /api/tasks/{id}(ITask.java) untilstate.ended. The task's result is the firstendthe monitor received (TaskMonitor.java:85-92ignores a second one), and in import mode that is anImportStats—uidsof what was added or updated,totalof everything the file carried, unhandled included (ICSImportTask.java:83-89). A UID missing fromuidswas 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 forPERMISSION_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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordWhat one import task reported when it ended.static interfaceHow the poll loop waits between two status reads — a seam, so a test can drive the deadline without spending the time. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe deployment property bounding the wait for one import task, in seconds. -
Constructor Summary
ConstructorsConstructorDescriptionThe client Spring builds: real sleeps, the system clock, the configured deadline. -
Method Summary
Modifier and TypeMethodDescriptionintdeleteEvent(CalDavEndpoint endpoint, String containerUid, String uid) Removes one series from a calendar container without notifying anybody.importIcs(CalDavEndpoint endpoint, String containerUid, String ics) Imports one ICS document into a calendar container and waits for BlueMind to finish applying it.
-
Field Details
-
IMPORT_TIMEOUT_PROPERTY
The deployment property bounding the wait for one import task, in seconds.- See Also:
-
-
Constructor Details
-
BlueMindCalendarImportClient
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 registrycontainerUid- the calendar container, the last segment of the collection's pathics- the iCalendar text, exactly as it should be applied- Returns:
- what the task reported
- Throws:
IllegalArgumentException- when the container or the document is blankCalDavAuthenticationException- when BlueMind refuses the login or the sessionCalDavForbiddenException- when the account may not write the containerCalDavException- when the import is refused, ends in error, or does not end within the deadline
-
deleteEvent
Removes one series from a calendar container without notifying anybody.- Parameters:
endpoint- the account's DAV endpoint, minted from the registrycontainerUid- the calendar containeruid- 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 blankCalDavAuthenticationException- when BlueMind refuses the login or the sessionCalDavForbiddenException- when the account may not write the containerCalDavException- when the removal is refused for any other reason
-