public interface NuxeoDriveManager
Modifier and Type | Field and Description |
---|---|
static String |
LOCALLY_EDITED_COLLECTION_NAME |
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(Principal principal,
Map<String,Set<IdRef>> lastSyncRootRefs,
long lastSuccessfulSync)
Gets a summary of document changes in all repositories for the given user's synchronization roots, since the
user's device last successful synchronization date.
|
FileSystemChangeSummary |
getChangeSummaryIntegerBounds(Principal 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(Principal 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(Principal 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(Principal) 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(Principal) is called. |
void |
invalidateSynchronizationRootsCache(String userName)
Invalidate the synchronization roots cache for a given user so as to query the repository next time
getSynchronizationRoots(Principal) is called. |
boolean |
isSynchronizationRoot(Principal principal,
DocumentModel doc)
Checks if the given
DocumentModel is a synchronization root for the given user. |
void |
registerSynchronizationRoot(Principal principal,
DocumentModel newRootContainer,
CoreSession session) |
void |
setChangeFinder(FileSystemChangeFinder changeFinder)
Sets the
FileSystemChangeFinder member. |
void |
unregisterSynchronizationRoot(Principal principal,
DocumentModel rootContainer,
CoreSession session) |
static final String LOCALLY_EDITED_COLLECTION_NAME
void registerSynchronizationRoot(Principal principal, DocumentModel newRootContainer, CoreSession session) throws ClientException
principal
- the Nuxeo Drive usernewRootContainer
- the folderish document to be used as synchronization root: must be bound to an active
sessionClientException
SecurityException
- if the user does not have write permissions to the container.void unregisterSynchronizationRoot(Principal principal, DocumentModel rootContainer, CoreSession session) throws ClientException
principal
- the Nuxeo Drive userrootContainer
- the folderish document that should no longer be used as a synchronization rootClientException
Set<IdRef> getSynchronizationRootReferences(CoreSession session) throws ClientException
session
- active CoreSession instance to the repository hosting the roots.ClientException
#getSynchronizationRootPaths(String, CoreSession)
Map<String,SynchronizationRoots> getSynchronizationRoots(Principal principal) throws ClientException
principal
- the user to fetch the roots forClientException
Map<String,Set<String>> getCollectionSyncRootMemberIds(Principal principal) throws ClientException
principal
- the user to fetch the ids forClientException
boolean isSynchronizationRoot(Principal principal, DocumentModel doc) throws ClientException
DocumentModel
is a synchronization root for the given user.ClientException
void handleFolderDeletion(IdRef ref) throws ClientException
ClientException
FileSystemChangeSummary getChangeSummary(Principal principal, Map<String,Set<IdRef>> lastSyncRootRefs, long lastSuccessfulSync) throws ClientException
The summary includes:
principal
- lastSyncRootRefs
- the map keyed by repository names of document refs for the synchronization roots that
were active during last synchronizationlastSuccessfulSync
- the last successful synchronization date of the user's device. This time is expected to
be in milliseconds since 1970-01-01 UTC as measured on the Nuxeo server clock, typically set to the
value returned by FileSystemChangeSummary.getSyncDate()
of the previous call to
getChangeSummary(Principal, Map, long)
or 0 for catching every event since
the repository initialization.ClientException
FileSystemChangeSummary getChangeSummaryIntegerBounds(Principal principal, Map<String,Set<IdRef>> lastSyncRootRefs, long lowerBound) throws ClientException
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
getChangeSummaryIntegerBounds(Principal, Map, long)
or 0 for catching every
event since the repository initialization.ClientException
FileSystemChangeFinder getChangeFinder()
FileSystemChangeFinder
member.void setChangeFinder(FileSystemChangeFinder changeFinder)
FileSystemChangeFinder
member.
TODO: make it overridable with an extension point and remove setter.
void invalidateSynchronizationRootsCache(String userName)
getSynchronizationRoots(Principal)
is called.userName
- the principal name of the user to invalidate the cache for.void invalidateCollectionSyncRootMemberCache(String userName)
getCollectionSyncRootMemberIds(Principal)
is called.userName
- the principal name of the user to invalidate the cache for.void invalidateCollectionSyncRootMemberCache()
getCollectionSyncRootMemberIds(Principal)
is called.void addToLocallyEditedCollection(CoreSession session, DocumentModel doc) throws ClientException
DocumentModel
to the LOCALLY_EDITED_COLLECTION_NAME
collection.ClientException
Copyright © 2015 Nuxeo SA. All rights reserved.