Package com.atlassian.confluence.internal.api.impl.service.incrementalsync.contentmanagement.commands
Class ContentManagementMultiEventsCommand<T>
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 Summary
FieldsFields inherited from class com.atlassian.confluence.internal.api.impl.service.incrementalsync.MultiEventsCommand
logger, supportedEventEntryTypesMap -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedContentManagementMultiEventsCommand(ContentCommandSupport commandSupport) -
Method Summary
Modifier and TypeMethodDescriptionprotected ContentbuildContentWithDirectAncestor(Content content) BuildContentwith either none or only one ancestor.protected abstract List<JournalMessage>createMessages(T event) Creates a list ofJournalMessageinstances to store in the database.protected ContentJournalEntryTypesgetEntryTypeForEvent(ContentJournalEntryTypes mappingEntryType, T event) Allow to overrideContentJournalEntryTypesbased on value of the eventnewCommand(JournalEntry journalEntry, Command<T, ContentManagementIncSyncModel> command) voidprocessEvent(T event, Object... params) Processing an event then serialize as one or manyJournalEntryprotected List<JournalMessage>withRelatedContentMessages(ContentEntityObject content, long timestamp, List<? extends ContentEntityObject> relatedContents, boolean isRestore) Create a list ofJournalMessageinstances for a content and its related contents.Methods inherited from class com.atlassian.confluence.internal.api.impl.service.incrementalsync.MultiEventsCommand
getSupportedEventEntryTypesMapMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.atlassian.confluence.internal.api.service.incrementalsync.Command
processJournalEntriesMethods inherited from interface com.atlassian.confluence.internal.api.service.incrementalsync.CommandCreator
newCommand, newCommand
-
Field Details
-
commandSupport
-
-
Constructor Details
-
ContentManagementMultiEventsCommand
-
-
Method Details
-
createMessages
Creates a list ofJournalMessageinstances to store in the database.A
Listis 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
JournalMessageinstances, or an empty list if no messages should be stored
-
processEvent
Description copied from interface:CommandProcessing an event then serialize as one or manyJournalEntry -
newCommand
public Optional<Command<T,ContentManagementIncSyncModel>> newCommand(JournalEntry journalEntry, Command<T, ContentManagementIncSyncModel> command) -
getEntryTypeForEvent
protected ContentJournalEntryTypes getEntryTypeForEvent(ContentJournalEntryTypes mappingEntryType, T event) Allow to overrideContentJournalEntryTypesbased on value of the event- Parameters:
mappingEntryType-event-- Returns:
-
buildContentWithDirectAncestor
BuildContentwith 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 ofJournalMessageinstances 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 fortimestamp- the timestamp to use for the messagesrelatedContents- the list of related contents to create messages forisRestore- whether the messages are for a restore event- Returns:
- a list of
JournalMessageinstances
-