Class CaldavSubscriptionRetirementService

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

@Component public class CaldavSubscriptionRetirementService extends Object
Stops the harm a calendar the sweep materialised from a mere subscription does, before the server's naming was read (EXO-90275).

Until then a BlueMind resource calendar or a colleague's calendar the user subscribed to became the user's own personal calendar: an ACTIVE SyncOrigin.REMOTE binding, an agenda calendar the user could edit, its events imported, the user's own edits pushed into somebody else's calendar (rig calendar 16, acceptance calendar 33). The classification now keeps new ones from being made; this retires the bindings that exist.

Retiring is making the binding inert, and nothing else. The binding becomes CalendarSyncStatus.RETIRED_SUBSCRIPTION: nothing is read from the collection or written to it through it any more, and a reconnection does not wake it up. The calendar is not deleted, and that is deliberate. What it holds is mostly copies of the server's objects, but eXo cannot prove it holds nothing else: agenda lists a calendar's events only over a date window and only when they are confirmed, so an event the user made there — a date poll, one pushed and refused, one dated outside the window — could not be told from a copy, and deleting the calendar would delete it with them. The state is told to the user instead, among the calendars needing attention; deleting the calendar drops the binding and the collection is then listed read-only under "Shared with me".

Nothing is written to the server. The one request made is a read: the owner the collection's name points at is asked its display name, and a binding is retired only when that principal answers one. BlueMind accepts a collection created over CalDAV under any segment, calendar:… included, so the name alone could point at nobody; a principal the directory does not know makes BlueMind fail the request, and the binding is then left as it was. A definite refusal like that is remembered for the binding until the next restart, so the question is not put to the server on every sweep; a server that could not be reached, or that refused the account's credentials, said nothing about the owner, and is asked again on the next pass.

Said once per binding, at warn: once retired, a binding is no longer one this is asked about.

  • Constructor Details

    • CaldavSubscriptionRetirementService

      public CaldavSubscriptionRetirementService()
  • Method Details

    • retire

      public CaldavSubscriptionRetirementService.Retirement retire(long userIdentityId, CalDavEndpoint endpoint, String principal, org.exoplatform.caldav.model.CalendarSync pair, CalendarCollection collection, CollectionOwnership ownership)
      Retires a binding the sweep made for a collection that is a subscription.
      Parameters:
      userIdentityId - identity of the user the binding belongs to
      endpoint - the account's endpoint, through which the owner is asked
      principal - the account's own principal, as the listing named it
      pair - the binding, which must be an ACTIVE or PAUSED REMOTE pair of this user
      collection - the listed collection the binding is bound to
      ownership - whose the collection is, as the classification answered
      Returns:
      what was done