Package com.atlassian.jira.index.request
Class DefaultReindexRequestService
java.lang.Object
com.atlassian.jira.index.request.DefaultReindexRequestService
- All Implemented Interfaces:
ReindexRequestService
- Since:
- 6.4
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultReindexRequestService(ReindexRequestManager reindexRequestManager, PermissionManager permissionManager, JiraAuthenticationContext jiraAuthenticationContext) -
Method Summary
Modifier and TypeMethodDescriptiongetReindexProgress(long requestId) Reads progress of a reindex request.getReindexProgress(Set<Long> requestIds) Reads progress of multiple reindex requests.booleanprocessRequests(Set<ReindexRequestType> reindexRequestTypes, boolean runInBackground) Processes any outstanding reindex requests asynchronously.processRequestsAndWait(Set<ReindexRequestType> reindexRequestTypes, boolean runInBackground) Processes any outstanding reindex requests and waits for them to finish.requestReindex(ReindexRequestType type, Set<AffectedIndex> affectedIndexes, Set<SharedEntityType> entityTypes) Requests a reindex, adding a reindex request to the queue.
-
Constructor Details
-
DefaultReindexRequestService
public DefaultReindexRequestService(ReindexRequestManager reindexRequestManager, PermissionManager permissionManager, JiraAuthenticationContext jiraAuthenticationContext)
-
-
Method Details
-
processRequests
@Nonnull public Set<ReindexRequest> processRequests(Set<ReindexRequestType> reindexRequestTypes, boolean runInBackground) throws PermissionException Description copied from interface:ReindexRequestServiceProcesses any outstanding reindex requests asynchronously.- Specified by:
processRequestsin interfaceReindexRequestService- Parameters:
reindexRequestTypes- The request types to process.- Returns:
- the reindex requests that are being processed.
- Throws:
PermissionException
-
processRequestsAndWait
@Nonnull public Set<ReindexRequest> processRequestsAndWait(Set<ReindexRequestType> reindexRequestTypes, boolean runInBackground) throws PermissionException Description copied from interface:ReindexRequestServiceProcesses any outstanding reindex requests and waits for them to finish.- Specified by:
processRequestsAndWaitin interfaceReindexRequestService- Parameters:
reindexRequestTypes- The request types to process.- Returns:
- the reindex requests that were processed.
- Throws:
PermissionException
-
requestReindex
@Nonnull public ReindexRequest requestReindex(@Nonnull ReindexRequestType type, @Nonnull Set<AffectedIndex> affectedIndexes, @Nonnull Set<SharedEntityType> entityTypes) Description copied from interface:ReindexRequestServiceRequests a reindex, adding a reindex request to the queue. There is no guarantee that this request will be performed immediately.- Specified by:
requestReindexin interfaceReindexRequestService- Parameters:
type- whether reindex is immediate or delayed.affectedIndexes- the indexes to regenerate.entityTypes- the entity types whose indexes are to be regenerated.- Returns:
- the request that was created.
-
getReindexProgress
Description copied from interface:ReindexRequestServiceReads progress of a reindex request.- Specified by:
getReindexProgressin interfaceReindexRequestService- Parameters:
requestId- the ID of the reindex request.- Returns:
- reindex progress, or
nullif no request with the specified ID exists.
-
getReindexProgress
Description copied from interface:ReindexRequestServiceReads progress of multiple reindex requests.- Specified by:
getReindexProgressin interfaceReindexRequestService- Parameters:
requestIds- a set of reindex request IDs.- Returns:
- the reindex request progress. Any reindex request specified in
requestIdsthat was not found will not have a corresponding element in the return set.
-
isReindexRequested
public boolean isReindexRequested()- Specified by:
isReindexRequestedin interfaceReindexRequestService
-