Package com.atlassian.confluence.internal.api.impl.service.incrementalsync.contentmanagement.commands
Class ContentCreateCommand
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<ContentEvent>
com.atlassian.confluence.internal.api.impl.service.incrementalsync.contentmanagement.commands.ContentCreateCommand
- All Implemented Interfaces:
Command<ContentEvent,,ContentManagementIncSyncModel> CommandCreator<ContentEvent,ContentManagementIncSyncModel>
A command which handles common space content create events (PageCreateEvent, BlogPostCreateEvent, CommentCreateEvent)
- Since:
- 9.3.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final com.fasterxml.jackson.databind.ObjectMapperFields inherited from class com.atlassian.confluence.internal.api.impl.service.incrementalsync.contentmanagement.commands.ContentManagementMultiEventsCommand
commandSupportFields inherited from class com.atlassian.confluence.internal.api.impl.service.incrementalsync.MultiEventsCommand
logger, supportedEventEntryTypesMap -
Constructor Summary
ConstructorsConstructorDescriptionContentCreateCommand(ContentCommandSupport commandSupport, ContentService contentService) -
Method Summary
Modifier and TypeMethodDescriptionprotected List<JournalMessage>createMessages(ContentEvent event) Creates a list ofJournalMessageinstances to store in the database.protected Map<Class<? extends ContentEvent>,ContentJournalEntryTypes> Provide a map of all supported eventsnewCommand(JournalEntry journalEntry) Create new command from a journal entry.newCommand(ContentEvent event) Create new command from an eventprocessJournalEntries(Collection<JournalEntry> journalEntries) DeserializeJournalEntryto JSON representable objectMethods inherited from class com.atlassian.confluence.internal.api.impl.service.incrementalsync.contentmanagement.commands.ContentManagementMultiEventsCommand
buildContentWithDirectAncestor, getEntryTypeForEvent, newCommand, processEvent, withRelatedContentMessages
-
Field Details
-
objectMapper
protected final com.fasterxml.jackson.databind.ObjectMapper objectMapper
-
-
Constructor Details
-
ContentCreateCommand
-
-
Method Details
-
getSupportedEventEntryTypesMap
protected Map<Class<? extends ContentEvent>,ContentJournalEntryTypes> getSupportedEventEntryTypesMap()Description copied from class:MultiEventsCommandProvide a map of all supported events- Specified by:
getSupportedEventEntryTypesMapin classMultiEventsCommand<ContentEvent,ContentManagementIncSyncModel, ContentJournalEntryTypes> - Returns:
-
createMessages
Description copied from class:ContentManagementMultiEventsCommandCreates 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.- Specified by:
createMessagesin classContentManagementMultiEventsCommand<ContentEvent>- Parameters:
event- the event to process- Returns:
- a list of
JournalMessageinstances, or an empty list if no messages should be stored
-
processJournalEntries
public Collection<ContentManagementIncSyncModel> processJournalEntries(Collection<JournalEntry> journalEntries) Description copied from interface:CommandDeserializeJournalEntryto JSON representable object- Returns:
-
newCommand
Description copied from interface:CommandCreatorCreate new command from an event- Returns:
-
newCommand
public Optional<Command<ContentEvent,ContentManagementIncSyncModel>> newCommand(JournalEntry journalEntry) Description copied from interface:CommandCreatorCreate new command from a journal entry. Concrete class should only return newCommandif the journalEntry is suitable for thatCommand- Returns:
-