public abstract class ThreadedService extends MonitoredTask
Modifier and Type | Class and Description |
---|---|
class |
ThreadedService.SortReports
NOT YET DOCUMENTED
|
Modifier and Type | Field and Description |
---|---|
protected SimpleDataStore |
dataStore |
protected DcsDataManager |
dcsDataManager |
protected DcsSetInfo |
dcsSetInfo |
protected static boolean |
debug |
protected SimpleLuceneIndex |
index |
protected boolean |
indexOnValidation |
protected boolean |
isProcessing |
protected static int |
NUM_STATUS_MESSAGES |
protected javax.servlet.ServletContext |
servletContext |
protected SessionBean |
sessionBean |
protected java.lang.String[] |
statuses |
protected boolean |
stopProcessing |
protected boolean |
validateFiles |
Constructor and Description |
---|
ThreadedService(javax.servlet.ServletContext servletContext,
java.lang.String threadedServiceDataDir)
Constructor for the ThreadedService object
|
Modifier and Type | Method and Description |
---|---|
protected void |
addStatusMessage(java.lang.String msg)
Adds a feature to the ValidatingMessage attribute of the ThreadedService
object
|
protected void |
archiveServiceReport(Report report)
NOT YET DOCUMENTED
|
protected java.lang.String |
buildQuery(java.lang.String collection,
java.lang.String[] statuses)
Return a query string that will find records for the specified collection.
|
void |
clearServiceReport()
NOT YET DOCUMENTED
|
protected void |
clearStatusMessages()
Clear status messages
|
Report |
getArchivedReport(java.lang.String collection)
Gets the archivedReport attribute of the ThreadedService object
|
java.util.List |
getArchivedReports()
Gets the archivedReports attribute of the ThreadedService object
|
static java.lang.String |
getDateStamp()
Return a string for the current time and date, sutiable for display in log
files and output to standout:
|
protected XMLDocReader |
getDocReader(java.lang.String id)
convience method to retrieve the docReader given a record id
|
protected java.util.List |
getIdList(java.lang.String collection,
java.lang.String[] statuses)
Build a list of record ids from the results of a query for specified
collection and statuses.
|
boolean |
getIndexOnValidation()
Gets the indexOnValidation attribute of the ThreadedService object
|
boolean |
getIsProcessing()
Gets the isProcessing attribute of the ThreadedService object
|
Report |
getServiceReport()
Gets the serviceReport attribute of the ThreadedService object
|
java.lang.String |
getSessionId()
Gets the sessionId attribute of the ThreadedService object
|
static java.lang.String |
getSimpleDateStamp()
Return a string for the current time and date, sutiable for display in log
files and output to standout:
|
java.util.ArrayList |
getStatusMessages()
Gets the statusMessages attribute of the ThreadedService object
|
protected java.lang.String |
list2delimitedString(java.util.List list,
java.lang.String delimiter)
Creates a delimited string from the provided list
|
protected void |
setDcsSetInfo(DcsSetInfo setInfo)
Sets the dcsSetInfo attribute of the ThreadedService object
|
void |
setIndexOnValidation(boolean indexOnValidation)
Sets the indexOnValidation attribute of the ThreadedService object
|
void |
setServiceReport(Report report)
Sets the serviceReport attribute of the ThreadedService object
|
protected void |
setStatuses(java.lang.String[] statuses)
Sets the statuses attribute of the ThreadedService object
|
void |
setValidationEnabled(boolean validateFiles)
Sets whether or not to validate the files being indexed.
|
void |
stopProcessing()
Halts a threaded service.
|
protected void |
validate(XMLDocReader docReader,
DcsDataRecord dcsDataRecord)
NOT YET DOCUMENTED
|
protected boolean |
validationIsStale(java.io.File sourceFile,
XMLDocReader docReader)
Test to see if record has been modified outside of DCS.
|
getTaskProgress, setTaskProgress
protected static boolean debug
protected static final int NUM_STATUS_MESSAGES
protected DcsSetInfo dcsSetInfo
protected SessionBean sessionBean
protected SimpleDataStore dataStore
protected javax.servlet.ServletContext servletContext
protected SimpleLuceneIndex index
protected DcsDataManager dcsDataManager
protected boolean validateFiles
protected boolean indexOnValidation
protected java.lang.String[] statuses
protected boolean isProcessing
protected boolean stopProcessing
public ThreadedService(javax.servlet.ServletContext servletContext, java.lang.String threadedServiceDataDir)
servletContext
- NOT YET DOCUMENTEDthreadedServiceDataDir
- NOT YET DOCUMENTEDpublic boolean getIsProcessing()
getIsProcessing
in class MonitoredTask
public boolean getIndexOnValidation()
protected void validate(XMLDocReader docReader, DcsDataRecord dcsDataRecord)
docReader
- NOT YET DOCUMENTEDdcsDataRecord
- NOT YET DOCUMENTEDprotected XMLDocReader getDocReader(java.lang.String id)
id
- NOT YET DOCUMENTEDprotected boolean validationIsStale(java.io.File sourceFile, XMLDocReader docReader)
sourceFile
- file on diskdocReader
- the docReaderprotected java.util.List getIdList(java.lang.String collection, java.lang.String[] statuses)
collection
- NOT YET DOCUMENTEDstatuses
- NOT YET DOCUMENTEDprotected java.lang.String list2delimitedString(java.util.List list, java.lang.String delimiter)
list
- a list to be coverteddelimiter
- delimiter used to separate itemspublic java.lang.String getSessionId()
public void stopProcessing()
protected java.lang.String buildQuery(java.lang.String collection, java.lang.String[] statuses)
collection
- collectionKeystatuses
- statuses to be included in queryprotected void clearStatusMessages()
protected void addStatusMessage(java.lang.String msg)
msg
- The feature to be added to the ValidatingMessage attributepublic java.util.ArrayList getStatusMessages()
public Report getServiceReport()
public void setServiceReport(Report report)
report
- The new serviceReport valueprotected void setDcsSetInfo(DcsSetInfo setInfo) throws java.lang.Exception
setInfo
- The new dcsSetInfo valuejava.lang.Exception
- NOT YET DOCUMENTEDprotected void setStatuses(java.lang.String[] statuses) throws java.lang.Exception
statuses
- The new statuses valuejava.lang.Exception
- NOT YET DOCUMENTEDpublic void clearServiceReport()
protected void archiveServiceReport(Report report)
report
- NOT YET DOCUMENTEDpublic Report getArchivedReport(java.lang.String collection)
collection
- NOT YET DOCUMENTEDpublic java.util.List getArchivedReports()
public void setValidationEnabled(boolean validateFiles)
validateFiles
- True to validate, else false.FileIndexingServiceWriter.getValidationReport()
public void setIndexOnValidation(boolean indexOnValidation)
indexOnValidation
- The new indexOnValidation valuepublic static java.lang.String getSimpleDateStamp()
public static java.lang.String getDateStamp()