Package org.exoplatform.caldav.listener
Class CalendarCreatedListener
java.lang.Object
org.exoplatform.container.component.BaseComponentPlugin
org.exoplatform.services.listener.Listener<org.exoplatform.agenda.model.Calendar,Object>
org.exoplatform.caldav.listener.CalendarCreatedListener
- All Implemented Interfaces:
org.exoplatform.container.component.ComponentPlugin,org.exoplatform.services.listener.ListenerBase<org.exoplatform.agenda.model.Calendar,Object>
public class CalendarCreatedListener
extends org.exoplatform.services.listener.Listener<org.exoplatform.agenda.model.Calendar,Object>
Pushes a calendar to the user's CalDAV server as soon as they create it.
Without this the only trigger is the throttled on-access sync, so a calendar created in eXo could sit here for a quarter of an hour before reaching the server the user reads on their phone. Correct behaviour, and a poor one to live with.
Asynchronous on purpose. The event is raised inside the transaction that creates the calendar, and talking to a calendar server there would hold a database transaction open across the network — and would make a slow or unreachable server able to fail creating a calendar that has nothing to do with it.
Glue only, per the extensibility norm: it resolves who the calendar belongs to and hands the work to the sync engine.
-
Field Summary
Fields inherited from class org.exoplatform.container.component.BaseComponentPlugin
desc, name -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidonEvent(org.exoplatform.services.listener.Event<org.exoplatform.agenda.model.Calendar, Object> event) Reacts to a calendar having been created.protected voidsetCaldavSyncService(CaldavSyncService caldavSyncService) Hands the engine to tests, which have no container to resolve it from.Methods inherited from class org.exoplatform.container.component.BaseComponentPlugin
getDescription, getName, setDescription, setNameMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.exoplatform.services.listener.ListenerBase
getName
-
Constructor Details
-
CalendarCreatedListener
public CalendarCreatedListener()
-
-
Method Details
-
onEvent
public void onEvent(org.exoplatform.services.listener.Event<org.exoplatform.agenda.model.Calendar, Object> event) Reacts to a calendar having been created.- Parameters:
event- carries the created calendar as its source
-
setCaldavSyncService
Hands the engine to tests, which have no container to resolve it from.- Parameters:
caldavSyncService- the engine to use
-