Class FileSystemItemAdapterServiceImpl
- All Implemented Interfaces:
FileSystemItemAdapterService,Adaptable,Component,Extensible,TimestampedService
FileSystemItemAdapterService.- Author:
- Antoine Taillefer
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringprotected ActiveFileSystemItemFactoryRegistryprotected ActiveTopLevelFolderItemFactoryRegistryprotected static final Stringprotected static final intstatic final Stringprotected List<FileSystemItemFactoryWrapper>protected FileSystemItemFactoryRegistryprotected Semaphorestatic final Stringprotected TopLevelFolderItemFactoryprotected TopLevelFolderItemFactoryRegistryFields inherited from class org.nuxeo.runtime.model.DefaultComponent
lastModified, name -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidactivate(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 booleanGets the activeFileSystemItemfactory names.Gets theFileSystemItemfor the givenDocumentModel.getFileSystemItem(DocumentModel doc, boolean includeDeleted) Gets theFileSystemItemfor the givenDocumentModel.getFileSystemItem(DocumentModel doc, boolean includeDeleted, boolean relaxSyncRootConstraint) Gets theFileSystemItemfor the givenDocumentModel.getFileSystemItem(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.getFileSystemItem(DocumentModel doc, FolderItem parentItem) getFileSystemItem(DocumentModel doc, FolderItem parentItem, boolean includeDeleted) getFileSystemItem(DocumentModel doc, FolderItem parentItem, boolean includeDeleted, boolean relaxSyncRootConstraint) getFileSystemItem(DocumentModel doc, FolderItem parentItem, boolean includeDeleted, boolean relaxSyncRootConstraint, boolean getLockInfo) Iterates on the ordered contributed file system item factories until if finds one that can handle the givenFileSystemItemid.Allows to limit the number of concurrent scrolls run byFolderItem.scrollDescendants(String, int, long).Gets theTopLevelFolderItemFactory.getVirtualFolderItemFactory(String factoryName) Gets theVirtualFolderItemFactoryfor the given factory name.voidregisterContribution(Object contribution, String extensionPoint, ComponentInstance contributor) voidDeprecated.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.DefaultComponent
addRuntimeMessage, addRuntimeMessage, getAdapter, getDescriptor, getDescriptors, getLastModified, getRegistry, register, registerExtension, setLastModified, setModifiedNow, setName, unregister, unregisterExtensionMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.nuxeo.runtime.model.Component
getApplicationStartedOrder
-
Field Details
-
FILE_SYSTEM_ITEM_FACTORY_EP
- See Also:
-
TOP_LEVEL_FOLDER_ITEM_FACTORY_EP
- See Also:
-
ACTIVE_FILE_SYSTEM_ITEM_FACTORIES_EP
- See Also:
-
CONCURRENT_SCROLL_BATCH_LIMIT
- See Also:
-
CONCURRENT_SCROLL_BATCH_LIMIT_DEFAULT
protected static final int CONCURRENT_SCROLL_BATCH_LIMIT_DEFAULT- See Also:
-
topLevelFolderItemFactoryRegistry
-
fileSystemItemFactoryRegistry
-
activeTopLevelFolderItemFactoryRegistry
-
activeFileSystemItemFactoryRegistry
-
topLevelFolderItemFactory
-
fileSystemItemFactories
-
scrollBatchSemaphore
-
-
Constructor Details
-
FileSystemItemAdapterServiceImpl
public FileSystemItemAdapterServiceImpl()
-
-
Method Details
-
registerContribution
public void registerContribution(Object contribution, String extensionPoint, ComponentInstance contributor) - Overrides:
registerContributionin classDefaultComponent
-
unregisterContribution
public void unregisterContribution(Object contribution, String extensionPoint, ComponentInstance contributor) - Overrides:
unregisterContributionin classDefaultComponent
-
activate
Description copied from interface:ComponentActivates the component.This method is called by the runtime when a component is activated.
- Specified by:
activatein interfaceComponent- Overrides:
activatein classDefaultComponent- Parameters:
context- the runtime context
-
deactivate
Description copied from interface:ComponentDeactivates the component.This method is called by the runtime when a component is deactivated.
- Specified by:
deactivatein interfaceComponent- Overrides:
deactivatein classDefaultComponent- Parameters:
context- the runtime context
-
start
Sorts the contributed factories according to their order and initializes thescrollBatchSemaphore.- Specified by:
startin interfaceComponent- Overrides:
startin classDefaultComponent
-
stop
Description copied from interface:ComponentStop the component.- Specified by:
stopin interfaceComponent- Overrides:
stopin classDefaultComponent- Throws:
InterruptedException
-
getFileSystemItem
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 interfaceFileSystemItemAdapterService- Returns:
- the
FileSystemItemor null if theDocumentModelis not adaptable as aFileSystemItem - See Also:
-
getFileSystemItem
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 interfaceFileSystemItemAdapterService- Returns:
- the
FileSystemItemor null if theDocumentModelis not adaptable as aFileSystemItem - See Also:
-
getFileSystemItem
public 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 interfaceFileSystemItemAdapterService- Returns:
- the
FileSystemItemor null if theDocumentModelis not adaptable as aFileSystemItem - See Also:
-
getFileSystemItem
public 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 interfaceFileSystemItemAdapterService- Returns:
- the
FileSystemItemor null if theDocumentModelis not adaptable as aFileSystemItem - See Also:
-
getFileSystemItem
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 interfaceFileSystemItemAdapterService- Returns:
- the
FileSystemItemor null if theDocumentModelis not adaptable as aFileSystemItem - See Also:
-
getFileSystemItem
public 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 interfaceFileSystemItemAdapterService- Returns:
- the
FileSystemItemor null if theDocumentModelis not adaptable as aFileSystemItem - See Also:
-
getFileSystemItem
public 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 interfaceFileSystemItemAdapterService- Returns:
- the
FileSystemItemor null if theDocumentModelis not adaptable as aFileSystemItem - See Also:
-
getFileSystemItem
public 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 interfaceFileSystemItemAdapterService- Returns:
- the
FileSystemItemor null if theDocumentModelis not adaptable as aFileSystemItem - See Also:
-
getFileSystemItemFactoryForId
Iterates on the ordered contributed file system item factories until if finds one that can handle the givenFileSystemItemid.- Specified by:
getFileSystemItemFactoryForIdin interfaceFileSystemItemAdapterService- See Also:
-
getTopLevelFolderItemFactory
Description copied from interface:FileSystemItemAdapterServiceGets theTopLevelFolderItemFactory.- Specified by:
getTopLevelFolderItemFactoryin interfaceFileSystemItemAdapterService
-
getVirtualFolderItemFactory
Description copied from interface:FileSystemItemAdapterServiceGets theVirtualFolderItemFactoryfor the given factory name.- Specified by:
getVirtualFolderItemFactoryin interfaceFileSystemItemAdapterService
-
getActiveFileSystemItemFactories
Description copied from interface:FileSystemItemAdapterServiceGets the activeFileSystemItemfactory names.- Specified by:
getActiveFileSystemItemFactoriesin interfaceFileSystemItemAdapterService
-
getScrollBatchSemaphore
Description copied from interface:FileSystemItemAdapterServiceAllows to limit the number of concurrent scrolls run byFolderItem.scrollDescendants(String, int, long).- Specified by:
getScrollBatchSemaphorein interfaceFileSystemItemAdapterService
-
getFileSystemItemFactoryDescriptors
-
getFileSystemItemFactories
-
getFileSystemItemFactory
-
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 -
getFileSystemItem
protected 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
-
generalFactoryMatches
-
docTypeFactoryMatches
-
facetFactoryMatches
protected boolean facetFactoryMatches(FileSystemItemFactoryWrapper factory, DocumentModel doc, boolean relaxSyncRootConstraint) -
syncRootFactoryMatches
-