Package org.opencms.report
Class A_CmsReportThread
java.lang.Object
java.lang.Thread
org.opencms.report.A_CmsReportThread
- All Implemented Interfaces:
Runnable
,I_CmsReportThread
- Direct Known Subclasses:
CmsCreateSiteThread
,CmsDatabaseImportThread
,CmsExportThread
,CmsExternalLinksValidatorThread
,CmsExternalLinksValidatorThread
,CmsHistoryClearThread
,CmsImportUserThread
,CmsIndexingReportThread
,CmsModuleDeleteThread
,CmsModuleImportThread
,CmsModuleReplaceThread
,CmsProjectDeleteThread
,CmsRelationsValidatorThread
,CmsRemovePropertyFromResourcesThread
,CmsRemovePubLocksThread
,CmsSearchReplaceThread
,CmsShellScriptThread
,CmsSitesWebserverThread
,CmsStaticExportThread
,CmsSynchronizeThread
,CmsSynchronizeThread
,CmsTemplateMappingContentRewriter
,CmsUserDataReportThread
,CmsXmlContentRepairThread
Provides a common Thread class for the reports.
- Since:
- 6.0.0
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
-
Field Summary
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
-
Constructor Summary
ModifierConstructorDescriptionprotected
A_CmsReportThread
(CmsObject cms, String name) Constructs a new report Thread with the given name. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds an error object to the list of errors that occurred during the report.protected CmsObject
getCms()
Returns the OpenCms context object this Thread is initialized with.getError()
Returns the error exception in case there was an error during the execution of this Thread, null otherwise.Returns a list of all errors that occurred during the report.long
Returns the time of last report entry.Returns the logger to which the report output should also be directed.protected I_CmsReport
Returns the report where the output of this Thread is written to.abstract String
Returns the part of the report that is ready for output.getReportUpdate
(I_CmsReportUpdateFormatter formatter) Gets the report update content using the specified report update formatter.long
Returns the time this report has been running.getUUID()
Returns the OpenCms UUID of this report thread.boolean
hasError()
Returns if the report generated an error output.protected void
initHtmlReport
(Locale locale) Initialize a HTML report for this Thread.protected void
initOldHtmlReport
(Locale locale) Deprecated.boolean
isDoomed()
Returns true if this thread is already "doomed" to be deleted.Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, run, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yield
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.opencms.report.I_CmsReportThread
start
-
Field Details
-
m_report
The report that belongs to the thread.
-
-
Constructor Details
-
A_CmsReportThread
Constructs a new report Thread with the given name.- Parameters:
cms
- the current OpenCms context objectname
- the name of the Thread
-
-
Method Details
-
addError
Adds an error object to the list of errors that occurred during the report.- Parameters:
obj
- the error object
-
getError
Returns the error exception in case there was an error during the execution of this Thread, null otherwise.- Returns:
- the error exception in case there was an error, null otherwise
-
getErrors
Returns a list of all errors that occurred during the report.- Returns:
- an error list that occurred during the report
-
getLastEntryTime
Returns the time of last report entry.Will return zero if no entry has been written.
- Returns:
- time of last report entry
-
getLogChannel
Returns the logger to which the report output should also be directed.If this returns null, report output is not sent to a logger.
- Returns:
- the logger to which report output should be sent.
-
getReportUpdate
Returns the part of the report that is ready for output.- Returns:
- the part of the report that is ready for output
-
getReportUpdate
Gets the report update content using the specified report update formatter.- Parameters:
formatter
- the report update formatter- Returns:
- the report output
-
getRuntime
Returns the time this report has been running.- Returns:
- the time this report has been running
-
getUUID
Returns the OpenCms UUID of this report thread.- Specified by:
getUUID
in interfaceI_CmsReportThread
- Returns:
- the OpenCms UUID of this report thread
-
hasError
Returns if the report generated an error output.- Returns:
- true if the report generated an error, otherwise false
-
isDoomed
Returns true if this thread is already "doomed" to be deleted.A OpenCms deamon Thread (the "Grim Reaper") will collect all doomed Threads, i.e. threads that are not longer active for some time.
- Returns:
- true if this thread is already "doomed" to be deleted
-
getCms
Returns the OpenCms context object this Thread is initialized with.- Returns:
- the OpenCms context object this Thread is initialized with
-
getReport
Returns the report where the output of this Thread is written to.- Returns:
- the report where the output of this Thread is written to
-
initHtmlReport
Initialize a HTML report for this Thread.- Parameters:
locale
- the locale for the report output messages
-
initOldHtmlReport
Deprecated.Initialize a HTML report for this Thread.This method is reserved for older report threads that still use XML templates to generate their output.
This report type will not work correctly with the new workplace, so don't use it anymore.
- Parameters:
locale
- the locale for the report output messages
-