Class SearchTokenTracker
java.lang.Object
com.atlassian.confluence.plugins.opensearch.SearchTokenTracker
Tracks search tokens in memory, and associates them with the corresponding OpenSearch PIT (Point in Time) id.
The implementation replicates the existing Lucene implementation:
MultiReaderBasedConnection
- Since:
- 9.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateToken
(ISearch search, @Nullable String pit) Creates a newSearchWithToken
for the provided search and PIT@Nullable String
getPitId
(SearchWithToken searchWithToken) Resolves the PIT id for the givenSearchWithToken
-
Constructor Details
-
SearchTokenTracker
-
-
Method Details
-
createToken
Creates a newSearchWithToken
for the provided search and PIT- Parameters:
search
-pit
- OpenSearch PIT id (optional)- Returns:
- a new
SearchWithToken
for the provided search and PIT
-
getPitId
public @Nullable String getPitId(SearchWithToken searchWithToken) throws SearchTokenExpiredException Resolves the PIT id for the givenSearchWithToken
- Parameters:
searchWithToken
-- Returns:
- the associated PIT for the token, or
null
if token is undefined i.e.SearchWithToken.TOKEN_UNDEFINED
- Throws:
SearchTokenExpiredException
- if the provided token has expired
-