Class BlueMindSubscriptionChannel

java.lang.Object
org.exoplatform.bluemind.calendar.plugin.BlueMindSubscriptionChannel
All Implemented Interfaces:
org.exoplatform.caldav.plugin.CalendarSubscriptionChannel, org.springframework.core.Ordered

@Service("blueMindAddonSubscriptionChannel") @ConditionalOnClass(org.exoplatform.caldav.plugin.CalendarSubscriptionChannel.class) public class BlueMindSubscriptionChannel extends Object implements org.exoplatform.caldav.plugin.CalendarSubscriptionChannel, org.springframework.core.Ordered
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 named "blueMindAddonSubscriptionChannel" and ordered BlueMindCalendarPrecedence.ORDER: the host asks its channels in order and keeps the first that names a principal or reads a subscription, so this one answers for a BlueMind account while the host still ships its own.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    The bean name, distinct from the host's own channel's.
    static final String
    The channel's identifier.

    Fields inherited from interface org.springframework.core.Ordered

    HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
  • Constructor Summary

    Constructors
    Constructor
    Description
    The channel over BlueMind's subscription client.
  • Method Summary

    Modifier and Type
    Method
    Description
    <T> T
    asSubscriber(org.exoplatform.caldav.client.CalDavEndpoint endpoint, String userUid, Function<org.exoplatform.caldav.plugin.SubscriptionEdits,T> job)
    Runs the edits in one BlueMind session opened as the user.
    int
    Ahead of the host's own BlueMind channel.
    id()
    org.exoplatform.caldav.plugin.CalendarOwners
    ownersOf(org.exoplatform.caldav.client.CalDavEndpoint endpoint)
    BlueMind's own listing of who owns each calendar the account sees.
    org.exoplatform.caldav.plugin.CalendarSubscription
    subscriptionOf(String href, String principal)
    The subscription BlueMind's container naming reveals, with the owner's principal spelled the account's way.
    userUidOf(String principal)
    The directory entry uid of a BlueMind user principal.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • BlueMindSubscriptionChannel

      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()
      Specified by:
      id in interface org.exoplatform.caldav.plugin.CalendarSubscriptionChannel
    • userUidOf

      public String userUidOf(String principal)
      The directory entry uid of a BlueMind user principal.
      Specified by:
      userUidOf in interface org.exoplatform.caldav.plugin.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 org.exoplatform.caldav.plugin.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 org.exoplatform.caldav.plugin.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(org.exoplatform.caldav.client.CalDavEndpoint endpoint, String userUid, Function<org.exoplatform.caldav.plugin.SubscriptionEdits,T> job)
      Runs the edits in one BlueMind session opened as the user.
      Specified by:
      asSubscriber in interface org.exoplatform.caldav.plugin.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 org.exoplatform.caldav.plugin.CalendarOwners ownersOf(org.exoplatform.caldav.client.CalDavEndpoint endpoint)
      BlueMind's own listing of who owns each calendar the account sees.
      Specified by:
      ownersOf in interface org.exoplatform.caldav.plugin.CalendarSubscriptionChannel
      Parameters:
      endpoint - the account's endpoint
      Returns:
      the listing
    • getOrder

      public int getOrder()
      Ahead of the host's own BlueMind channel.
      Specified by:
      getOrder in interface org.springframework.core.Ordered
      Returns:
      BlueMindCalendarPrecedence.ORDER