Class CalendarObjectWriters
Chosen per server, never per call site: the registration's
CaldavServer.getWriteChannel() is read for the server the endpoint
was minted from, and every write and removal on that endpoint — the
organizer's copy, an invitee's copy, an answer carried onto a copy, a
repair, a relocation — goes through the same door. That is what makes the
administrator's flag a complete rollback: nothing else decides.
No fallback on a registry failure, and that is deliberate where
CaldavPushService.mirrorTargetOf does fall back. There, writing the
copies where they have always gone is at worst unchanged behaviour. Here,
writing through CalDAV a copy meant for the import channel is the very
defect the channel exists to prevent — BlueMind would schedule the meeting
— so a registry that cannot be read fails the write, which the sweep
retries, rather than quietly choosing the wrong door. The endpoint was
minted from the same registry a moment earlier, so this read failing is a
real incident, not a routine miss.
The doors are contributed. CalDAV is built in; every other channel's
writer comes from a CalendarWriteChannelPlugin, collected by type
from every web application, so this class names no server. A registration
declaring a channel nobody contributes is refused with
CaldavPushService.WRITE_CHANNEL_UNAVAILABLE — never written through
CalDAV instead, for the reason stated above.
-
Constructor Summary
ConstructorsConstructorDescriptionCalendarObjectWriters(CaldavServerService caldavServerService, CalDavObjectWriter calDavObjectWriter, org.springframework.beans.factory.ObjectProvider<CalendarWriteChannelPlugin> plugins) The resolver over the registry, the CalDAV door and every contributed one. -
Method Summary
Modifier and TypeMethodDescriptionstatic CalendarObjectWritersof(CaldavServerService caldavServerService, CalDavObjectWriter calDavObjectWriter, List<CalendarWriteChannelPlugin> plugins) The resolver over a fixed list of contributions, as a test states them.booleanserves(org.exoplatform.caldav.model.WriteChannel channel) Whether a channel has a door on this platform: CalDAV always, any other one when a contribution serves it.writer(CalDavEndpoint endpoint) The writer for every object of an endpoint's server.
-
Constructor Details
-
CalendarObjectWriters
@Autowired public CalendarObjectWriters(CaldavServerService caldavServerService, CalDavObjectWriter calDavObjectWriter, org.springframework.beans.factory.ObjectProvider<CalendarWriteChannelPlugin> plugins) The resolver over the registry, the CalDAV door and every contributed one.- Parameters:
caldavServerService- the registry the channel is read fromcalDavObjectWriter- the CalDAV doorplugins- the contributed doors, 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
public static CalendarObjectWriters of(CaldavServerService caldavServerService, CalDavObjectWriter calDavObjectWriter, List<CalendarWriteChannelPlugin> plugins) The resolver over a fixed list of contributions, as a test states them.- Parameters:
caldavServerService- the registry the channel is read fromcalDavObjectWriter- the CalDAV doorplugins- the contributed doors, may be null for none- Returns:
- the resolver
-
writer
The writer for every object of an endpoint's server.- Parameters:
endpoint- the endpoint minted from the registry- Returns:
- the door the server's registration declares
- Throws:
CaldavPushException- withCaldavPushService.WRITE_CHANNEL_UNAVAILABLEwhen the registration declares a channel no contribution servesRuntimeException- whatever the registry raises when it cannot be read — propagated, never turned into a door
-
serves
public boolean serves(org.exoplatform.caldav.model.WriteChannel channel) Whether a channel has a door on this platform: CalDAV always, any other one when a contribution serves it.- Parameters:
channel- the channel, may be null for CalDAV- Returns:
- true when a write on that channel can be carried out
-