com.atlassian.confluence.search.didyoumean
Class BuildIndexTaskManager

java.lang.Object
  extended by com.atlassian.confluence.search.didyoumean.BuildIndexTaskManager

public class BuildIndexTaskManager
extends Object

Class that manages a single did-you-mean index build task. Only one of these tasks can run at any one time. All interactions with a task should go through this manager.


Nested Class Summary
static class BuildIndexTaskManager.IndexProgress
           
 
Constructor Summary
BuildIndexTaskManager(IndexBuilder fullIndexBuilder, I18NBeanFactory defaultI18NBeanFactory, com.atlassian.event.EventManager eventManager, SettingsManager settingsManager, org.springframework.transaction.PlatformTransactionManager transactionManager)
           
 
Method Summary
 BuildIndexTaskManager.IndexProgress getIndexProgress()
           
 String getTaskElapsedTime()
           
 int getTaskPercentageComplete()
           
 boolean isTaskInProgress()
           
 boolean isTaskReady()
           
 boolean runTask()
          Spawns a separate thread to build the did-you-mean index asynchronously.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BuildIndexTaskManager

public BuildIndexTaskManager(IndexBuilder fullIndexBuilder,
                             I18NBeanFactory defaultI18NBeanFactory,
                             com.atlassian.event.EventManager eventManager,
                             SettingsManager settingsManager,
                             org.springframework.transaction.PlatformTransactionManager transactionManager)
Method Detail

runTask

public boolean runTask()
Spawns a separate thread to build the did-you-mean index asynchronously. Checks first that a build is not currently in progress.

Returns:
true if a build of the index was successfully started, false otherwise (implying one is currently in progress).

isTaskInProgress

public boolean isTaskInProgress()

isTaskReady

public boolean isTaskReady()
Returns:
true if IndexBuilder.isReady() is true, false otherwise.

getTaskPercentageComplete

public int getTaskPercentageComplete()
Returns:
the progress (as a percentage) of the currently managed task (or 0 if no task has been assigned yet)

getTaskElapsedTime

public String getTaskElapsedTime()

getIndexProgress

public BuildIndexTaskManager.IndexProgress getIndexProgress()


Copyright © 2003-2011 Atlassian. All Rights Reserved.