Class FileSystemItemAdapterServiceImpl
- java.lang.Object
- 
- org.nuxeo.runtime.model.DefaultComponent
- 
- org.nuxeo.drive.service.impl.FileSystemItemAdapterServiceImpl
 
 
- 
- All Implemented Interfaces:
- FileSystemItemAdapterService,- Adaptable,- Component,- Extensible,- TimestampedService
 
 public class FileSystemItemAdapterServiceImpl extends DefaultComponent implements FileSystemItemAdapterService Default implementation of theFileSystemItemAdapterService.- Author:
- Antoine Taillefer
 
- 
- 
Field SummaryFields Modifier and Type Field Description static StringACTIVE_FILE_SYSTEM_ITEM_FACTORIES_EPprotected ActiveFileSystemItemFactoryRegistryactiveFileSystemItemFactoryRegistryprotected ActiveTopLevelFolderItemFactoryRegistryactiveTopLevelFolderItemFactoryRegistryprotected static StringCONCURRENT_SCROLL_BATCH_LIMITprotected static intCONCURRENT_SCROLL_BATCH_LIMIT_DEFAULTstatic StringFILE_SYSTEM_ITEM_FACTORY_EPprotected List<FileSystemItemFactoryWrapper>fileSystemItemFactoriesprotected FileSystemItemFactoryRegistryfileSystemItemFactoryRegistryprotected SemaphorescrollBatchSemaphorestatic StringTOP_LEVEL_FOLDER_ITEM_FACTORY_EPprotected TopLevelFolderItemFactorytopLevelFolderItemFactoryprotected TopLevelFolderItemFactoryRegistrytopLevelFolderItemFactoryRegistry- 
Fields inherited from class org.nuxeo.runtime.model.DefaultComponentlastModified, name
 
- 
 - 
Constructor SummaryConstructors Constructor Description FileSystemItemAdapterServiceImpl()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidactivate(ComponentContext context)Activates the component.voiddeactivate(ComponentContext context)Deactivates the component.protected booleandocTypeFactoryMatches(FileSystemItemFactoryWrapper factory, DocumentModel doc)protected booleanfacetFactoryMatches(FileSystemItemFactoryWrapper factory, DocumentModel doc, boolean relaxSyncRootConstraint)protected booleangeneralFactoryMatches(FileSystemItemFactoryWrapper factory)Set<String>getActiveFileSystemItemFactories()Gets the activeFileSystemItemfactory names.FileSystemItemgetFileSystemItem(DocumentModel doc)Gets theFileSystemItemfor the givenDocumentModel.FileSystemItemgetFileSystemItem(DocumentModel doc, boolean includeDeleted)Gets theFileSystemItemfor the givenDocumentModel.FileSystemItemgetFileSystemItem(DocumentModel doc, boolean includeDeleted, boolean relaxSyncRootConstraint)Gets theFileSystemItemfor the givenDocumentModel.FileSystemItemgetFileSystemItem(DocumentModel doc, boolean includeDeleted, boolean relaxSyncRootConstraint, boolean getLockInfo)Gets theFileSystemItemfor the givenDocumentModel.protected FileSystemItemgetFileSystemItem(DocumentModel doc, boolean forceParentItem, FolderItem parentItem, boolean includeDeleted, boolean relaxSyncRootConstraint, boolean getLockInfo)Tries to adapt the given document as the top levelFolderItem.FileSystemItemgetFileSystemItem(DocumentModel doc, FolderItem parentItem)FileSystemItemgetFileSystemItem(DocumentModel doc, FolderItem parentItem, boolean includeDeleted)FileSystemItemgetFileSystemItem(DocumentModel doc, FolderItem parentItem, boolean includeDeleted, boolean relaxSyncRootConstraint)FileSystemItemgetFileSystemItem(DocumentModel doc, FolderItem parentItem, boolean includeDeleted, boolean relaxSyncRootConstraint, boolean getLockInfo)List<FileSystemItemFactoryWrapper>getFileSystemItemFactories()FileSystemItemFactorygetFileSystemItemFactory(String name)Map<String,FileSystemItemFactoryDescriptor>getFileSystemItemFactoryDescriptors()FileSystemItemFactorygetFileSystemItemFactoryForId(String id)Iterates on the ordered contributed file system item factories until if finds one that can handle the givenFileSystemItemid.SemaphoregetScrollBatchSemaphore()Allows to limit the number of concurrent scrolls run byFolderItem.scrollDescendants(String, int, long).TopLevelFolderItemFactorygetTopLevelFolderItemFactory()Gets theTopLevelFolderItemFactory.VirtualFolderItemFactorygetVirtualFolderItemFactory(String factoryName)Gets theVirtualFolderItemFactoryfor the given factory name.voidregisterContribution(Object contribution, String extensionPoint, ComponentInstance contributor)voidsetActiveFactories()Deprecated.since 9.3 this is method is not needed anymore with hot reload and standby strategy, but kept due to some issues in operation NuxeoDriveSetActiveFactories which freeze Jetty in unit tests when wanting to use standby strategyvoidstart(ComponentContext context)Sorts the contributed factories according to their order and initializes thescrollBatchSemaphore.voidstop(ComponentContext context)Stop the component.protected booleansyncRootFactoryMatches(DocumentModel doc, boolean relaxSyncRootConstraint)voidunregisterContribution(Object contribution, String extensionPoint, ComponentInstance contributor)- 
Methods inherited from class org.nuxeo.runtime.model.DefaultComponentaddRuntimeMessage, addRuntimeMessage, getAdapter, getDescriptor, getDescriptors, getLastModified, getRegistry, register, registerExtension, setLastModified, setModifiedNow, setName, unregister, unregisterExtension
 - 
Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 - 
Methods inherited from interface org.nuxeo.runtime.model.ComponentapplicationStarted, getApplicationStartedOrder
 
- 
 
- 
- 
- 
Field Detail- 
FILE_SYSTEM_ITEM_FACTORY_EPpublic static final String FILE_SYSTEM_ITEM_FACTORY_EP - See Also:
- Constant Field Values
 
 - 
TOP_LEVEL_FOLDER_ITEM_FACTORY_EPpublic static final String TOP_LEVEL_FOLDER_ITEM_FACTORY_EP - See Also:
- Constant Field Values
 
 - 
ACTIVE_FILE_SYSTEM_ITEM_FACTORIES_EPpublic static final String ACTIVE_FILE_SYSTEM_ITEM_FACTORIES_EP - See Also:
- Constant Field Values
 
 - 
CONCURRENT_SCROLL_BATCH_LIMITprotected static final String CONCURRENT_SCROLL_BATCH_LIMIT - See Also:
- Constant Field Values
 
 - 
CONCURRENT_SCROLL_BATCH_LIMIT_DEFAULTprotected static final int CONCURRENT_SCROLL_BATCH_LIMIT_DEFAULT - See Also:
- Constant Field Values
 
 - 
topLevelFolderItemFactoryRegistryprotected TopLevelFolderItemFactoryRegistry topLevelFolderItemFactoryRegistry 
 - 
fileSystemItemFactoryRegistryprotected FileSystemItemFactoryRegistry fileSystemItemFactoryRegistry 
 - 
activeTopLevelFolderItemFactoryRegistryprotected ActiveTopLevelFolderItemFactoryRegistry activeTopLevelFolderItemFactoryRegistry 
 - 
activeFileSystemItemFactoryRegistryprotected ActiveFileSystemItemFactoryRegistry activeFileSystemItemFactoryRegistry 
 - 
topLevelFolderItemFactoryprotected TopLevelFolderItemFactory topLevelFolderItemFactory 
 - 
fileSystemItemFactoriesprotected List<FileSystemItemFactoryWrapper> fileSystemItemFactories 
 - 
scrollBatchSemaphoreprotected Semaphore scrollBatchSemaphore 
 
- 
 - 
Method Detail- 
registerContributionpublic void registerContribution(Object contribution, String extensionPoint, ComponentInstance contributor) - Overrides:
- registerContributionin class- DefaultComponent
 
 - 
unregisterContributionpublic void unregisterContribution(Object contribution, String extensionPoint, ComponentInstance contributor) - Overrides:
- unregisterContributionin class- DefaultComponent
 
 - 
activatepublic void activate(ComponentContext context) Description copied from interface:ComponentActivates the component.This method is called by the runtime when a component is activated. - Specified by:
- activatein interface- Component
- Overrides:
- activatein class- DefaultComponent
- Parameters:
- context- the runtime context
 
 - 
deactivatepublic void deactivate(ComponentContext context) Description copied from interface:ComponentDeactivates the component.This method is called by the runtime when a component is deactivated. - Specified by:
- deactivatein interface- Component
- Overrides:
- deactivatein class- DefaultComponent
- Parameters:
- context- the runtime context
 
 - 
startpublic void start(ComponentContext context) Sorts the contributed factories according to their order and initializes thescrollBatchSemaphore.- Specified by:
- startin interface- Component
- Overrides:
- startin class- DefaultComponent
 
 - 
stoppublic void stop(ComponentContext context) throws InterruptedException Description copied from interface:ComponentStop the component.- Specified by:
- stopin interface- Component
- Overrides:
- stopin class- DefaultComponent
- Throws:
- InterruptedException
 
 - 
getFileSystemItempublic FileSystemItem getFileSystemItem(DocumentModel doc) Description copied from interface:FileSystemItemAdapterServiceGets theFileSystemItemfor the givenDocumentModel. If the document is in the trash it is not considered as adaptable as aFileSystemItem, thus the method returns null.- Specified by:
- getFileSystemItemin interface- FileSystemItemAdapterService
- Returns:
- the FileSystemItemor null if theDocumentModelis not adaptable as aFileSystemItem
- See Also:
- FileSystemItemFactory.getFileSystemItem(DocumentModel)
 
 - 
getFileSystemItempublic FileSystemItem getFileSystemItem(DocumentModel doc, boolean includeDeleted) Description copied from interface:FileSystemItemAdapterServiceGets theFileSystemItemfor the givenDocumentModel. IfincludeDeletedis true no filter is applied on the "trashed" state, else if the document is in the trash it is not considered as adaptable as aFileSystemItem, thus the method returns null.- Specified by:
- getFileSystemItemin interface- FileSystemItemAdapterService
- Returns:
- the FileSystemItemor null if theDocumentModelis not adaptable as aFileSystemItem
- See Also:
- FileSystemItemFactory.getFileSystemItem(DocumentModel, boolean)
 
 - 
getFileSystemItempublic FileSystemItem getFileSystemItem(DocumentModel doc, boolean includeDeleted, boolean relaxSyncRootConstraint) Description copied from interface:FileSystemItemAdapterServiceGets theFileSystemItemfor the givenDocumentModel.If includeDeletedis true no filter is applied on the "trashed" state, else if the document is in the trash it is not considered as adaptable as aFileSystemItem, thus the method returns null.If relaxSyncRootConstraintis true no filter is applied on the synchronization root aspect for the current user.- Specified by:
- getFileSystemItemin interface- FileSystemItemAdapterService
- Returns:
- the FileSystemItemor null if theDocumentModelis not adaptable as aFileSystemItem
- See Also:
- FileSystemItemFactory.getFileSystemItem(DocumentModel, boolean, boolean)
 
 - 
getFileSystemItempublic FileSystemItem getFileSystemItem(DocumentModel doc, boolean includeDeleted, boolean relaxSyncRootConstraint, boolean getLockInfo) Description copied from interface:FileSystemItemAdapterServiceGets theFileSystemItemfor the givenDocumentModel.If includeDeletedis true no filter is applied on the "trashed" state, else if the document is in the trash it is not considered as adaptable as aFileSystemItem, thus the method returns null.If relaxSyncRootConstraintis true no filter is applied on the synchronization root aspect for the current user.If getLockInfois true theLockis fetched from theDocumentModeland set on the returnedFileSystemItem.- Specified by:
- getFileSystemItemin interface- FileSystemItemAdapterService
- Returns:
- the FileSystemItemor null if theDocumentModelis not adaptable as aFileSystemItem
- See Also:
- FileSystemItemFactory.getFileSystemItem(DocumentModel, boolean, boolean, boolean)
 
 - 
getFileSystemItempublic FileSystemItem getFileSystemItem(DocumentModel doc, FolderItem parentItem) Description copied from interface:FileSystemItemAdapterServiceGets theFileSystemItemfor the givenDocumentModelforcing its parent with the givenparentItem. If the document is in the trash it is not considered as adaptable as aFileSystemItem, thus the method returns null.- Specified by:
- getFileSystemItemin interface- FileSystemItemAdapterService
- Returns:
- the FileSystemItemor null if theDocumentModelis not adaptable as aFileSystemItem
- See Also:
- FileSystemItemFactory.getFileSystemItem(DocumentModel, FolderItem)
 
 - 
getFileSystemItempublic FileSystemItem getFileSystemItem(DocumentModel doc, FolderItem parentItem, boolean includeDeleted) Description copied from interface:FileSystemItemAdapterServiceGets theFileSystemItemfor the givenDocumentModelforcing its parent with the givenparentItem. IfincludeDeletedis true no filter is applied on the "trashed" state, else if the document is in the trash it is not considered as adaptable as aFileSystemItem, thus the method returns null.- Specified by:
- getFileSystemItemin interface- FileSystemItemAdapterService
- Returns:
- the FileSystemItemor null if theDocumentModelis not adaptable as aFileSystemItem
- See Also:
- FileSystemItemFactory.getFileSystemItem(DocumentModel, FolderItem, boolean)
 
 - 
getFileSystemItempublic FileSystemItem getFileSystemItem(DocumentModel doc, FolderItem parentItem, boolean includeDeleted, boolean relaxSyncRootConstraint) Description copied from interface:FileSystemItemAdapterServiceGets theFileSystemItemfor the givenDocumentModelforcing its parent with the givenparentItem.If includeDeletedis true no filter is applied on the "trashed" state, else if the document is in the trash it is not considered as adaptable as aFileSystemItem, thus the method returns null.If relaxSyncRootConstraintis true no filter is applied on the synchronization root aspect for the current user.- Specified by:
- getFileSystemItemin interface- FileSystemItemAdapterService
- Returns:
- the FileSystemItemor null if theDocumentModelis not adaptable as aFileSystemItem
- See Also:
- FileSystemItemFactory.getFileSystemItem(DocumentModel, FolderItem, boolean, boolean)
 
 - 
getFileSystemItempublic FileSystemItem getFileSystemItem(DocumentModel doc, FolderItem parentItem, boolean includeDeleted, boolean relaxSyncRootConstraint, boolean getLockInfo) Description copied from interface:FileSystemItemAdapterServiceGets theFileSystemItemfor the givenDocumentModelforcing its parent with the givenparentItem.If includeDeletedis true no filter is applied on the "trashed" state, else if the document is in the trash it is not considered as adaptable as aFileSystemItem, thus the method returns null.If relaxSyncRootConstraintis true no filter is applied on the synchronization root aspect for the current user.If getLockInfois true theLockis fetched from theDocumentModeland set on the returnedFileSystemItem.- Specified by:
- getFileSystemItemin interface- FileSystemItemAdapterService
- Returns:
- the FileSystemItemor null if theDocumentModelis not adaptable as aFileSystemItem
- See Also:
- FileSystemItemFactory.getFileSystemItem(DocumentModel, FolderItem, boolean, boolean, boolean)
 
 - 
getFileSystemItemFactoryForIdpublic FileSystemItemFactory getFileSystemItemFactoryForId(String id) Iterates on the ordered contributed file system item factories until if finds one that can handle the givenFileSystemItemid.- Specified by:
- getFileSystemItemFactoryForIdin interface- FileSystemItemAdapterService
- See Also:
- FileSystemItemFactory.canHandleFileSystemItemId(String)
 
 - 
getTopLevelFolderItemFactorypublic TopLevelFolderItemFactory getTopLevelFolderItemFactory() Description copied from interface:FileSystemItemAdapterServiceGets theTopLevelFolderItemFactory.- Specified by:
- getTopLevelFolderItemFactoryin interface- FileSystemItemAdapterService
 
 - 
getVirtualFolderItemFactorypublic VirtualFolderItemFactory getVirtualFolderItemFactory(String factoryName) Description copied from interface:FileSystemItemAdapterServiceGets theVirtualFolderItemFactoryfor the given factory name.- Specified by:
- getVirtualFolderItemFactoryin interface- FileSystemItemAdapterService
 
 - 
getActiveFileSystemItemFactoriespublic Set<String> getActiveFileSystemItemFactories() Description copied from interface:FileSystemItemAdapterServiceGets the activeFileSystemItemfactory names.- Specified by:
- getActiveFileSystemItemFactoriesin interface- FileSystemItemAdapterService
 
 - 
getScrollBatchSemaphorepublic Semaphore getScrollBatchSemaphore() Description copied from interface:FileSystemItemAdapterServiceAllows to limit the number of concurrent scrolls run byFolderItem.scrollDescendants(String, int, long).- Specified by:
- getScrollBatchSemaphorein interface- FileSystemItemAdapterService
 
 - 
getFileSystemItemFactoryDescriptorspublic Map<String,FileSystemItemFactoryDescriptor> getFileSystemItemFactoryDescriptors() 
 - 
getFileSystemItemFactoriespublic List<FileSystemItemFactoryWrapper> getFileSystemItemFactories() 
 - 
getFileSystemItemFactorypublic FileSystemItemFactory getFileSystemItemFactory(String name) 
 - 
setActiveFactories@Deprecated public void setActiveFactories() Deprecated.since 9.3 this is method is not needed anymore with hot reload and standby strategy, but kept due to some issues in operation NuxeoDriveSetActiveFactories which freeze Jetty in unit tests when wanting to use standby strategy
 - 
getFileSystemItemprotected FileSystemItem getFileSystemItem(DocumentModel doc, boolean forceParentItem, FolderItem parentItem, boolean includeDeleted, boolean relaxSyncRootConstraint, boolean getLockInfo) Tries to adapt the given document as the top levelFolderItem. If it doesn't match, iterates on the ordered contributed file system item factories until it finds one that matches and retrieves a non nullFileSystemItemfor the given document. A file system item factory matches if:- It is not bound to any docType nor facet (this is the case for the default factory contribution
 defaultFileSystemItemFactorybound toDefaultFileSystemItemFactory)
- It is bound to a docType that matches the given doc's type
- It is bound to a facet that matches one of the given doc's facets
 
- It is not bound to any docType nor facet (this is the case for the default factory contribution
 
 - 
generalFactoryMatchesprotected boolean generalFactoryMatches(FileSystemItemFactoryWrapper factory) 
 - 
docTypeFactoryMatchesprotected boolean docTypeFactoryMatches(FileSystemItemFactoryWrapper factory, DocumentModel doc) 
 - 
facetFactoryMatchesprotected boolean facetFactoryMatches(FileSystemItemFactoryWrapper factory, DocumentModel doc, boolean relaxSyncRootConstraint) 
 - 
syncRootFactoryMatchesprotected boolean syncRootFactoryMatches(DocumentModel doc, boolean relaxSyncRootConstraint) 
 
- 
 
-