|
Regain 2.1.0-STABLE API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.regain.ui.desktop.IndexUpdateManager
public class IndexUpdateManager
Handles automatic updating of index.
Field Summary | |
---|---|
private static long |
MAX_CRAWLER_WAIT_MILLIS
|
private Thread |
mCheckThread
The check thread. |
private Crawler |
mCrawler
The crawler. |
private static org.apache.log4j.Logger |
mLog
The logger for this class |
private static IndexUpdateManager |
mSingleton
The singleton. |
private boolean |
welcomePageShown
|
Fields inherited from interface net.sf.regain.ui.desktop.DesktopConstants |
---|
AUTH_PROPS_FILE, CONFIG_DIR, CRAWLER_CONFIG_FILE, DEFAULT_CONFIG_DIR, DEFAULT_CRAWLER_CONFIG_FILE, DEFAULT_DESKTOP_CONFIG_FILE, DEFAULT_INTERVAL, DEFAULT_PORT, DESKTOP_CONFIG_FILE, INDEX_DIR, LASTUPDATE_FILE, LOG_DIR, NEEDSUPDATE_FILE, TAGLIB_DIR |
Constructor Summary | |
---|---|
IndexUpdateManager()
|
Method Summary | |
---|---|
protected void |
checkThreadRun()
The run method of the thread that checks whether an index update is nessesary. |
private void |
checkUpdate()
Executes an index update if nessesary. |
Crawler |
getCurrentCrawler()
Gets the crawler that processes the current index update. |
static IndexUpdateManager |
getInstance()
Gets the Singleton. |
private boolean |
indexNeedsUpdate()
Gets the timestamp of the last index update. |
void |
init()
Initializes the IndexUpdateManager. |
private void |
saveIndexLastUpdate()
Saves the current time as the last index update. |
void |
setShouldPause(boolean shouldPause)
Sets whether the crawler should pause. |
void |
startIndexUpdate()
Starts an index update. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final long MAX_CRAWLER_WAIT_MILLIS
private static org.apache.log4j.Logger mLog
private static volatile IndexUpdateManager mSingleton
private Thread mCheckThread
private volatile Crawler mCrawler
null
if there is currently no index update running.
private volatile boolean welcomePageShown
Constructor Detail |
---|
public IndexUpdateManager()
Method Detail |
---|
public static IndexUpdateManager getInstance()
public void init()
public Crawler getCurrentCrawler()
null
if there is currently no index update running.public void startIndexUpdate() throws RegainException
RegainException
- If starting the index update failed.public void setShouldPause(boolean shouldPause)
shouldPause
- Whether the crawler should pause.protected void checkThreadRun()
private void checkUpdate() throws RegainException
RegainException
- If updating the index failed.private boolean indexNeedsUpdate() throws RegainException
RegainException
- If getting the timestamp failed.private void saveIndexLastUpdate()
|
Regain 2.1.0-STABLE API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |