Class WatcherIndexer
java.lang.Object
com.atlassian.jira.search.issue.index.indexers.impl.VisibilityBaseFieldIndexer
com.atlassian.jira.search.issue.index.indexers.impl.WatcherIndexer
- All Implemented Interfaces:
FieldIndexer
Indexes the user keys of the users that are watching issues.
- Since:
- 10.4
-
Field Summary
Fields inherited from class com.atlassian.jira.search.issue.index.indexers.impl.VisibilityBaseFieldIndexer
fieldVisibilityManagerFields inherited from interface com.atlassian.jira.search.issue.index.indexers.FieldIndexer
LABELS_NO_VALUE_INDEX_VALUE, NO_VALUE_INDEX_VALUE -
Constructor Summary
ConstructorsConstructorDescriptionWatcherIndexer(FieldVisibilityManager fieldVisibilityManager, IssueWatcherAccessor watcherAccessor) -
Method Summary
Modifier and TypeMethodDescriptionDeclares the fields to be added to the index schemagetId()protected voidindexVisibleFields(FieldValueCollector collector, Issue issue, CustomFieldPrefetchedData prefetchedData) booleanisFieldVisibleAndInScope(Issue issue) This method is used to determine if the indexer is relevant for the provided issue.booleanUsed to declare how the indexer handles nulls.Methods inherited from class com.atlassian.jira.search.issue.index.indexers.impl.VisibilityBaseFieldIndexer
indexFields, indexFieldsWithVisibility
-
Constructor Details
-
WatcherIndexer
public WatcherIndexer(FieldVisibilityManager fieldVisibilityManager, IssueWatcherAccessor watcherAccessor)
-
-
Method Details
-
getId
- Returns:
- the String representation of the field id that this indexer is indexing, this must be unique for each independent FieldIndexer. If the Indexer does not represent a System or Custom field in Jira this should still return a unique string that describes the indexer.
-
getFields
Description copied from interface:FieldIndexerDeclares the fields to be added to the index schema -
isFieldVisibleAndInScope
Description copied from interface:FieldIndexerThis method is used to determine if the indexer is relevant for the provided issue. This method must check the fields visibility, in relation to the field configuration scheme, must check any global flags that would enable or disable a field (such as enable votes flag), and must check, if the field is a custom field, if the custom field is relevant for this issue.All these checks should take into account the
IssueContextas defined by the passed in issue.The result of this method is used to determine the correct values that should be returned when performing an empty search.
- Specified by:
isFieldVisibleAndInScopein interfaceFieldIndexer- Overrides:
isFieldVisibleAndInScopein classVisibilityBaseFieldIndexer- Parameters:
issue- that is having a document created from.- Returns:
- if true then this field is relevant for the issue, otherwise it is not.
-
indexVisibleFields
protected void indexVisibleFields(FieldValueCollector collector, Issue issue, CustomFieldPrefetchedData prefetchedData) - Specified by:
indexVisibleFieldsin classVisibilityBaseFieldIndexer
-
skipsIndexingNull
public boolean skipsIndexingNull()Description copied from interface:FieldIndexerUsed to declare how the indexer handles nulls.- Returns:
- true if the indexer doesn't do anything when the field value is null
-