Groovy Documentation

jobs
Class IndexingJob

java.lang.Object
  jobs.IndexingJob

class IndexingJob

A Quartz Scheduler job to regenerate Wikis. Scheduling is done by Bootstrap and WikiController, based on Wiki.regenerateTime


Property Summary
static String LOCK

lock

static Map beingIndexed

indicates that the items are being indexed

static boolean indexingScheduled

static Logger log

Logger

static Map requestsQueue

queue for indexing jobs.

 
Constructor Summary
IndexingJob()

 
Method Summary
static boolean addToQueue(String wikiId, String url, int cmd, String cmdDesc)

Adds a new url to queue for indexing/deletion Id of the wiki area, this url belongs to Url of the file/directory that should be indexed (one of INDEX_CMD, DELETE_CMD, or UPDATE_CMD) in the queue or being indexed.

void execute(JobExecutionContext context)

Execute an indexing job

static Map getIndexingStatus()

puts both queues, requeustsQueue and beingIndexed in a single map and returns

static boolean isBeingIndexed(String url, String wikiId)

Method returns true if the given url is being indexed.

static void scheduleIndexing()

Schedule indexing job every 5 mins

 
Methods inherited from class Object
wait, wait, wait, hashCode, getClass, equals, toString, notify, notifyAll
 

Property Detail

LOCK

static String LOCK
lock


beingIndexed

static Map beingIndexed
indicates that the items are being indexed


indexingScheduled

static boolean indexingScheduled


log

static Logger log
Logger


requestsQueue

static Map requestsQueue
queue for indexing jobs.


 
Constructor Detail

IndexingJob

IndexingJob()


 
Method Detail

addToQueue

public static boolean addToQueue(String wikiId, String url, int cmd, String cmdDesc)
Adds a new url to queue for indexing/deletion
param:
wikiId Id of the wiki area, this url belongs to
param:
url Url of the file/directory that should be indexed
param:
cmd (one of INDEX_CMD, DELETE_CMD, or UPDATE_CMD)
return:
true if the request is added to the queue. false if it is already in the queue or being indexed.


execute

void execute(JobExecutionContext context)
Execute an indexing job


getIndexingStatus

public static Map getIndexingStatus()
puts both queues, requeustsQueue and beingIndexed in a single map and returns


isBeingIndexed

public static boolean isBeingIndexed(String url, String wikiId)
Method returns true if the given url is being indexed. It is possible that the given url gets indexed as a result of some other urls submitted earlier. If this is the case and if such a previously submitted url is being indexed, the method will return true. If the supplied url is null, call to the method is interpreted as a request to check if there's anything in the given wiki area that is being indexed.


scheduleIndexing

public static void scheduleIndexing()
Schedule indexing job every 5 mins


 

Groovy Documentation