Class DefaultSynchronyDataService
- java.lang.Object
-
- com.atlassian.confluence.pages.collab.impl.DefaultSynchronyDataService
-
- All Implemented Interfaces:
SynchronyDataService
public class DefaultSynchronyDataService extends Object implements SynchronyDataService
- Since:
- 7.0.0
-
-
Constructor Summary
Constructors Constructor Description DefaultSynchronyDataService(SynchronyLockManager lockManager, SynchronyEvictionDao evictionDao, SynchronyEvictionProgressTracking progressTracking, PageManager pageManager)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SynchronyRowsCount
currentSynchronyDatasetSize(Long contentId)
If the parameter {@param contentId} is not null, returns size of Synchrony history for that entity.void
dataCleanUpAfterTurningOffCollabEditing(String appId)
This method cleans up Synchrony data after turning Collaboration Editing off.void
hardRemoveHistoryOlderThan(int thresholdHours)
Remove all events from content entities, which have any data older than {@param thresholdHours}.void
removeApplicationCredentials(String applicationId)
Remove application credentials from Synchrony tablesvoid
removeHistoryFor(ContentId contentId)
This method removes Synchrony history for given content.void
softRemoveHistoryOlderThan(int thresholdHours, int contentCount)
Remove approximately {@param contentCount} content records from Synchrony history, which are older than {@param thresholdHours} and are safe for removal.
-
-
-
Constructor Detail
-
DefaultSynchronyDataService
public DefaultSynchronyDataService(SynchronyLockManager lockManager, SynchronyEvictionDao evictionDao, SynchronyEvictionProgressTracking progressTracking, PageManager pageManager)
-
-
Method Detail
-
currentSynchronyDatasetSize
public SynchronyRowsCount currentSynchronyDatasetSize(Long contentId)
Description copied from interface:SynchronyDataService
If the parameter {@param contentId} is not null, returns size of Synchrony history for that entity. If the parameter is null, returns overall Synchrony rows count for the whole instance.- Specified by:
currentSynchronyDatasetSize
in interfaceSynchronyDataService
-
softRemoveHistoryOlderThan
public void softRemoveHistoryOlderThan(int thresholdHours, int contentCount)
Description copied from interface:SynchronyDataService
Remove approximately {@param contentCount} content records from Synchrony history, which are older than {@param thresholdHours} and are safe for removal. Execution of this method should avoid any bad effect on users experience because we touch here only content which haven't been updated for {@param thresholdHours} hours. This method provides only 'best effort' guarantee for data removal. Deletion strategy depends on the implementation details of how exactly do we determine that content hasn't been touched in {@param thresholdHours} and might change. In some edge cases the method will not remove any data. If you're looking for a guaranteed way to clean synchrony history, please look atSynchronyDataService.hardRemoveHistoryOlderThan(int)
.The main purpose of this method is disk space cleanup in collab editing tables. Parameter {@param thresholdHours} allows to shift trade-off between removal efficiency (disk reclaiming) and the degree of intrusiveness.
The method is executed synchronously in the same thread. If exception is thrown somewhere in the middle, it is possible to have only a part of data removed, because the removal might happen in several transactions, but remaining data will always stay consistent (e.g. synchrony data consistent with content properties).
- Specified by:
softRemoveHistoryOlderThan
in interfaceSynchronyDataService
-
hardRemoveHistoryOlderThan
public void hardRemoveHistoryOlderThan(int thresholdHours)
Description copied from interface:SynchronyDataService
Remove all events from content entities, which have any data older than {@param thresholdHours}. Theoretically this might cause last 30 seconds of history disappear. This method is designed to be called rarely and be the last resort for GDPR compliance.The method guarantees to remove old personal data in order to be compliant with regulations. If the customer doesn't care about any regulations, it shouldn't generally call the method, instead less intrusive
SynchronyDataService.softRemoveHistoryOlderThan(int, int)
should be used.The method is executed synchronously in the same thread. If exception is thrown somewhere in the middle, it is possible to have only a part of data removed, because the removal might happen in several transactions, but remaining data will always stay consistent (e.g. synchrony data consistent with content properties).
- Specified by:
hardRemoveHistoryOlderThan
in interfaceSynchronyDataService
-
removeHistoryFor
public void removeHistoryFor(ContentId contentId)
Description copied from interface:SynchronyDataService
This method removes Synchrony history for given content. It can be used to completely remove Synchrony history and reset sync rev properties for given content. If content is not of a type ofPage
orBlogPost
,IllegalArgumentException
is thrown. IMPORTANT: please keep in mind, that this method deletes Synchrony history for provided page or blog. If Synchrony history is needed f.e. to conduct analysis of the problem, caller should fetch and save it BEFORE invocation of this method.- Specified by:
removeHistoryFor
in interfaceSynchronyDataService
- Parameters:
contentId
- id of the content, which history has to be cleaned up. Should not be null.
-
removeApplicationCredentials
public void removeApplicationCredentials(String applicationId)
Description copied from interface:SynchronyDataService
Remove application credentials from Synchrony tables- Specified by:
removeApplicationCredentials
in interfaceSynchronyDataService
- Parameters:
applicationId
- id of application to remove
-
dataCleanUpAfterTurningOffCollabEditing
public void dataCleanUpAfterTurningOffCollabEditing(String appId)
Description copied from interface:SynchronyDataService
This method cleans up Synchrony data after turning Collaboration Editing off.- Specified by:
dataCleanUpAfterTurningOffCollabEditing
in interfaceSynchronyDataService
- Parameters:
appId
- id of application to remove
-
-