Package org.exoplatform.caldav.service
Class CalendarServerFlavourRegistry
java.lang.Object
org.exoplatform.caldav.service.CalendarServerFlavourRegistry
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
ConstructorsConstructorDescriptionCalendarServerFlavourRegistry(org.springframework.beans.factory.ObjectProvider<CalendarServerFlavour> flavours) The registry over every contributed flavour. -
Method Summary
Modifier and TypeMethodDescriptionbooleanaccepts(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.voidDrops every session every flavour keeps.voidforgetSession(long userIdentityId, Long serverId) Drops the session every flavour keeps for one account.booleanknows(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.of(List<CalendarServerFlavour> flavours) The registry over a fixed list of flavours, as a test states them.
-
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
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 registrationchannel- 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
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 userserverId- 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.
-