Package org.nuxeo.drive.service
Interface NuxeoDriveManager
- All Known Implementing Classes:
NuxeoDriveManagerImpl
public interface NuxeoDriveManager
Manage list of NuxeoDrive synchronization roots and devices for a given nuxeo user.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addToLocallyEditedCollection
(CoreSession session, DocumentModel doc) Adds the givenDocumentModel
to theLOCALLY_EDITED_COLLECTION_NAME
collection.Gets theFileSystemChangeFinder
member.getChangeSummary
(NuxeoPrincipal principal, Map<String, Set<IdRef>> lastSyncRootRefs, long lowerBound) Gets a summary of document changes in all repositories for the given user's synchronization roots, from the lower bound sent by the user's device.getCollectionSyncRootMemberIds
(NuxeoPrincipal principal) Fetch all the collection sync root member ids for a given user.Fetch the list of synchronization root refs for a given user and a given session repository.getSynchronizationRoots
(NuxeoPrincipal principal) Fetch all the synchronization root references and paths for a given user.void
Method to be called by a CoreEvent listener monitoring documents deletions to cleanup references to recently deleted documents and invalidate the caches.void
Invalidate the collection sync root member cache for all users so as to query the repository next timegetCollectionSyncRootMemberIds(NuxeoPrincipal)
is called.void
Invalidate the collection sync root member cache for a given user so as to query the repository next timegetCollectionSyncRootMemberIds(NuxeoPrincipal)
is called.void
invalidateSynchronizationRootsCache
(String userName) Invalidate the synchronization roots cache for a given user so as to query the repository next timegetSynchronizationRoots(NuxeoPrincipal)
is called.boolean
isSynchronizationRoot
(NuxeoPrincipal principal, DocumentModel doc) Checks if the givenDocumentModel
is a synchronization root for the given user.void
registerSynchronizationRoot
(NuxeoPrincipal principal, DocumentModel newRootContainer, CoreSession session) void
unregisterSynchronizationRoot
(NuxeoPrincipal principal, DocumentModel rootContainer, CoreSession session)
-
Method Details
-
registerSynchronizationRoot
void registerSynchronizationRoot(NuxeoPrincipal principal, DocumentModel newRootContainer, CoreSession session) - Parameters:
principal
- the Nuxeo Drive usernewRootContainer
- the folderish document to be used as synchronization root: must be bound to an active session- Throws:
SecurityException
- if the user does not have write permissions to the container.
-
unregisterSynchronizationRoot
void unregisterSynchronizationRoot(NuxeoPrincipal principal, DocumentModel rootContainer, CoreSession session) - Parameters:
principal
- the Nuxeo Drive userrootContainer
- the folderish document that should no longer be used as a synchronization root
-
getSynchronizationRootReferences
Fetch the list of synchronization root refs for a given user and a given session repository. This list is assumed to be short enough (in the order of 100 folder max) so that no paging API is required. The user is taken from the session.getPrincipal() method.- Parameters:
session
- active CoreSession instance to the repository hosting the roots.- Returns:
- the ordered set of non deleted synchronization root references for that user
-
getSynchronizationRoots
Fetch all the synchronization root references and paths for a given user. This list is assumed to be short enough (in the order of 100 folder max) so that no paging API is required.- Parameters:
principal
- the user to fetch the roots for- Returns:
- the map keyed by repository names all active roots definitions for the current user.
-
getCollectionSyncRootMemberIds
Fetch all the collection sync root member ids for a given user.- Parameters:
principal
- the user to fetch the ids for- Returns:
- the map keyed by repository names all collection sync root member ids for the current user.
-
isSynchronizationRoot
Checks if the givenDocumentModel
is a synchronization root for the given user. -
handleFolderDeletion
Method to be called by a CoreEvent listener monitoring documents deletions to cleanup references to recently deleted documents and invalidate the caches. -
getChangeSummary
FileSystemChangeSummary getChangeSummary(NuxeoPrincipal principal, Map<String, Set<IdRef>> lastSyncRootRefs, long lowerBound) Gets a summary of document changes in all repositories for the given user's synchronization roots, from the lower bound sent by the user's device.The summary includes:
- The list of sync root paths
- A list of document changes
- The document models that have changed
- A status code
- Parameters:
lastSyncRootRefs
- the map keyed by repository names of document refs for the synchronization roots that were active during last synchronizationlowerBound
- the lower bound sent by the user's device. Typically set to the value returned byFileSystemChangeSummary.getUpperBound()
of the previous call togetChangeSummary(NuxeoPrincipal, Map, long)
or 0 for catching every event since the repository initialization.- Returns:
- the summary of document changes
-
getChangeFinder
FileSystemChangeFinder getChangeFinder()Gets theFileSystemChangeFinder
member. -
invalidateSynchronizationRootsCache
Invalidate the synchronization roots cache for a given user so as to query the repository next timegetSynchronizationRoots(NuxeoPrincipal)
is called.- Parameters:
userName
- the principal name of the user to invalidate the cache for.
-
invalidateCollectionSyncRootMemberCache
Invalidate the collection sync root member cache for a given user so as to query the repository next timegetCollectionSyncRootMemberIds(NuxeoPrincipal)
is called.- Parameters:
userName
- the principal name of the user to invalidate the cache for.
-
invalidateCollectionSyncRootMemberCache
void invalidateCollectionSyncRootMemberCache()Invalidate the collection sync root member cache for all users so as to query the repository next timegetCollectionSyncRootMemberIds(NuxeoPrincipal)
is called. -
addToLocallyEditedCollection
Adds the givenDocumentModel
to theLOCALLY_EDITED_COLLECTION_NAME
collection.- Since:
- 6.0
-