Search in sources :

Example 11 with SynchronizationRoots

use of org.nuxeo.drive.service.SynchronizationRoots in project nuxeo-drive-server by nuxeo.

the class NuxeoDriveManagerImpl method computeSynchronizationRoots.

protected Map<String, SynchronizationRoots> computeSynchronizationRoots(String query, Principal principal) {
    Map<String, SynchronizationRoots> syncRoots = new HashMap<String, SynchronizationRoots>();
    RepositoryManager repositoryManager = Framework.getService(RepositoryManager.class);
    for (String repositoryName : repositoryManager.getRepositoryNames()) {
        try (CloseableCoreSession session = CoreInstance.openCoreSession(repositoryName, principal)) {
            syncRoots.putAll(queryAndFetchSynchronizationRoots(session, query));
        }
    }
    return syncRoots;
}
Also used : HashMap(java.util.HashMap) CloseableCoreSession(org.nuxeo.ecm.core.api.CloseableCoreSession) SynchronizationRoots(org.nuxeo.drive.service.SynchronizationRoots) RepositoryManager(org.nuxeo.ecm.core.api.repository.RepositoryManager)

Aggregations

SynchronizationRoots (org.nuxeo.drive.service.SynchronizationRoots)11 IdRef (org.nuxeo.ecm.core.api.IdRef)8 ArrayList (java.util.ArrayList)7 NuxeoDriveManager (org.nuxeo.drive.service.NuxeoDriveManager)6 CloseableCoreSession (org.nuxeo.ecm.core.api.CloseableCoreSession)6 DocumentModel (org.nuxeo.ecm.core.api.DocumentModel)6 HashMap (java.util.HashMap)4 FileSystemItem (org.nuxeo.drive.adapter.FileSystemItem)4 Map (java.util.Map)3 LinkedHashSet (java.util.LinkedHashSet)2 FileSystemItemChange (org.nuxeo.drive.service.FileSystemItemChange)2 TooManyChangesException (org.nuxeo.drive.service.TooManyChangesException)2 Serializable (java.io.Serializable)1 HashSet (java.util.HashSet)1 List (java.util.List)1 Set (java.util.Set)1 TreeSet (java.util.TreeSet)1 HttpServletRequest (javax.servlet.http.HttpServletRequest)1 Path (org.nuxeo.common.utils.Path)1 FileSystemChangeSummary (org.nuxeo.drive.service.FileSystemChangeSummary)1