Class IndexingManager
java.lang.Object
org.dlese.dpc.repository.indexing.IndexingManager
Manages indexing processes from external sources to RepositoryManager that implement the
Interface.
invalid reference
IndexingEventHandler
- Author:
- John Weatherley
-
Constructor Summary
ConstructorsConstructorDescriptionIndexingManager(RepositoryManager repositoryManager) Constructor for the IndexingManager object -- refactor to be a factory... -
Method Summary
Modifier and TypeMethodDescriptionvoidaddIndexingEventHandler(String itemIndexerClassName) Adds an event handler that performs the indexing actions, sets the config directory and fires the configure and init event.protected voidaddIndexingMessage(String msg) Adds a feature to the IndexingMessage attribute of the IndexingManager objectvoiddestroy()Issue the abort indexing event to watchers and shut down the IndexingManagervoidfireAbortIndexingEvent(String itemIndexerClassName) Fire this event to indicate to watchers that they should abort indexing at the earliest point possible.voidfireConfigureAndInitializeEvent(String itemIndexerClassName) Fire this event to indicate to watchers that they update their configuration settings.voidfireIndexAllCollectionsEvent(String itemIndexerClassName) Fire this event to indicate to watchers that they should perform indexing for ALL collections that they know about usingCollectionIndexer.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).voidfireIndexCollectionEvent(String collectionKey, String itemIndexerClassName) Fire this event to indicate to watchers that they should perform indexing for the given collection if they are managing it usingCollectionIndexer.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).voidfireIndexerReadyEvent(String itemIndexerClassName) Fire this event to indicate to watchers that the indexer is ready to accept indexing calls.voidfireUpdateCollectionsEvent(String itemIndexerClassName) Fire this event to indicate to watchers that they should update their collections using CollectionIndexer.putCollection() and CollectionIndexer.deleteCollection().static StringReturn a string for the current time and date, sutiable for display in log files and output to standout:int[]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.Gets the indexing status messages.Gets the indexingStartTime Date, representing the time of day the indexer will run, or null if no indexing cron is being used.static StringReturn a string for the current time and date, sutiable for display in log files and output to standout:final voidsetDebug(boolean db) Sets the debug attribute of the IndexingManager objectvoidstartIndexingTimer(String indexingStartTime, String indexingDaysOfWeek) Starts or restarts the indexing timer thread to run every 24 hours, beginning at the specified time/date.
-
Constructor Details
-
IndexingManager
Constructor for the IndexingManager object -- refactor to be a factory...- Parameters:
repositoryManager- The RepositoryManager
-
-
Method Details
-
addIndexingEventHandler
Adds an event handler that performs the indexing actions, sets the config directory and fires the configure and init event.- Parameters:
itemIndexerClassName- An event handler that implements the ItemIndexer Interface.- Throws:
Exception- If error
-
fireIndexerReadyEvent
Fire this event to indicate to watchers that the indexer is ready to accept indexing calls.- Parameters:
itemIndexerClassName- An ItemIndexer to fire the event on, or null to fire the event on all handlers- Throws:
Exception- If error
-
fireUpdateCollectionsEvent
Fire this event to indicate to watchers that they should update their collections using CollectionIndexer.putCollection() and CollectionIndexer.deleteCollection().- Parameters:
itemIndexerClassName- An ItemIndexer to fire the event on, or null to fire the event on all handlers- Throws:
Exception- If error
-
fireIndexCollectionEvent
public void fireIndexCollectionEvent(String collectionKey, String itemIndexerClassName) throws Exception Fire this event to indicate to watchers that they should perform indexing for the given collection if they are managing it usingCollectionIndexer.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).- Parameters:
collectionKey- The collection key that should be indexeditemIndexerClassName- An ItemIndexer to fire the event on, or null to fire the event on all handlers- Throws:
Exception- If error
-
fireIndexAllCollectionsEvent
Fire this event to indicate to watchers that they should perform indexing for ALL collections that they know about usingCollectionIndexer.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).- Parameters:
itemIndexerClassName- An ItemIndexer to fire the event on, or null to fire the event on all handlers- Throws:
Exception- If error
-
fireAbortIndexingEvent
Fire this event to indicate to watchers that they should abort indexing at the earliest point possible.- Parameters:
itemIndexerClassName- An ItemIndexer to fire the event on, or null to fire the event on all handlers- Throws:
Exception- If error
-
fireConfigureAndInitializeEvent
Fire this event to indicate to watchers that they update their configuration settings. This is called automatically once at startup.- Parameters:
itemIndexerClassName- An ItemIndexer to fire the event on, or null to fire the event on all handlers- Throws:
Exception- If error
-
destroy
Issue the abort indexing event to watchers and shut down the IndexingManager- Throws:
Exception- If error
-
getIndexingMessages
Gets the indexing status messages.- Returns:
- The indexingMessages.
-
addIndexingMessage
Adds a feature to the IndexingMessage attribute of the IndexingManager object- Parameters:
msg- The feature to be added to the IndexingMessage attribute
-
startIndexingTimer
public void startIndexingTimer(String indexingStartTime, String indexingDaysOfWeek) throws Exception Starts or restarts the indexing timer thread to run every 24 hours, beginning at the specified time/date. Use this method to schedule the timer to run as a nightly cron, beginning at the time you wish the indexer to run.- Parameters:
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.- Throws:
Exception- If error reding the values
-
getIndexingStartTime
Gets the indexingStartTime Date, representing the time of day the indexer will run, or null if no indexing cron is being used.- Returns:
- The indexingStartTime or null
-
getIndexingDaysOfWeek
public 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.- Returns:
- The indexingDaysOfWeek or null for all days
-
getDateStamp
Return a string for the current time and date, sutiable for display in log files and output to standout:- Returns:
- The dateStamp value
-
getSimpleDateStamp
Return a string for the current time and date, sutiable for display in log files and output to standout:- Returns:
- The dateStamp value
-
setDebug
public final void setDebug(boolean db) Sets the debug attribute of the IndexingManager object- Parameters:
db- The new debug value
-