Class DefaultContentReconciliationManager
- java.lang.Object
 - 
- com.atlassian.confluence.internal.content.collab.DefaultContentReconciliationManager
 
 
- 
- All Implemented Interfaces:
 ContentReconciliationManager
public class DefaultContentReconciliationManager extends Object implements ContentReconciliationManager
Responsible for triggering and managing content reconciliation for different save operations. Supposed to be used by likes ofDefaultPageManager&DefaultAttachmentManagerwith a level of reused reconciliation lifecycle. See: Collaborative editing: server side business for more information.- Since:
 - 7.14.0
 
 
- 
- 
Constructor Summary
Constructors Constructor Description DefaultContentReconciliationManager(CollaborativeEditingHelper collaborativeEditingHelper, com.atlassian.event.api.EventPublisher eventPublisher, SynchronizationManager synchronizationManager, org.springframework.transaction.PlatformTransactionManager transactionManager, Supplier<? extends ContentEntityManagerInternal> contentEntityManager) 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidhandleContentUpdateAfterSave(@NonNull ContentEntityObject content, @Nullable SaveContext saveContext, @NonNull Optional<Date> lastUpdateDate)This part of the content update must run after the content has an ID.voidhandleContentUpdateBeforeSave(@NonNull ContentEntityObject content, @Nullable SaveContext saveContext)Prepares Synchrony flags for reconciliationIfNeeded.voidhandleEditorOnlyContentUpdateAfterSave(@NonNull ContentEntityObject content, @Nullable SaveContext saveContext, @NonNull Optional<Date> lastUpdateDate)Used for Editor only changes where-in storage doesn't change.voidhandleEditorOnlyContentUpdateBeforeSave(@NonNull ContentEntityObject content, @Nullable SaveContext saveContext)Used for Editor only changes where-in storage doesn't change.booleanisReconciled(@NonNull ContentEntityObject ceo)voidmarkDraftSynchronised(@NonNull SpaceContentEntityObject draft)Marks Synchrony Revision Source to synchrony.voidreconcileDraft(@NonNull SpaceContentEntityObject page, @NonNull SpaceContentEntityObject draft)This method triggersSynchronyRecoveryEventif collab editing is turned on and data recovery is needed for a draft.voidreconcileIfNeeded(@NonNull ContentEntityObject content, @Nullable SaveContext saveContext)This method triggersSynchronyRecoveryEventif collab editing is turned on and data recovery is needed. 
 - 
 
- 
- 
Constructor Detail
- 
DefaultContentReconciliationManager
public DefaultContentReconciliationManager(CollaborativeEditingHelper collaborativeEditingHelper, com.atlassian.event.api.EventPublisher eventPublisher, SynchronizationManager synchronizationManager, org.springframework.transaction.PlatformTransactionManager transactionManager, Supplier<? extends ContentEntityManagerInternal> contentEntityManager)
 
 - 
 
- 
Method Detail
- 
handleContentUpdateBeforeSave
public void handleContentUpdateBeforeSave(@NonNull ContentEntityObject content, @Nullable SaveContext saveContext)
Description copied from interface:ContentReconciliationManagerPrepares Synchrony flags for reconciliationIfNeeded. This should be called just before saving Content.- Specified by:
 handleContentUpdateBeforeSavein interfaceContentReconciliationManager- Parameters:
 content- the content needs to be updatedsaveContext- the current save context
 
- 
handleEditorOnlyContentUpdateBeforeSave
public void handleEditorOnlyContentUpdateBeforeSave(@NonNull ContentEntityObject content, @Nullable SaveContext saveContext)
Description copied from interface:ContentReconciliationManagerUsed for Editor only changes where-in storage doesn't change. Ex: AttachmentCreate Prepares Synchrony flags for reconciliationIfNeeded. This should be called just before saving Content.- Specified by:
 handleEditorOnlyContentUpdateBeforeSavein interfaceContentReconciliationManager- Parameters:
 content- the content needs to be updatedsaveContext- the current save context
 
- 
handleContentUpdateAfterSave
public void handleContentUpdateAfterSave(@NonNull ContentEntityObject content, @Nullable SaveContext saveContext, @NonNull Optional<Date> lastUpdateDate)
Description copied from interface:ContentReconciliationManagerThis part of the content update must run after the content has an ID.- Specified by:
 handleContentUpdateAfterSavein interfaceContentReconciliationManager- Parameters:
 content- the content has just been updatedsaveContext- the current save contextlastUpdateDate- the last updated date of updated content before content being updated
 
- 
handleEditorOnlyContentUpdateAfterSave
public void handleEditorOnlyContentUpdateAfterSave(@NonNull ContentEntityObject content, @Nullable SaveContext saveContext, @NonNull Optional<Date> lastUpdateDate)
Description copied from interface:ContentReconciliationManagerUsed for Editor only changes where-in storage doesn't change. Ex: AttachmentCreate This part of the content update must run after the content has an ID.- Specified by:
 handleEditorOnlyContentUpdateAfterSavein interfaceContentReconciliationManager- Parameters:
 content- the content has just been updatedsaveContext- the current save contextlastUpdateDate- the last updated date of updated content before content being updated
 
- 
reconcileIfNeeded
public void reconcileIfNeeded(@NonNull ContentEntityObject content, @Nullable SaveContext saveContext)
Description copied from interface:ContentReconciliationManagerThis method triggersSynchronyRecoveryEventif collab editing is turned on and data recovery is needed. Recovery is needed when:contentis the latest version of the page or blog post AND- content is not reconciled (
'sync-rev-source'content property is not empty and not equals to neither'synchrony'or'synchrony-ack') AND - update trigger of 
saveContextis not equal toPageUpdateTrigger.LINK_REFACTORING 
- Specified by:
 reconcileIfNeededin interfaceContentReconciliationManager- Parameters:
 content- content to be recoveredsaveContext- context of operation
 
- 
isReconciled
public boolean isReconciled(@NonNull ContentEntityObject ceo)
- Specified by:
 isReconciledin interfaceContentReconciliationManager- Parameters:
 ceo- content to be checked for reconciliation- Returns:
 - true if sync-rev-source is set to appropriate values in content's properties.
 
 
- 
reconcileDraft
public void reconcileDraft(@NonNull SpaceContentEntityObject page, @NonNull SpaceContentEntityObject draft)
Description copied from interface:ContentReconciliationManagerThis method triggersSynchronyRecoveryEventif collab editing is turned on and data recovery is needed for a draft.- Specified by:
 reconcileDraftin interfaceContentReconciliationManager- Parameters:
 page- Page whose draft reconciliation is neededdraft- Draft to be reconciled
 
- 
markDraftSynchronised
public void markDraftSynchronised(@NonNull SpaceContentEntityObject draft)
Description copied from interface:ContentReconciliationManagerMarks Synchrony Revision Source to synchrony.- Specified by:
 markDraftSynchronisedin interfaceContentReconciliationManager- Parameters:
 draft- Draft to be reconciled
 
 - 
 
 -