Interface ContentReconciliationManager

  • All Known Implementing Classes:
    DefaultContentReconciliationManager

    public interface ContentReconciliationManager
    Responsible for triggering and managing content reconciliation for different save operations.
    Since:
    7.14.0
    • Method Detail

      • handleContentUpdateBeforeSave

        void handleContentUpdateBeforeSave​(@NonNull ContentEntityObject content,
                                           @Nullable SaveContext saveContext)
        Prepares Synchrony flags for reconciliationIfNeeded. This should be called just before saving Content.
        Parameters:
        content - the content needs to be updated
        saveContext - the current save context
      • handleEditorOnlyContentUpdateBeforeSave

        void handleEditorOnlyContentUpdateBeforeSave​(@NonNull ContentEntityObject content,
                                                     @Nullable SaveContext saveContext)
        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.
        Parameters:
        content - the content needs to be updated
        saveContext - the current save context
      • handleContentUpdateAfterSave

        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.
        Parameters:
        content - the content has just been updated
        saveContext - the current save context
        lastUpdateDate - the last updated date of updated content before content being updated
      • handleEditorOnlyContentUpdateAfterSave

        void handleEditorOnlyContentUpdateAfterSave​(@NonNull ContentEntityObject content,
                                                    @Nullable SaveContext saveContext,
                                                    @NonNull Optional<Date> lastUpdateDate)
        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.
        Parameters:
        content - the content has just been updated
        saveContext - the current save context
        lastUpdateDate - the last updated date of updated content before content being updated
      • reconcileIfNeeded

        void reconcileIfNeeded​(@NonNull ContentEntityObject content,
                               @Nullable SaveContext saveContext)
        This method triggers SynchronyRecoveryEvent 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 to PageUpdateTrigger.LINK_REFACTORING
        Parameters:
        content - content to be recovered
        saveContext - context of operation
      • isReconciled

        boolean isReconciled​(@NonNull ContentEntityObject content)
        Parameters:
        content - content to be checked for reconciliation
        Returns:
        true if sync-rev-source is set to appropriate values in content's properties.
      • reconcileDraft

        void reconcileDraft​(@NonNull SpaceContentEntityObject pageEntity,
                            @NonNull SpaceContentEntityObject draftEntity)
        This method triggers SynchronyRecoveryEvent if collab editing is turned on and data recovery is needed for a draft.
        Parameters:
        pageEntity - Page whose draft reconciliation is needed
        draftEntity - Draft to be reconciled
      • markDraftSynchronised

        void markDraftSynchronised​(@NonNull SpaceContentEntityObject draftEntity)
        Marks Synchrony Revision Source to synchrony.
        Parameters:
        draftEntity - Draft to be reconciled