Interface SynchronyEvictionDao
-
- All Known Implementing Classes:
DefaultSynchronyEvictionDao
public interface SynchronyEvictionDao
Find and remove content from synchrony tables.- Since:
- 7.0.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description List<Long>
findContentWithAnyEventOlderThan(int eventThresholdHours, int limit)
Get at most {@param limit} content ids from synchrony events table, for each at least one event is older than {@param eventThresholdHours} hours from now.List<Long>
findContentWithAnySnapshotOlderThan(int snapshotThresholdHours, int limit)
Get at most {@param limit} content ids from synchrony snapshot table, for each at least one event is older than {@param snapshotThresholdHours} hours from now.List<Long>
findSafeContentWithHistoryOlderThan(int synchronyThresholdHours, int draftThresholdHours, int limit)
Get at most {@param limit} content ids from synchrony tables, for each all events are older than {@param synchronyThresholdHours} hours from now.long
getEventsCount(Long contentId)
long
getSnapshotsCount(Long contentId)
int
removeAllSynchronyDataFor(Collection<Long> contentIds)
Remove all synchrony data matching {@param contentId}int
removeApplicationIds(Collection<String> applicationIds)
void
removeContentProperties()
-
-
-
Method Detail
-
findSafeContentWithHistoryOlderThan
@Transactional(readOnly=true) List<Long> findSafeContentWithHistoryOlderThan(int synchronyThresholdHours, int draftThresholdHours, int limit)
Get at most {@param limit} content ids from synchrony tables, for each all events are older than {@param synchronyThresholdHours} hours from now. Also, check that last modification day of the draft is at least {@param draftThresholdHours}. This is important to ensure that nobody has the editor open with this content right now.
-
findContentWithAnyEventOlderThan
@Transactional(readOnly=true) List<Long> findContentWithAnyEventOlderThan(int eventThresholdHours, int limit)
Get at most {@param limit} content ids from synchrony events table, for each at least one event is older than {@param eventThresholdHours} hours from now.
-
findContentWithAnySnapshotOlderThan
@Transactional(readOnly=true) List<Long> findContentWithAnySnapshotOlderThan(int snapshotThresholdHours, int limit)
Get at most {@param limit} content ids from synchrony snapshot table, for each at least one event is older than {@param snapshotThresholdHours} hours from now.
-
removeAllSynchronyDataFor
@Transactional(propagation=REQUIRES_NEW) int removeAllSynchronyDataFor(Collection<Long> contentIds)
Remove all synchrony data matching {@param contentId}- Returns:
- actual number of rows removed from the DB
-
getEventsCount
@Transactional(readOnly=true) long getEventsCount(Long contentId)
- Returns:
- if {@param contentId} is not null, returns the number of Synchrony event rows related to the entity. Otherwise returns the total number of Synchrony events in the DB.
-
getSnapshotsCount
@Transactional(readOnly=true) long getSnapshotsCount(Long contentId)
- Returns:
- if {@param contentId} is not null, returns the number of Synchrony snapshot rows related to the entity. Otherwise returns the total number of Synchrony snapshots in the DB.
-
removeApplicationIds
@Transactional(propagation=REQUIRES_NEW) int removeApplicationIds(Collection<String> applicationIds)
-
removeContentProperties
@Transactional(propagation=REQUIRES_NEW) void removeContentProperties()
-
-