Package org.exoplatform.agenda.listener
Class AgendaCalendarShareCleanupListener
java.lang.Object
org.exoplatform.agenda.listener.AgendaCalendarShareCleanupListener
- All Implemented Interfaces:
org.exoplatform.services.listener.ListenerBase<org.exoplatform.agenda.model.Calendar,Object>
@Component
public class AgendaCalendarShareCleanupListener
extends Object
implements org.exoplatform.services.listener.ListenerBase<org.exoplatform.agenda.model.Calendar,Object>
Deletes the shares of a calendar once the calendar is deleted (EXO-90357).
Glue only: the deletion is the service's.
The share table carries no foreign key to the calendar table, for the reason the link table carries none: a key would make every deletion of a shared calendar fail, whichever addon deletes it. A share left behind grants nothing — every read checks the calendar first — so this listener keeps the table tidy rather than keeping anything safe.
-
Constructor Summary
ConstructorsConstructorDescriptionAgendaCalendarShareCleanupListener(org.exoplatform.services.listener.ListenerService listenerService, org.exoplatform.agenda.service.AgendaCalendarShareService calendarShareService) Builds the listener. -
Method Summary
Methods 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
-
Method Details
-
init
@PostConstruct public void init()Registers the listener on the calendar deletion event. -
onEvent
public void onEvent(org.exoplatform.services.listener.Event<org.exoplatform.agenda.model.Calendar, Object> event) Deletes the shares of the deleted calendar.- Specified by:
onEventin interfaceorg.exoplatform.services.listener.ListenerBase<org.exoplatform.agenda.model.Calendar,Object> - Parameters:
event- the deletion event, whose source is the deleted calendar
-