Package com.logicaldoc.importfolder
Class ImportFolderCrawler
java.lang.Object
com.logicaldoc.core.task.Task
com.logicaldoc.importfolder.ImportFolderCrawler
- All Implemented Interfaces:
Runnable
public class ImportFolderCrawler
extends com.logicaldoc.core.task.Task
This component crawls all remote import folders importing found files in the
dms.
- Since:
- 2.1
- Author:
- Marco Meschieri- LogicalDOC
-
Field Summary
Fields inherited from class com.logicaldoc.core.task.Task
STATUS_IDLE, STATUS_RUNNING, STATUS_STOPPING
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
afterCrawlingCompleted
(ImportFolder importFolder) To be invoked after the crawling has completedvoid
afterDocumentImported
(ImportFolder importFolder, com.logicaldoc.core.document.DocumentHistory transaction) To be invoked after a file has been importedstatic void
beforeDocumentImported
(ImportFolder importFolder, com.logicaldoc.core.document.DocumentHistory transaction) To be invoked before a file gets importedvoid
Downloads all new files from all import folders.void
com.logicaldoc.core.document.DocumentDAO
long
long
int
org.slf4j.Logger
getLog()
int
long
boolean
boolean
void
onError
(ImportFolder importFolder, com.logicaldoc.core.document.Document document, String originalPath, Throwable error) To be invoked after an error has been detectedvoid
setCacheManager
(ImportFolderCacheManager cacheManager) void
setDefaultOwner
(String defaultOwner) void
setDocumentDao
(com.logicaldoc.core.document.DocumentDAO documentDao) void
setImportFolderDao
(ImportFolderDAO importFolderDao) void
setImportFolderHistoryDao
(ImportFolderHistoryDAO importFolderHistoryDao) void
setSequenceDao
(com.logicaldoc.core.sequence.SequenceDAO sequenceDao) Methods inherited from class com.logicaldoc.core.task.Task
addTaskListener, getCompletionPercentage, getConfig, getName, getProgress, getReportRecipients, getScheduling, getSize, getStatus, interrupt, isInterrupted, isInterruptRequested, isRunning, isSendActivityReport, notifyReport, removeTaskListener, run, save, saveWork, setReportRecipients, setSendActivityReport, setSize
-
Field Details
-
NAME
- See Also:
-
COUNTER_SEQUENCE
- See Also:
-
-
Constructor Details
-
ImportFolderCrawler
public ImportFolderCrawler()
-
-
Method Details
-
getCacheManager
-
setCacheManager
-
getDocumentDao
public com.logicaldoc.core.document.DocumentDAO getDocumentDao() -
setDocumentDao
public void setDocumentDao(com.logicaldoc.core.document.DocumentDAO documentDao) -
crawlImportFolders
public void crawlImportFolders()Downloads all new files from all import folders. The stored document will be owned by the specified default owner -
afterCrawlingCompleted
To be invoked after the crawling has completed- Parameters:
importFolder
- the used import folder
-
beforeDocumentImported
public static void beforeDocumentImported(ImportFolder importFolder, com.logicaldoc.core.document.DocumentHistory transaction) To be invoked before a file gets imported- Parameters:
importFolder
- the used import foldertransaction
- the target created / updated document event (the original path is expected to be the pathOld)
-
afterDocumentImported
public void afterDocumentImported(ImportFolder importFolder, com.logicaldoc.core.document.DocumentHistory transaction) To be invoked after a file has been imported- Parameters:
importFolder
- the used import foldertransaction
- the target created / updated document event (the original path is expected to be the pathOld)
-
onError
public void onError(ImportFolder importFolder, com.logicaldoc.core.document.Document document, String originalPath, Throwable error) To be invoked after an error has been detected- Parameters:
importFolder
- the used import folderdocument
- the target documentoriginalPath
- the original path of the fileerror
- the exception generated by the error
-
isIndeterminate
public boolean isIndeterminate()- Specified by:
isIndeterminate
in classcom.logicaldoc.core.task.Task
-
isConcurrent
public boolean isConcurrent()- Specified by:
isConcurrent
in classcom.logicaldoc.core.task.Task
-
setDefaultOwner
-
getRemoteCount
public int getRemoteCount() -
getLocalCount
public int getLocalCount() -
getImported
public long getImported() -
getUpdated
public long getUpdated() -
getErrors
public long getErrors() -
getDefaultOwner
-
following
public void following() -
getLog
public org.slf4j.Logger getLog() -
getImportFolderDao
-
setImportFolderDao
-
setSequenceDao
public void setSequenceDao(com.logicaldoc.core.sequence.SequenceDAO sequenceDao) -
setImportFolderHistoryDao
-