org.archive.wayback.resourcestore.indexer
Class IndexQueueUpdater

java.lang.Object
  extended by org.archive.wayback.resourcestore.indexer.IndexQueueUpdater
All Implemented Interfaces:
Shutdownable

public class IndexQueueUpdater
extends java.lang.Object
implements Shutdownable

This class polls a ResourceFileLocationDB repeatedly, to notice new files arriving in the DB. Whenever new files are noticed, they are added to the Index Queue. It uses a local file to store the last known "mark" of the location DB.

Version:
$Date$, $Revision$
Author:
brad

Constructor Summary
IndexQueueUpdater()
           
 
Method Summary
 ResourceFileLocationDB getDb()
           
 long getInterval()
           
 java.lang.String getLastMark()
           
 IndexQueue getQueue()
           
 void init()
           
 void setDb(ResourceFileLocationDB db)
           
 void setInterval(long interval)
           
 void setLastMark(java.lang.String path)
           
 void setQueue(IndexQueue queue)
           
 void shutdown()
           
 int updateQueue()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IndexQueueUpdater

public IndexQueueUpdater()
Method Detail

init

public void init()

shutdown

public void shutdown()
Specified by:
shutdown in interface Shutdownable

updateQueue

public int updateQueue()
                throws java.io.IOException
Throws:
java.io.IOException

getDb

public ResourceFileLocationDB getDb()
Returns:
the db

setDb

public void setDb(ResourceFileLocationDB db)
Parameters:
db - the db to set

getQueue

public IndexQueue getQueue()
Returns:
the queue

setQueue

public void setQueue(IndexQueue queue)
Parameters:
queue - the queue to set

getLastMark

public java.lang.String getLastMark()
Returns:
the stateFile

setLastMark

public void setLastMark(java.lang.String path)
                 throws java.io.IOException
Parameters:
stateFile - the stateFile to set
Throws:
java.io.IOException

getInterval

public long getInterval()
Returns:
the interval

setInterval

public void setInterval(long interval)
Parameters:
interval - the interval to set


Copyright © 2005-2009 Internet Archive. All Rights Reserved.