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 Modifier and Type Field Description static String
COUNTER_SEQUENCE
static String
NAME
-
Constructor Summary
Constructors Constructor Description ImportFolderCrawler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
_next()
void
crawlImportFolders()
Downloads all new files from all import folders.ImportFolderCacheManager
getCacheManager()
String
getDefaultOwner()
com.logicaldoc.core.document.dao.DocumentDAO
getDocumentDao()
long
getErrors()
long
getImported()
ImportFolderDAO
getImportFolderDao()
int
getLocalCount()
org.slf4j.Logger
getLog()
int
getRemoteCount()
long
getUpdated()
boolean
isConcurrent()
boolean
isIndeterminate()
void
onError(ImportFolder importFolder, com.logicaldoc.core.document.Document document, String originalPath, Throwable error)
To be invoked after an error has been detectedvoid
onImport(ImportFolder importFolder, com.logicaldoc.core.document.Document document, String originalPath, boolean newFile)
To be invoked after a file has been importedvoid
setCacheManager(ImportFolderCacheManager cacheManager)
void
setDefaultOwner(String defaultOwner)
void
setDocumentDao(com.logicaldoc.core.document.dao.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, setConfig, setLockManager, setReportRecipients, setSendActivityReport, setSender, setSize, setSystemLoadMonitor, setUserDao
-
-
-
-
Field Detail
-
NAME
public static final String NAME
- See Also:
- Constant Field Values
-
COUNTER_SEQUENCE
public static final String COUNTER_SEQUENCE
- See Also:
- Constant Field Values
-
-
Method Detail
-
getCacheManager
public ImportFolderCacheManager getCacheManager()
-
setCacheManager
public void setCacheManager(ImportFolderCacheManager cacheManager)
-
getDocumentDao
public com.logicaldoc.core.document.dao.DocumentDAO getDocumentDao()
-
setDocumentDao
public void setDocumentDao(com.logicaldoc.core.document.dao.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
-
onImport
public void onImport(ImportFolder importFolder, com.logicaldoc.core.document.Document document, String originalPath, boolean newFile)
To be invoked after a file has been imported- Parameters:
importFolder
- the used import folderdocument
- the target created / updated documentoriginalPath
- the original path of the filenewFile
- if this is a new import or an update
-
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
public void setDefaultOwner(String defaultOwner)
-
getRemoteCount
public int getRemoteCount()
-
getLocalCount
public int getLocalCount()
-
getImported
public long getImported()
-
getUpdated
public long getUpdated()
-
getErrors
public long getErrors()
-
getDefaultOwner
public String getDefaultOwner()
-
_next
public void _next()
-
getLog
public org.slf4j.Logger getLog()
-
getImportFolderDao
public ImportFolderDAO getImportFolderDao()
-
setImportFolderDao
public void setImportFolderDao(ImportFolderDAO importFolderDao)
-
setSequenceDao
public void setSequenceDao(com.logicaldoc.core.sequence.SequenceDAO sequenceDao)
-
setImportFolderHistoryDao
public void setImportFolderHistoryDao(ImportFolderHistoryDAO importFolderHistoryDao)
-
-