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

    Constructors
    Constructor
    Description
    AgendaCalendarShareCleanupListener(org.exoplatform.services.listener.ListenerService listenerService, org.exoplatform.agenda.service.AgendaCalendarShareService calendarShareService)
    Builds the listener.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Registers the listener on the calendar deletion event.
    void
    onEvent(org.exoplatform.services.listener.Event<org.exoplatform.agenda.model.Calendar,Object> event)
    Deletes the shares of the deleted calendar.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.exoplatform.services.listener.ListenerBase

    getName
  • Constructor Details

    • AgendaCalendarShareCleanupListener

      @Autowired public AgendaCalendarShareCleanupListener(org.exoplatform.services.listener.ListenerService listenerService, org.exoplatform.agenda.service.AgendaCalendarShareService calendarShareService)
      Builds the listener.
      Parameters:
      listenerService - the platform event bus
      calendarShareService - the owner of calendar shares
  • 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:
      onEvent in interface org.exoplatform.services.listener.ListenerBase<org.exoplatform.agenda.model.Calendar,Object>
      Parameters:
      event - the deletion event, whose source is the deleted calendar