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
&DefaultAttachmentManager
with 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 void
handleContentUpdateAfterSave(@NonNull ContentEntityObject content, @Nullable SaveContext saveContext, @NonNull Optional<Date> lastUpdateDate)
This part of the content update must run after the content has an ID.void
handleContentUpdateBeforeSave(@NonNull ContentEntityObject content, @Nullable SaveContext saveContext)
Prepares Synchrony flags for reconciliationIfNeeded.void
handleEditorOnlyContentUpdateAfterSave(@NonNull ContentEntityObject content, @Nullable SaveContext saveContext, @NonNull Optional<Date> lastUpdateDate)
Used for Editor only changes where-in storage doesn't change.void
handleEditorOnlyContentUpdateBeforeSave(@NonNull ContentEntityObject content, @Nullable SaveContext saveContext)
Used for Editor only changes where-in storage doesn't change.boolean
isReconciled(@NonNull ContentEntityObject ceo)
void
markDraftSynchronised(@NonNull SpaceContentEntityObject draft)
Marks Synchrony Revision Source to synchrony.void
reconcileDraft(@NonNull SpaceContentEntityObject page, @NonNull SpaceContentEntityObject draft)
This method triggersSynchronyRecoveryEvent
if collab editing is turned on and data recovery is needed for a draft.void
reconcileIfNeeded(@NonNull ContentEntityObject content, @Nullable SaveContext saveContext)
This method triggersSynchronyRecoveryEvent
if 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:ContentReconciliationManager
Prepares Synchrony flags for reconciliationIfNeeded. This should be called just before saving Content.- Specified by:
handleContentUpdateBeforeSave
in 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:ContentReconciliationManager
Used 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:
handleEditorOnlyContentUpdateBeforeSave
in 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:ContentReconciliationManager
This part of the content update must run after the content has an ID.- Specified by:
handleContentUpdateAfterSave
in 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:ContentReconciliationManager
Used 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:
handleEditorOnlyContentUpdateAfterSave
in 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:ContentReconciliationManager
This method triggersSynchronyRecoveryEvent
if collab editing is turned on and data recovery is needed. Recovery is needed when:content
is 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
saveContext
is not equal toPageUpdateTrigger.LINK_REFACTORING
- Specified by:
reconcileIfNeeded
in interfaceContentReconciliationManager
- Parameters:
content
- content to be recoveredsaveContext
- context of operation
-
isReconciled
public boolean isReconciled(@NonNull ContentEntityObject ceo)
- Specified by:
isReconciled
in 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:ContentReconciliationManager
This method triggersSynchronyRecoveryEvent
if collab editing is turned on and data recovery is needed for a draft.- Specified by:
reconcileDraft
in interfaceContentReconciliationManager
- Parameters:
page
- Page whose draft reconciliation is neededdraft
- Draft to be reconciled
-
markDraftSynchronised
public void markDraftSynchronised(@NonNull SpaceContentEntityObject draft)
Description copied from interface:ContentReconciliationManager
Marks Synchrony Revision Source to synchrony.- Specified by:
markDraftSynchronised
in interfaceContentReconciliationManager
- Parameters:
draft
- Draft to be reconciled
-
-