Package com.atlassian.confluence.internal.api.impl.service.incrementalsync.contentmanagement.commands
Class SpaceEventsCommand
java.lang.Object
com.atlassian.confluence.internal.api.impl.service.incrementalsync.MultiEventsCommand<SpaceEvent,ContentManagementIncSyncModel,ContentJournalEntryTypes>
com.atlassian.confluence.internal.api.impl.service.incrementalsync.contentmanagement.commands.ContentManagementMultiEventsCommand<SpaceEvent>
com.atlassian.confluence.internal.api.impl.service.incrementalsync.contentmanagement.commands.SpaceEventsCommand
- All Implemented Interfaces:
Command<SpaceEvent,
,ContentManagementIncSyncModel> CommandCreator<SpaceEvent,
ContentManagementIncSyncModel>
A command which handles common Space Events (Created, Archived, Unarchived)
- Since:
- 9.2.6
-
Field Summary
Fields inherited from class com.atlassian.confluence.internal.api.impl.service.incrementalsync.contentmanagement.commands.ContentManagementMultiEventsCommand
commandSupport
Fields inherited from class com.atlassian.confluence.internal.api.impl.service.incrementalsync.MultiEventsCommand
logger, supportedEventEntryTypesMap
-
Constructor Summary
ConstructorsConstructorDescriptionSpaceEventsCommand
(ContentCommandSupport commandSupport, SpaceService spaceService, SpaceFilteringService spaceFilteringService) -
Method Summary
Modifier and TypeMethodDescriptionprotected List
<JournalMessage> createMessages
(SpaceEvent event) Creates a list ofJournalMessage
instances to store in the database.protected Map
<Class<? extends SpaceEvent>, ContentJournalEntryTypes> Provide a map of all supported eventsnewCommand
(JournalEntry journalEntry) Create new command from a journal entry.newCommand
(SpaceEvent event) Create new command from an eventprocessJournalEntries
(Collection<JournalEntry> journalEntries) DeserializeJournalEntry
to JSON representable objectReturns predicate, that indicates if the given event should be processed or not.Methods inherited from class com.atlassian.confluence.internal.api.impl.service.incrementalsync.contentmanagement.commands.ContentManagementMultiEventsCommand
buildContentWithDirectAncestor, getEntryTypeForEvent, newCommand, processEvent, withRelatedContentMessages
-
Constructor Details
-
SpaceEventsCommand
public SpaceEventsCommand(ContentCommandSupport commandSupport, SpaceService spaceService, SpaceFilteringService spaceFilteringService)
-
-
Method Details
-
getSupportedEventEntryTypesMap
protected Map<Class<? extends SpaceEvent>,ContentJournalEntryTypes> getSupportedEventEntryTypesMap()Description copied from class:MultiEventsCommand
Provide a map of all supported events- Specified by:
getSupportedEventEntryTypesMap
in classMultiEventsCommand<SpaceEvent,
ContentManagementIncSyncModel, ContentJournalEntryTypes> - Returns:
-
createMessages
Description copied from class:ContentManagementMultiEventsCommand
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.- Specified by:
createMessages
in classContentManagementMultiEventsCommand<SpaceEvent>
- Parameters:
event
- the event to process- Returns:
- a list of
JournalMessage
instances, or an empty list if no messages should be stored
-
processJournalEntries
public Collection<ContentManagementIncSyncModel> processJournalEntries(Collection<JournalEntry> journalEntries) Description copied from interface:Command
DeserializeJournalEntry
to JSON representable object- Parameters:
journalEntries
-- Returns:
-
shouldProcess
Description copied from interface:CommandCreator
Returns predicate, that indicates if the given event should be processed or not. If event should not be processed it is expected that command creator do not create command for such event and returns empty optional.- Returns:
- predicate that indicates if particular event has to be processed.
-
newCommand
Description copied from interface:CommandCreator
Create new command from an event- Parameters:
event
-- Returns:
-
newCommand
public Optional<Command<SpaceEvent,ContentManagementIncSyncModel>> newCommand(JournalEntry journalEntry) Description copied from interface:CommandCreator
Create new command from a journal entry. Concrete class should only return newCommand
if the journalEntry is suitable for thatCommand
- Parameters:
journalEntry
-- Returns:
-