public class IndexingManager
extends java.lang.Object
IndexingEventHandler
Interface.Constructor and Description |
---|
IndexingManager(RepositoryManager repositoryManager)
Constructor for the IndexingManager object -- refactor to be a factory...
|
Modifier and Type | Method and Description |
---|---|
void |
addIndexingEventHandler(java.lang.String itemIndexerClassName)
Adds an event handler that performs the indexing actions, sets the config directory and fires the
configure and init event.
|
protected void |
addIndexingMessage(java.lang.String msg)
Adds a feature to the IndexingMessage attribute of the IndexingManager object
|
void |
destroy()
Issue the abort indexing event to watchers and shut down the IndexingManager
|
void |
fireAbortIndexingEvent(java.lang.String itemIndexerClassName)
Fire this event to indicate to watchers that they should abort indexing at the earliest point possible.
|
void |
fireConfigureAndInitializeEvent(java.lang.String itemIndexerClassName)
Fire this event to indicate to watchers that they update their configuration settings.
|
void |
fireIndexAllCollectionsEvent(java.lang.String itemIndexerClassName)
Fire this event to indicate to watchers that they should perform indexing for ALL collections that they
know about using
CollectionIndexer.putRecord(java.lang.String, java.lang.String, java.lang.String, org.dlese.dpc.repository.indexing.CollectionIndexingSession) , CollectionIndexer.deleteRecord(java.lang.String) , CollectionIndexer.deletePreviousSessionRecords(org.dlese.dpc.repository.indexing.CollectionIndexingSession) . |
void |
fireIndexCollectionEvent(java.lang.String collectionKey,
java.lang.String itemIndexerClassName)
Fire this event to indicate to watchers that they should perform indexing for the given collection if
they are managing it using
CollectionIndexer.putRecord(java.lang.String, java.lang.String, java.lang.String, org.dlese.dpc.repository.indexing.CollectionIndexingSession) , CollectionIndexer.deleteRecord(java.lang.String) ,
CollectionIndexer.deletePreviousSessionRecords(org.dlese.dpc.repository.indexing.CollectionIndexingSession) . |
void |
fireIndexerReadyEvent(java.lang.String itemIndexerClassName)
Fire this event to indicate to watchers that the indexer is ready to accept indexing calls.
|
void |
fireUpdateCollectionsEvent(java.lang.String itemIndexerClassName)
Fire this event to indicate to watchers that they should update their collections using
CollectionIndexer.putCollection() and CollectionIndexer.deleteCollection().
|
static java.lang.String |
getDateStamp()
Return a string for the current time and date, sutiable for display in log files and output to standout:
|
int[] |
getIndexingDaysOfWeek()
Gets the days of the week the indexer will run as an array of Calendar.DAY_OF_WEEK fields, or null to
indicate all days of the week.
|
java.util.ArrayList |
getIndexingMessages()
Gets the indexing status messages.
|
java.util.Date |
getIndexingStartTime()
Gets the indexingStartTime Date, representing the time of day the indexer will run, or null if no
indexing cron is being used.
|
static java.lang.String |
getSimpleDateStamp()
Return a string for the current time and date, sutiable for display in log files and output to standout:
|
void |
setDebug(boolean db)
Sets the debug attribute of the IndexingManager object
|
void |
startIndexingTimer(java.lang.String indexingStartTime,
java.lang.String indexingDaysOfWeek)
Starts or restarts the indexing timer thread to run every 24 hours, beginning at the specified time/date.
|
public IndexingManager(RepositoryManager repositoryManager)
repositoryManager
- The RepositoryManagerpublic void addIndexingEventHandler(java.lang.String itemIndexerClassName) throws java.lang.Exception
itemIndexerClassName
- An event handler that implements the ItemIndexer Interface.java.lang.Exception
- If errorpublic void fireIndexerReadyEvent(java.lang.String itemIndexerClassName) throws java.lang.Exception
itemIndexerClassName
- An ItemIndexer to fire the event on, or null to fire the event on all
handlersjava.lang.Exception
- If errorpublic void fireUpdateCollectionsEvent(java.lang.String itemIndexerClassName) throws java.lang.Exception
itemIndexerClassName
- An ItemIndexer to fire the event on, or null to fire the event on all
handlersjava.lang.Exception
- If errorpublic void fireIndexCollectionEvent(java.lang.String collectionKey, java.lang.String itemIndexerClassName) throws java.lang.Exception
CollectionIndexer.putRecord(java.lang.String, java.lang.String, java.lang.String, org.dlese.dpc.repository.indexing.CollectionIndexingSession)
, CollectionIndexer.deleteRecord(java.lang.String)
,
CollectionIndexer.deletePreviousSessionRecords(org.dlese.dpc.repository.indexing.CollectionIndexingSession)
.collectionKey
- The collection key that should be indexeditemIndexerClassName
- An ItemIndexer to fire the event on, or null to fire the event on all
handlersjava.lang.Exception
- If errorpublic void fireIndexAllCollectionsEvent(java.lang.String itemIndexerClassName) throws java.lang.Exception
CollectionIndexer.putRecord(java.lang.String, java.lang.String, java.lang.String, org.dlese.dpc.repository.indexing.CollectionIndexingSession)
, CollectionIndexer.deleteRecord(java.lang.String)
, CollectionIndexer.deletePreviousSessionRecords(org.dlese.dpc.repository.indexing.CollectionIndexingSession)
.itemIndexerClassName
- An ItemIndexer to fire the event on, or null to fire the event on all
handlersjava.lang.Exception
- If errorpublic void fireAbortIndexingEvent(java.lang.String itemIndexerClassName) throws java.lang.Exception
itemIndexerClassName
- An ItemIndexer to fire the event on, or null to fire the event on all
handlersjava.lang.Exception
- If errorpublic void fireConfigureAndInitializeEvent(java.lang.String itemIndexerClassName) throws java.lang.Exception
itemIndexerClassName
- An ItemIndexer to fire the event on, or null to fire the event on all
handlersjava.lang.Exception
- If errorpublic void destroy() throws java.lang.Exception
java.lang.Exception
- If errorpublic java.util.ArrayList getIndexingMessages()
protected void addIndexingMessage(java.lang.String msg)
msg
- The feature to be added to the IndexingMessage attributepublic void startIndexingTimer(java.lang.String indexingStartTime, java.lang.String indexingDaysOfWeek) throws java.lang.Exception
indexingStartTime
- The time of day at which start the indexing process in H:mm (24 hour time)
format, for example 0:35 or 23:35, or null to disable auto indexing.indexingDaysOfWeek
- The days of week to run the indexer as a comma separated list of integers, for
example 1,3,5 where 1=Sunday, 2=Monday, 7=Saturday etc. or null for all days.java.lang.Exception
- If error reding the valuespublic java.util.Date getIndexingStartTime()
public int[] getIndexingDaysOfWeek()
public static java.lang.String getDateStamp()
public static java.lang.String getSimpleDateStamp()
public final void setDebug(boolean db)
db
- The new debug value