Class CalendarSubscriptionChannelRegistry

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

@Service public class CalendarSubscriptionChannelRegistry extends Object
The subscription channels installed on this platform, and the questions the host asks of them: whose calendar a listed collection is, which uid a principal addresses, and through which channel an account's subscriptions are edited.

The contributions are read on each question, through the bean factory, so a channel from another web application is found whatever the boot order.

  • Constructor Details

    • CalendarSubscriptionChannelRegistry

      @Autowired public CalendarSubscriptionChannelRegistry(org.springframework.beans.factory.ObjectProvider<CalendarSubscriptionChannel> channels)
      The registry over every contributed channel.
      Parameters:
      channels - the contributions, from every web application, each read on its own so that one which cannot be created is left out (ContributedBeans); null reads as none
  • Method Details

    • of

      The registry over a fixed list of channels, as a test states them.
      Parameters:
      channels - the channels, may be null for none
      Returns:
      the registry
    • channelOf

      public CalendarSubscriptionChannel channelOf(String principal)
      The channel of an account: the first one that names its principal's uid, the null channel otherwise.
      Parameters:
      principal - the account's principal path, may be null
      Returns:
      the channel, never null
    • userUidOf

      public String userUidOf(String principal)
      The uid a principal addresses its user by, through its channel.
      Parameters:
      principal - a principal path, may be null
      Returns:
      the uid, or null when no installed channel reads one
    • subscriptionOf

      public CalendarSubscription subscriptionOf(String href, String principal)
      The subscription a listed collection is, as the first channel that reads one in it says.
      Parameters:
      href - the collection's path
      principal - the account's own principal path, may be null
      Returns:
      the subscription, or null when no installed channel reads one
    • primary

      public CalendarSubscriptionChannel primary()
      The channel asked where only a uid, not a principal, is in hand: the first installed one, the null channel when none is.

      Two questions are asked that way: the subscription a share follows at once, addressed by the uid the share channel read, and the owner listing the owner cache keeps per server and user, not per channel. Both hold while one product contributes subscriptions, which is the case this seam was drawn for; a second one would carry the channel on those two keys.

      Returns:
      the channel, never null
    • ownersOf

      public CalendarOwners ownersOf(CalDavEndpoint endpoint)
      The owner listing of an account, as the primary() channel answers it. The caller only asks for an account whose principal a channel already named (userUidOf(java.lang.String)).
      Parameters:
      endpoint - the account's endpoint
      Returns:
      the listing
      Throws:
      UnsupportedOperationException - when no channel is installed, or the account's credentials cannot open a session
    • isEmpty

      public boolean isEmpty()
      Whether any subscription channel is installed at all.
      Returns:
      true when at least one is