Class CaldavOutboundService

java.lang.Object
org.exoplatform.caldav.service.CaldavOutboundService

@Service public class CaldavOutboundService extends Object
Gives each of a user's eXo personal calendars a collection of its own on the remote server.

This is the first code that creates collections in the customer's own calendar space. Until now eXo only ever wrote into a collection it had made for itself, and everything here is shaped by that difference.

The path is the identity of a binding and the display name is data carried along it: every pass that settles on a collection — listed, answered directly, or just created — also makes sure the collection reads under the calendar's current eXo name, and confirms that by reading the name back. Before EXO-89528's fix the name was written once, inside MKCALENDAR, and never again, so a calendar renamed in eXo kept its first name on the server for good — and re-connecting the account could not help, because the binding is recovered by path and found the same collection under the same stale name.

  • Field Details

    • COLLECTION_PREFIX

      public static final String COLLECTION_PREFIX
      Every collection this service creates is named from this prefix.
      See Also:
  • Constructor Details

    • CaldavOutboundService

      public CaldavOutboundService()
  • Method Details

    • bindPersonalCalendars

      public List<org.exoplatform.caldav.model.CalendarSync> bindPersonalCalendars(long userIdentityId, String username)
      Binds every personal calendar of a user to a collection on their server, creating what does not exist yet.

      This is the first step that talks to the server in both sequences that reach it — a connection and a synchronisation pass — so what it does with a failure decides how many credential-bearing requests the whole sequence makes. Two failures are re-thrown rather than absorbed, because they are properties of the server and are settled after one attempt: CalDavAuthenticationException (a person must act) and CalDavUnreachableException (nothing is there). Letting the caller continue past either of them buys nothing and costs four more authenticated requests against a server that may be counting them (EXO-89806).

      Anything else stays absorbed exactly as before: a home this account cannot be read out of, an answer that is not DAV XML, a quirk on one account — those say nothing about the rest of the pass, whose later steps ask the server different questions and may well be answered.

      Parameters:
      userIdentityId - identity of the user
      username - the user's login, which agenda's ACL reads
      Returns:
      the pairs, bound or refused, one per personal calendar
      Throws:
      CalDavAuthenticationException - when the server refused the stored credentials
      CalDavUnreachableException - when the server could not be reached