Class CachedAgendaEventStorage

java.lang.Object
org.exoplatform.agenda.storage.AgendaEventStorage
org.exoplatform.agenda.storage.cached.CachedAgendaEventStorage

public class CachedAgendaEventStorage extends AgendaEventStorage
  • Field Details

  • Constructor Details

    • CachedAgendaEventStorage

      public CachedAgendaEventStorage(org.exoplatform.services.cache.CacheService cacheService, CalendarDAO calendarDAO, EventDAO eventDAO, EventRecurrenceDAO eventRecurrenceDAO)
  • Method Details

    • getEventById

      public org.exoplatform.agenda.model.Event getEventById(long eventId)
      While a decide step runs on the thread, the event is read from the database, after the step's lock, and the cache is neither read nor filled: the loader would store at once, for every thread of the node, a row the step's transaction has not committed yet, and an entry another thread put back after the step's own eviction would be stale. The event is recorded instead, and evicted once the step's transaction ends.
      Overrides:
      getEventById in class AgendaEventStorage
    • getExceptionalOccurrences

      public List<org.exoplatform.agenda.model.Event> getExceptionalOccurrences(long parentRecurrentEventId)
      Description copied from class: AgendaEventStorage
      Reads the exceptional occurrences of a recurrent event in one statement, ordered by start date.
      Overrides:
      getExceptionalOccurrences in class AgendaEventStorage
      Parameters:
      parentRecurrentEventId - a parent recurrent Event technical identifier
      Returns:
      List of its exceptional occurrence events
    • createEvent

      public org.exoplatform.agenda.model.Event createEvent(org.exoplatform.agenda.model.Event event)
      Overrides:
      createEvent in class AgendaEventStorage
    • updateEvent

      public org.exoplatform.agenda.model.Event updateEvent(org.exoplatform.agenda.model.Event event)
      Overrides:
      updateEvent in class AgendaEventStorage
    • saveCapacityReachedDate

      public void saveCapacityReachedDate(long eventId, ZonedDateTime capacityReachedDate)
      Description copied from class: AgendaEventStorage
      Writes the mark of an event row's pool having reached its capacity, and nothing else of the row: once the row exists, the only write of that mark, which a save of the whole row leaves as it is. It requires an active transaction, the one of the decide step holding the event lock.
      Overrides:
      saveCapacityReachedDate in class AgendaEventStorage
      Parameters:
      eventId - event identifier
      capacityReachedDate - the instant the pool is marked as having reached its capacity, or null to clear the mark
    • deleteEventById

      public void deleteEventById(long eventId)
      Overrides:
      deleteEventById in class AgendaEventStorage
    • deleteEventAfterRead

      public void deleteEventAfterRead(long eventId)
      Description copied from class: AgendaEventStorage
      Deletes an event whose attendees, conferences or reminders were read in the same request, which AgendaEventStorage.deleteEventById(long) cannot: the persistence context is cleared before the bulk deletion of its children.
      Overrides:
      deleteEventAfterRead in class AgendaEventStorage
      Parameters:
      eventId - the event to delete
    • evictEvents

      public void evictEvents(Collection<Long> eventIds)
      Evicts events from the cache this storage reads through, once the transaction that read or wrote them has ended. This storage has no cache. A load in flight, started before the transaction ended, is forgotten as well, so that it cannot put back the state it read then.
      Overrides:
      evictEvents in class AgendaEventStorage
      Parameters:
      eventIds - the technical identifiers of the events to evict
    • deleteCalendarEvents

      public void deleteCalendarEvents(long calendarId)
      Overrides:
      deleteCalendarEvents in class AgendaEventStorage
    • moveCalendarEvents

      public List<Long> moveCalendarEvents(long fromCalendarId, long toCalendarId)
      Moves all events of a calendar to another calendar, keeping every event and its associated data (attendees, reminders, conferences, recurrences, remote identifiers) untouched apart from the calendar membership. In addition, evicts the moved events from the event cache so that subsequent reads return the new calendar membership.
      Overrides:
      moveCalendarEvents in class AgendaEventStorage
      Parameters:
      fromCalendarId - technical identifier of the calendar the events are moved away from
      toCalendarId - technical identifier of the calendar receiving the events
      Returns:
      List of technical identifiers of the moved events, empty when the source calendar had no events
    • deleteExceptionalOccurences

      public List<Long> deleteExceptionalOccurences(long parentRecurrentEventId)
      Overrides:
      deleteExceptionalOccurences in class AgendaEventStorage
    • clearCache

      public void clearCache()