Class BlueMindSubscriptionChannel

java.lang.Object
org.exoplatform.caldav.client.bluemind.BlueMindSubscriptionChannel
All Implemented Interfaces:
CalendarSubscriptionChannel

@Service public class BlueMindSubscriptionChannel extends Object implements CalendarSubscriptionChannel
BlueMind's subscriptions as a channel: its container naming (BlueMindContainerNaming) tells a subscription from the account's own calendar, and its REST subscription API (BlueMindSubscriptionClient) subscribes a colleague to a calendar shared with them (EXO-90275, EXO-90277, EXO-90347).

A @Service, like any contribution from another add-on, so that the host collects it by type through the Kernel/Spring bridge and never names it.

  • Field Details

  • Constructor Details

    • BlueMindSubscriptionChannel

      @Autowired public BlueMindSubscriptionChannel(BlueMindSubscriptionClient blueMindSubscriptionClient)
      The channel over BlueMind's subscription client.
      Parameters:
      blueMindSubscriptionClient - the REST client, may be null where only the naming is used
  • Method Details

    • id

      public String id()
      The channel's stable identifier, for the log.
      Specified by:
      id in interface CalendarSubscriptionChannel
      Returns:
      the identifier, never blank
    • userUidOf

      public String userUidOf(String principal)
      The directory entry uid of a BlueMind user principal.
      Specified by:
      userUidOf in interface CalendarSubscriptionChannel
      Parameters:
      principal - a principal path, may be null
      Returns:
      the uid, or null when the path is not a BlueMind user principal
    • subscriptionOf

      public CalendarSubscription subscriptionOf(String href, String principal)
      The subscription BlueMind's container naming reveals, with the owner's principal spelled the account's way.
      Specified by:
      subscriptionOf in interface CalendarSubscriptionChannel
      Parameters:
      href - the collection's path
      principal - the account's own principal path, may be null
      Returns:
      the subscription, or null
    • asSubscriber

      public <T> T asSubscriber(CalDavEndpoint endpoint, String userUid, Function<SubscriptionEdits,T> job)
      Runs the edits in one BlueMind session opened as the user.
      Specified by:
      asSubscriber in interface CalendarSubscriptionChannel
      Type Parameters:
      T - what the job produces
      Parameters:
      endpoint - the user's endpoint
      userUid - the directory entry uid recorded for them
      job - the edits
      Returns:
      what the job produced
    • ownersOf

      public CalendarOwners ownersOf(CalDavEndpoint endpoint)
      BlueMind's own listing of who owns each calendar the account sees.
      Specified by:
      ownersOf in interface CalendarSubscriptionChannel
      Parameters:
      endpoint - the account's endpoint
      Returns:
      the listing