Class CalendarServerFlavourRegistry

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

@Service public class CalendarServerFlavourRegistry extends Object
The server flavours installed on this platform, and the one question the host asks of them: which product a registration stands for.

A @Service so that the Kernel components of this add-on — the connector service among them — reach it through the Kernel/Spring bridge, which exports @Service beans and nothing else. The contributions are read on each question, through the bean factory, so a flavour from another web application is found whatever the boot order.

  • Constructor Summary

    Constructors
    Constructor
    Description
    CalendarServerFlavourRegistry(org.springframework.beans.factory.ObjectProvider<CalendarServerFlavour> flavours)
    The registry over every contributed flavour.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    accepts(org.exoplatform.caldav.model.CaldavServer server, org.exoplatform.caldav.model.WriteChannel channel)
    Whether a registration may declare a write channel: CalDAV, or no channel at all, always; any other one when the registration's flavour allows it.
    flavourOf(org.exoplatform.caldav.model.CaldavServer server)
    The flavour a registration stands for: the first contributed one that recognises it, plain CalDAV otherwise.
    void
    Drops every session every flavour keeps.
    void
    forgetSession(long userIdentityId, Long serverId)
    Drops the session every flavour keeps for one account.
    boolean
    knows(org.exoplatform.caldav.model.WriteChannel channel)
    Whether any installed flavour allows a write channel, whichever registration it is for: false for a channel whose add-on is not installed.
    The registry over a fixed list of flavours, as a test states them.

    Methods inherited from class java.lang.Object

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

    • CalendarServerFlavourRegistry

      @Autowired public CalendarServerFlavourRegistry(org.springframework.beans.factory.ObjectProvider<CalendarServerFlavour> flavours)
      The registry over every contributed flavour.
      Parameters:
      flavours - 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 flavours, as a test states them.
      Parameters:
      flavours - the flavours, may be null for none
      Returns:
      the registry
    • flavourOf

      public CalendarServerFlavour flavourOf(org.exoplatform.caldav.model.CaldavServer server)
      The flavour a registration stands for: the first contributed one that recognises it, plain CalDAV otherwise.
      Parameters:
      server - the registration, may be null
      Returns:
      the flavour, never null
    • accepts

      public boolean accepts(org.exoplatform.caldav.model.CaldavServer server, org.exoplatform.caldav.model.WriteChannel channel)
      Whether a registration may declare a write channel: CalDAV, or no channel at all, always; any other one when the registration's flavour allows it.
      Parameters:
      server - the registration
      channel - the channel it declares, may be null
      Returns:
      true when the declaration is acceptable
    • knows

      public boolean knows(org.exoplatform.caldav.model.WriteChannel channel)
      Whether any installed flavour allows a write channel, whichever registration it is for: false for a channel whose add-on is not installed.
      Parameters:
      channel - the channel, may be null
      Returns:
      true for CalDAV, no channel, or a channel some flavour allows
    • forgetSession

      public void forgetSession(long userIdentityId, Long serverId)
      Drops the session every flavour keeps for one account. One flavour that fails does not stop the others, and never fails the caller.
      Parameters:
      userIdentityId - the social identity of the connected user
      serverId - the registration the account was on, null for the legacy deployment property
    • forgetAllSessions

      public void forgetAllSessions()
      Drops every session every flavour keeps. One flavour that fails does not stop the others, and never fails the caller.