Class AbstractBulkFilesystemImporter
java.lang.Object
org.alfresco.repo.bulkimport.impl.AbstractBulkFilesystemImporter
- All Implemented Interfaces:
BulkFilesystemImporter,org.springframework.beans.factory.Aware,org.springframework.beans.factory.InitializingBean,org.springframework.context.ApplicationContextAware
- Direct Known Subclasses:
MultiThreadedBulkFilesystemImporter
public abstract class AbstractBulkFilesystemImporter
extends Object
implements BulkFilesystemImporter, org.springframework.beans.factory.InitializingBean, org.springframework.context.ApplicationContextAware
- Since:
- 4.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.springframework.context.ApplicationContextprotected BehaviourFilterprotected DirectoryAnalyserprotected FileFolderServiceprotected BulkImportStatusImplprotected JobLockServiceprotected static final org.apache.commons.logging.Logprotected PermissionServiceprotected RuleServiceprotected RetryingTransactionHelperprotected TransactionService -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidasyncBulkImport(BulkImportParameters bulkImportParameters, NodeImporter nodeImporter) Initiates a bulk filesystem import asynchronously i.e.voidbulkImport(BulkImportParameters bulkImportParameters, NodeImporter nodeImporter) Initiates a bulk filesystem import.protected abstract voidbulkImportImpl(BulkImportParameters bulkImportParameters, NodeImporter nodeImporter, String lockToken) protected StringgetFileName(File file) protected StringgetLock(long time) Attempts to get the lock.protected Stringprotected final StringgetRepositoryPath(NodeRef nodeRef) final BulkImportStatusprotected final StringmapToString(Map<?, ?> map) protected voidrefreshLock(String lockToken, long time) protected voidreleaseLock(String lockToken) voidsetApplicationContext(org.springframework.context.ApplicationContext applicationContext) voidsetBehaviourFilter(BehaviourFilter behaviourFilter) final voidsetDirectoryAnalyser(DirectoryAnalyser directoryAnalyser) voidsetFileFolderService(FileFolderService fileFolderService) voidsetImportStatus(BulkImportStatusImpl importStatus) voidsetJobLockService(JobLockService jobLockService) voidsetPermissionService(PermissionService permissionService) voidsetRuleService(RuleService ruleService) voidsetTransactionService(TransactionService transactionService) protected final voidvoid
-
Field Details
-
logger
protected static final org.apache.commons.logging.Log logger -
applicationContext
protected org.springframework.context.ApplicationContext applicationContext -
fileFolderService
-
transactionService
-
permissionService
-
transactionHelper
-
ruleService
-
importStatus
-
directoryAnalyser
-
jobLockService
-
behaviourFilter
-
-
Constructor Details
-
AbstractBulkFilesystemImporter
public AbstractBulkFilesystemImporter()
-
-
Method Details
-
setRuleService
-
setBehaviourFilter
-
setJobLockService
-
setImportStatus
-
setDirectoryAnalyser
-
setFileFolderService
-
setTransactionService
-
setPermissionService
-
getStatus
- Specified by:
getStatusin interfaceBulkFilesystemImporter- Returns:
- A status object that describes the current state of the bulk filesystem importer.
- See Also:
-
afterPropertiesSet
- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean- Throws:
Exception
-
bulkImportImpl
protected abstract void bulkImportImpl(BulkImportParameters bulkImportParameters, NodeImporter nodeImporter, String lockToken) -
getLock
Attempts to get the lock. If the lock couldn't be taken, then null is returned.- Returns:
- Returns the lock token or null
-
refreshLock
-
releaseLock
-
mapToString
-
getRepositoryPath
-
validateNodeRefIsWritableSpace
-
getFileName
-
getLockToken
-
validateSourceIsReadableDirectory
-
asyncBulkImport
Description copied from interface:BulkFilesystemImporterInitiates a bulk filesystem import asynchronously i.e. in a background thread. Note: getStatus().inProgress() must be false prior to calling this method or an Exception will be thrown.- Specified by:
asyncBulkImportin interfaceBulkFilesystemImporter- Parameters:
bulkImportParameters- The target bulk import parameters.nodeImporter- The node importer.
-
bulkImport
Description copied from interface:BulkFilesystemImporterInitiates a bulk filesystem import. Note: getStatus().inProgress() must be false prior to calling this method or an Exception will be thrown.- Specified by:
bulkImportin interfaceBulkFilesystemImporter- Parameters:
bulkImportParameters- The target bulk import parameters.nodeImporter- The node importer.- See Also:
-
setApplicationContext
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException - Specified by:
setApplicationContextin interfaceorg.springframework.context.ApplicationContextAware- Throws:
org.springframework.beans.BeansException
-