public interface NuxeoDriveManager
Modifier and Type | Method and Description |
---|---|
void |
addToLocallyEditedCollection(CoreSession session,
DocumentModel doc)
Adds the given
DocumentModel to the #LOCALLY_EDITED_COLLECTION_NAME collection. |
FileSystemChangeFinder |
getChangeFinder()
Gets the
FileSystemChangeFinder member. |
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.
|
Map<String,Set<String>> |
getCollectionSyncRootMemberIds(NuxeoPrincipal principal)
Fetch all the collection sync root member ids for a given user.
|
Set<IdRef> |
getSynchronizationRootReferences(CoreSession session)
Fetch the list of synchronization root refs for a given user and a given session repository.
|
Map<String,SynchronizationRoots> |
getSynchronizationRoots(NuxeoPrincipal principal)
Fetch all the synchronization root references and paths for a given user.
|
void |
handleFolderDeletion(IdRef ref)
Method to be called by a CoreEvent listener monitoring documents deletions to cleanup references to recently
deleted documents and invalidate the caches.
|
void |
invalidateCollectionSyncRootMemberCache()
Invalidate the collection sync root member cache for all users so as to query the repository next time
getCollectionSyncRootMemberIds(NuxeoPrincipal) is called. |
void |
invalidateCollectionSyncRootMemberCache(String userName)
Invalidate the collection sync root member cache for a given user so as to query the repository next time
getCollectionSyncRootMemberIds(NuxeoPrincipal) is called. |
void |
invalidateSynchronizationRootsCache(String userName)
Invalidate the synchronization roots cache for a given user so as to query the repository next time
getSynchronizationRoots(NuxeoPrincipal) is called. |
boolean |
isSynchronizationRoot(NuxeoPrincipal principal,
DocumentModel doc)
Checks if the given
DocumentModel is a synchronization root for the given user. |
void |
registerSynchronizationRoot(NuxeoPrincipal principal,
DocumentModel newRootContainer,
CoreSession session) |
void |
unregisterSynchronizationRoot(NuxeoPrincipal principal,
DocumentModel rootContainer,
CoreSession session) |
void registerSynchronizationRoot(NuxeoPrincipal principal, DocumentModel newRootContainer, CoreSession session)
principal
- the Nuxeo Drive usernewRootContainer
- the folderish document to be used as synchronization root: must be bound to an active
sessionSecurityException
- if the user does not have write permissions to the container.void unregisterSynchronizationRoot(NuxeoPrincipal principal, DocumentModel rootContainer, CoreSession session)
principal
- the Nuxeo Drive userrootContainer
- the folderish document that should no longer be used as a synchronization rootSet<IdRef> getSynchronizationRootReferences(CoreSession session)
session
- active CoreSession instance to the repository hosting the roots.#getSynchronizationRootPaths(String, CoreSession)
Map<String,SynchronizationRoots> getSynchronizationRoots(NuxeoPrincipal principal)
principal
- the user to fetch the roots forMap<String,Set<String>> getCollectionSyncRootMemberIds(NuxeoPrincipal principal)
principal
- the user to fetch the ids forboolean isSynchronizationRoot(NuxeoPrincipal principal, DocumentModel doc)
DocumentModel
is a synchronization root for the given user.void handleFolderDeletion(IdRef ref)
FileSystemChangeSummary getChangeSummary(NuxeoPrincipal principal, Map<String,Set<IdRef>> lastSyncRootRefs, long lowerBound)
The summary includes:
principal
- 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 by
FileSystemChangeSummary.getUpperBound()
of the previous call to
getChangeSummary(NuxeoPrincipal, Map, long)
or 0 for catching every event
since the repository initialization.FileSystemChangeFinder getChangeFinder()
FileSystemChangeFinder
member.void invalidateSynchronizationRootsCache(String userName)
getSynchronizationRoots(NuxeoPrincipal)
is called.userName
- the principal name of the user to invalidate the cache for.void invalidateCollectionSyncRootMemberCache(String userName)
getCollectionSyncRootMemberIds(NuxeoPrincipal)
is called.userName
- the principal name of the user to invalidate the cache for.void invalidateCollectionSyncRootMemberCache()
getCollectionSyncRootMemberIds(NuxeoPrincipal)
is called.void addToLocallyEditedCollection(CoreSession session, DocumentModel doc)
DocumentModel
to the #LOCALLY_EDITED_COLLECTION_NAME
collection.Copyright © 2019 Nuxeo. All rights reserved.