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
ConstructorsModifierConstructorDescriptionprotected
ContentManagementMultiEventsCommand
(ContentCommandSupport commandSupport) -
Method Summary
Modifier and TypeMethodDescriptionprotected Content
buildContentWithDirectAncestor
(Content content) BuildContent
with either none or only one ancestor.protected abstract List<JournalMessage>
createMessages
(T event) Creates a list ofJournalMessage
instances to store in the database.protected ContentJournalEntryTypes
getEntryTypeForEvent
(ContentJournalEntryTypes mappingEntryType, T event) Allow to overrideContentJournalEntryTypes
based on value of the eventnewCommand
(JournalEntry journalEntry, Command<T, ContentManagementIncSyncModel> command) void
processEvent
(T event, Object... params) Processing an event then serialize as one or manyJournalEntry
protected List<JournalMessage>
withRelatedContentMessages
(ContentEntityObject content, long timestamp, List<? extends ContentEntityObject> relatedContents, boolean isRestore) Create a list ofJournalMessage
instances for a content and its related contents.Methods inherited from class com.atlassian.confluence.internal.api.impl.service.incrementalsync.MultiEventsCommand
getSupportedEventEntryTypesMap
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.atlassian.confluence.internal.api.service.incrementalsync.Command
processJournalEntries
Methods 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 ofJournalMessage
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
Description copied from interface:Command
Processing 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 overrideContentJournalEntryTypes
based on value of the event- Parameters:
mappingEntryType
-event
-- Returns:
-
buildContentWithDirectAncestor
BuildContent
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 ofJournalMessage
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 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
JournalMessage
instances
-