Package org.exoplatform.agenda.listener
Class AgendaCalendarLinkCleanupListener
java.lang.Object
org.exoplatform.agenda.listener.AgendaCalendarLinkCleanupListener
- All Implemented Interfaces:
org.exoplatform.services.listener.ListenerBase<org.exoplatform.agenda.model.Calendar,Object>
@Component
public class AgendaCalendarLinkCleanupListener
extends Object
implements org.exoplatform.services.listener.ListenerBase<org.exoplatform.agenda.model.Calendar,Object>
Deletes the link of a calendar once the calendar is deleted. Glue only: the
deletion is the service's.
The link table carries no foreign key to the calendar table on purpose: a key would make every deletion of a calendar that has a link fail, whichever addon deletes it. A link left behind would open nothing anyway — the feed answers 404 for a calendar that no longer exists — so this listener keeps the table tidy rather than keeping anything safe.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringBroadcast byAgendaCalendarStorageonce a calendar row is deleted. -
Constructor Summary
ConstructorsConstructorDescriptionAgendaCalendarLinkCleanupListener(org.exoplatform.services.listener.ListenerService listenerService, org.exoplatform.agenda.service.AgendaCalendarLinkService calendarLinkService) 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
-
Field Details
-
CALENDAR_DELETED_EVENT
Broadcast byAgendaCalendarStorageonce a calendar row is deleted.- See Also:
-
-
Constructor Details
-
AgendaCalendarLinkCleanupListener
@Autowired public AgendaCalendarLinkCleanupListener(org.exoplatform.services.listener.ListenerService listenerService, org.exoplatform.agenda.service.AgendaCalendarLinkService calendarLinkService) Builds the listener.- Parameters:
listenerService- the platform event buscalendarLinkService- the owner of calendar links
-
-
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 link 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
-