Class DefaultSynchronyEvictionDao
java.lang.Object
com.atlassian.confluence.pages.persistence.dao.DefaultSynchronyEvictionDao
- All Implemented Interfaces:
SynchronyEvictionDao
Runs operations on synchrony tables (EVENTS, SNAPSHOTS) and Confluence invalid input: '<'-> Synchrony mapping in content properties
- Since:
- 7.0.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfindContentWithAnyEventOlderThan(int eventThresholdHours, int limit) Get at most content ids from synchrony events table, for each at least one event is older than hours from now.findContentWithAnySnapshotOlderThan(int snapshotThresholdHours, int limit) Get at most content ids from synchrony snapshot table, for each at least one event is older than hours from now.findSafeContentWithHistoryOlderThan(int synchronyThresholdHours, int draftThresholdHours, int limit) Get at most content ids from synchrony tables, for each all events are older than hours from now.longgetEventsCount(Long contentId) longgetSnapshotsCount(Long contentId) intremoveAllSynchronyDataFor(Collection<Long> contentIds) Remove all synchrony data matchingintremoveApplicationIds(Collection<String> applicationIds) void
-
Constructor Details
-
DefaultSynchronyEvictionDao
public DefaultSynchronyEvictionDao(org.hibernate.SessionFactory sessionFactory)
-
-
Method Details
-
findSafeContentWithHistoryOlderThan
public List<Long> findSafeContentWithHistoryOlderThan(int synchronyThresholdHours, int draftThresholdHours, int limit) Description copied from interface:SynchronyEvictionDaoGet at most content ids from synchrony tables, for each all events are older than hours from now. Also, check that last modification day of the draft is at least . This is important to ensure that nobody has the editor open with this content right now.- Specified by:
findSafeContentWithHistoryOlderThanin interfaceSynchronyEvictionDao
-
findContentWithAnyEventOlderThan
Description copied from interface:SynchronyEvictionDaoGet at most content ids from synchrony events table, for each at least one event is older than hours from now.- Specified by:
findContentWithAnyEventOlderThanin interfaceSynchronyEvictionDao
-
findContentWithAnySnapshotOlderThan
Description copied from interface:SynchronyEvictionDaoGet at most content ids from synchrony snapshot table, for each at least one event is older than hours from now.- Specified by:
findContentWithAnySnapshotOlderThanin interfaceSynchronyEvictionDao
-
removeAllSynchronyDataFor
Description copied from interface:SynchronyEvictionDaoRemove all synchrony data matching- Specified by:
removeAllSynchronyDataForin interfaceSynchronyEvictionDao- Returns:
- actual number of rows removed from the DB
-
getEventsCount
- Specified by:
getEventsCountin interfaceSynchronyEvictionDao- Returns:
- if 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
- Specified by:
getSnapshotsCountin interfaceSynchronyEvictionDao- Returns:
- if 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
- Specified by:
removeApplicationIdsin interfaceSynchronyEvictionDao
-
removeContentProperties
public void removeContentProperties() throws jakarta.persistence.PersistenceException- Specified by:
removeContentPropertiesin interfaceSynchronyEvictionDao- Throws:
jakarta.persistence.PersistenceException
-