Class AddChangeDocumentIndexTask
- java.lang.Object
-
- com.atlassian.confluence.internal.search.tasks.AddChangeDocumentIndexTask
-
- All Implemented Interfaces:
ConfluenceIndexTask
,ConvertibleToJournalEntry
,HandleAware
,IndexTask
@LuceneIndependent @Internal public class AddChangeDocumentIndexTask extends Object implements ConfluenceIndexTask, HandleAware
Responsible for removing and adding a change document for versioned content to the change index. Enforces a maximum of one change document per user per piece of current content.
-
-
Constructor Summary
Constructors Constructor Description AddChangeDocumentIndexTask(Searchable searchable, AtlassianDocumentBuilder<Searchable> changeDocumentBuilder)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Optional<JournalEntry>
convertToJournalEntry(JournalIdentifier journalId)
Convert to journal entry.boolean
equals(Object obj)
String
getDescription()
A description of the task that can be presented to the user via the UI.Handle
getHandle()
SearchIndex
getSearchIndex()
int
hashCode()
void
perform(SearchIndexWriter writer)
Executes this task against a document writer.String
toString()
-
-
-
Constructor Detail
-
AddChangeDocumentIndexTask
public AddChangeDocumentIndexTask(Searchable searchable, AtlassianDocumentBuilder<Searchable> changeDocumentBuilder)
- Parameters:
searchable
- aVersioned
searchablechangeDocumentBuilder
- instance ofLuceneDocumentBuilder
- Throws:
IllegalArgumentException
- if searchable is invalid.
-
-
Method Detail
-
getHandle
public Handle getHandle()
- Specified by:
getHandle
in interfaceHandleAware
- Returns:
- the handle
-
getDescription
public String getDescription()
Description copied from interface:IndexTask
A description of the task that can be presented to the user via the UI.- Specified by:
getDescription
in interfaceIndexTask
- Returns:
- an readable message.
-
perform
public void perform(SearchIndexWriter writer) throws IOException
Description copied from interface:ConfluenceIndexTask
Executes this task against a document writer.- Specified by:
perform
in interfaceConfluenceIndexTask
- Throws:
IOException
-
convertToJournalEntry
public Optional<JournalEntry> convertToJournalEntry(JournalIdentifier journalId)
Description copied from interface:ConvertibleToJournalEntry
Convert to journal entry.- Specified by:
convertToJournalEntry
in interfaceConvertibleToJournalEntry
- Parameters:
journalId
- journal identifier- Returns:
- an optional containing a journal entry or empty if this cannot be converted.
-
getSearchIndex
public SearchIndex getSearchIndex()
- Specified by:
getSearchIndex
in interfaceConfluenceIndexTask
- Returns:
- the
SearchIndex
that the task should write to
-
-