java.lang.Object
com.atlassian.confluence.internal.api.impl.service.incrementalsync.MultiEventsCommand<T,ContentManagementIncSyncModel,ContentJournalEntryTypes>
com.atlassian.confluence.internal.api.impl.service.incrementalsync.contentmanagement.commands.ContentManagementMultiEventsCommand<T>
All Implemented Interfaces:
Command<T,ContentManagementIncSyncModel>, CommandCreator<T,ContentManagementIncSyncModel>
Direct Known Subclasses:
ContentCreateCommand, ContentPermissionChangeCommand, ContentRemoveCommand, ContentUpdateCommand, SpaceEventsCommand, SpacePermissionChangeCommand

public abstract class ContentManagementMultiEventsCommand<T> extends MultiEventsCommand<T,ContentManagementIncSyncModel,ContentJournalEntryTypes>
Based multi command class for Content Management
Since:
9.3.0
  • Field Details

  • Constructor Details

    • ContentManagementMultiEventsCommand

      protected ContentManagementMultiEventsCommand(ContentCommandSupport commandSupport)
  • Method Details

    • createMessages

      protected abstract List<JournalMessage> createMessages(T event)
      Creates a list of JournalMessage instances to store in the database.

      A List is used to preserve the order of messages as child content must be processed before parent content.

      Parameters:
      event - the event to process
      Returns:
      a list of JournalMessage instances, or an empty list if no messages should be stored
    • processEvent

      public void processEvent(T event, Object... params)
      Description copied from interface: Command
      Processing an event then serialize as one or many JournalEntry
    • newCommand

    • getEntryTypeForEvent

      protected ContentJournalEntryTypes getEntryTypeForEvent(ContentJournalEntryTypes mappingEntryType, T event)
      Allow to override ContentJournalEntryTypes based on value of the event
      Parameters:
      mappingEntryType -
      event -
      Returns:
    • buildContentWithDirectAncestor

      protected Content buildContentWithDirectAncestor(Content content)
      Build Content with either none or only one ancestor. For comments, no ancestors is set. For pages only one ancestor (immediate parent) is set. Blog posts are not supported, and should not reach here, since they do not have ancestors.
      Parameters:
      content -
      Returns:
      a new instance of Content
    • withRelatedContentMessages

      protected List<JournalMessage> withRelatedContentMessages(ContentEntityObject content, long timestamp, List<? extends ContentEntityObject> relatedContents, boolean isRestore)
      Create a list of JournalMessage instances for a content and its related contents.

      The list will contain a message for each related content and a message for the content itself.

      Parameters:
      content - the content to create messages for
      timestamp - the timestamp to use for the messages
      relatedContents - the list of related contents to create messages for
      isRestore - whether the messages are for a restore event
      Returns:
      a list of JournalMessage instances