Class AgendaCalendarSubscriptionCleanupListener

java.lang.Object
org.exoplatform.agenda.listener.AgendaCalendarSubscriptionCleanupListener
All Implemented Interfaces:
org.exoplatform.services.listener.ListenerBase<org.exoplatform.agenda.model.Calendar,Object>

@Component public class AgendaCalendarSubscriptionCleanupListener extends Object implements org.exoplatform.services.listener.ListenerBase<org.exoplatform.agenda.model.Calendar,Object>
Removes the subscription of a calendar deleted by any other path than unsubscribing (EXO-90278), so that no feed keeps being read into a calendar that is gone. Glue only: the removal is the service's.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Broadcast by AgendaCalendarStorage once a calendar row is deleted.
  • Constructor Summary

    Constructors
    Constructor
    Description
    AgendaCalendarSubscriptionCleanupListener(org.exoplatform.services.listener.ListenerService listenerService, org.exoplatform.agenda.service.AgendaCalendarSubscriptionService subscriptionService)
    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)
    Removes the subscription of the deleted calendar, when it was a subscribed one.

    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
  • Field Details

    • CALENDAR_DELETED_EVENT

      public static final String CALENDAR_DELETED_EVENT
      Broadcast by AgendaCalendarStorage once a calendar row is deleted.
      See Also:
  • Constructor Details

    • AgendaCalendarSubscriptionCleanupListener

      @Autowired public AgendaCalendarSubscriptionCleanupListener(org.exoplatform.services.listener.ListenerService listenerService, org.exoplatform.agenda.service.AgendaCalendarSubscriptionService subscriptionService)
      Builds the listener.
      Parameters:
      listenerService - the platform event bus
      subscriptionService - the owner of calendar subscriptions
  • 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)
      Removes the subscription of the deleted calendar, when it was a subscribed one.
      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