Class CachedAgendaEventStorage
java.lang.Object
org.exoplatform.agenda.storage.AgendaEventStorage
org.exoplatform.agenda.storage.cached.CachedAgendaEventStorage
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCachedAgendaEventStorage(org.exoplatform.services.cache.CacheService cacheService, CalendarDAO calendarDAO, EventDAO eventDAO, EventRecurrenceDAO eventRecurrenceDAO) -
Method Summary
Modifier and TypeMethodDescriptionvoidorg.exoplatform.agenda.model.EventcreateEvent(org.exoplatform.agenda.model.Event event) voiddeleteCalendarEvents(long calendarId) voiddeleteEventAfterRead(long eventId) Deletes an event whose attendees, conferences or reminders were read in the same request, whichAgendaEventStorage.deleteEventById(long)cannot: the persistence context is cleared before the bulk deletion of its children.voiddeleteEventById(long eventId) deleteExceptionalOccurences(long parentRecurrentEventId) voidevictEvents(Collection<Long> eventIds) Evicts events from the cache this storage reads through, once the transaction that read or wrote them has ended.org.exoplatform.agenda.model.EventgetEventById(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.List<org.exoplatform.agenda.model.Event> getExceptionalOccurrences(long parentRecurrentEventId) Reads the exceptional occurrences of a recurrent event in one statement, ordered by start date.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.voidsaveCapacityReachedDate(long eventId, ZonedDateTime capacityReachedDate) 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.org.exoplatform.agenda.model.EventupdateEvent(org.exoplatform.agenda.model.Event event) Methods inherited from class AgendaEventStorage
countEventDatePolls, countPendingEvents, deleteExceptionalOccurencesOfSavedSeries, findExceptionalOccurrence, getEventDatePollIds, getEventDatePollIds, getEventIds, getExceptionalOccurenceIds, getExceptionalOccurenceIdsByPeriod, getParentRecurrentEventIds, getPendingEventIds, getUserEventCalenderIds, isRecurrentEvent, lockEvents
-
Field Details
-
EVENT_CACHE_NAME
- See Also:
-
-
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:
getEventByIdin classAgendaEventStorage
-
getExceptionalOccurrences
public List<org.exoplatform.agenda.model.Event> getExceptionalOccurrences(long parentRecurrentEventId) Description copied from class:AgendaEventStorageReads the exceptional occurrences of a recurrent event in one statement, ordered by start date.- Overrides:
getExceptionalOccurrencesin classAgendaEventStorage- Parameters:
parentRecurrentEventId- a parent recurrentEventtechnical identifier- Returns:
Listof its exceptional occurrence events
-
createEvent
public org.exoplatform.agenda.model.Event createEvent(org.exoplatform.agenda.model.Event event) - Overrides:
createEventin classAgendaEventStorage
-
updateEvent
public org.exoplatform.agenda.model.Event updateEvent(org.exoplatform.agenda.model.Event event) - Overrides:
updateEventin classAgendaEventStorage
-
saveCapacityReachedDate
Description copied from class:AgendaEventStorageWrites 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:
saveCapacityReachedDatein classAgendaEventStorage- Parameters:
eventId- event identifiercapacityReachedDate- the instant the pool is marked as having reached its capacity, or null to clear the mark
-
deleteEventById
public void deleteEventById(long eventId) - Overrides:
deleteEventByIdin classAgendaEventStorage
-
deleteEventAfterRead
public void deleteEventAfterRead(long eventId) Description copied from class:AgendaEventStorageDeletes an event whose attendees, conferences or reminders were read in the same request, whichAgendaEventStorage.deleteEventById(long)cannot: the persistence context is cleared before the bulk deletion of its children.- Overrides:
deleteEventAfterReadin classAgendaEventStorage- Parameters:
eventId- the event to delete
-
evictEvents
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:
evictEventsin classAgendaEventStorage- Parameters:
eventIds- the technical identifiers of the events to evict
-
deleteCalendarEvents
public void deleteCalendarEvents(long calendarId) - Overrides:
deleteCalendarEventsin classAgendaEventStorage
-
moveCalendarEvents
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:
moveCalendarEventsin classAgendaEventStorage- Parameters:
fromCalendarId- technical identifier of the calendar the events are moved away fromtoCalendarId- technical identifier of the calendar receiving the events- Returns:
Listof technical identifiers of the moved events, empty when the source calendar had no events
-
deleteExceptionalOccurences
- Overrides:
deleteExceptionalOccurencesin classAgendaEventStorage
-
clearCache
public void clearCache()
-