Package org.nuxeo.drive.service.impl
Class AuditChangeFinder
- java.lang.Object
-
- org.nuxeo.drive.service.impl.AuditChangeFinder
-
- All Implemented Interfaces:
FileSystemChangeFinder
- Direct Known Subclasses:
ESAuditChangeFinder
,MongoDBAuditChangeFinder
public class AuditChangeFinder extends Object implements FileSystemChangeFinder
Implementation ofFileSystemChangeFinder
using theAuditReader
.- Author:
- Antoine Taillefer
-
-
Field Summary
Fields Modifier and Type Field Description protected Map<String,String>
parameters
-
Constructor Summary
Constructors Constructor Description AuditChangeFinder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected String
getCollectionSyncRootFilteringClause(Set<String> collectionSyncRootMemberIds, Map<String,Object> params)
protected String
getCurrentRootFilteringClause(Set<String> rootPaths, Map<String,Object> params)
List<FileSystemItemChange>
getFileSystemChanges(CoreSession session, Set<IdRef> lastActiveRootRefs, SynchronizationRoots activeRoots, Set<String> collectionSyncRootMemberIds, long lowerBound, long upperBound, int limit)
Gets the changes in the repository against which the given session is bound for the given synchronization root paths, between the given lower and upper integer bounds and without exceeding the given limit.protected FileSystemItemChange
getFileSystemItemChange(CoreSession session, DocumentRef docRef, LogEntry entry, String expectedFileSystemItemId)
protected String
getJPARangeClause(long lowerBound, long upperBound, Map<String,Object> params)
Using event log id to ensure consistency, see https://jira.nuxeo.com/browse/NXP-14826.long
getUpperBound()
Returns the last available log id in the audit log table (primary key) to be used as the upper bound of the event log id range clause in the change query.void
handleParameters(Map<String,String> parameters)
Handles the parameters contributed through thechangeFinder
contribution.protected List<LogEntry>
queryAuditEntries(CoreSession session, SynchronizationRoots activeRoots, Set<String> collectionSyncRootMemberIds, long lowerBound, long upperBound, int limit)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.nuxeo.drive.service.FileSystemChangeFinder
getUpperBound
-
-
-
-
Method Detail
-
handleParameters
public void handleParameters(Map<String,String> parameters)
Description copied from interface:FileSystemChangeFinder
Handles the parameters contributed through thechangeFinder
contribution.- Specified by:
handleParameters
in interfaceFileSystemChangeFinder
-
getFileSystemChanges
public List<FileSystemItemChange> getFileSystemChanges(CoreSession session, Set<IdRef> lastActiveRootRefs, SynchronizationRoots activeRoots, Set<String> collectionSyncRootMemberIds, long lowerBound, long upperBound, int limit)
Description copied from interface:FileSystemChangeFinder
Gets the changes in the repository against which the given session is bound for the given synchronization root paths, between the given lower and upper integer bounds and without exceeding the given limit. The change summaries are mapped back to the file system view: the file system items might not always have the same tree layout as the backing documents in the repositories but this is a back-end detail that the client does not have to deal with.- Specified by:
getFileSystemChanges
in interfaceFileSystemChangeFinder
- Parameters:
session
- the session bound to a specific repositorylastActiveRootRefs
- docrefs of the roots as reported by the last successful synchronization (can be empty or null)activeRoots
- the currently active synchronization rootscollectionSyncRootMemberIds
- the collection sync root member idslowerBound
- the lower integer bound of the range clause in the change queryupperBound
- the upper integer bound of the range clause in the change query. This id is typically obtained by callingFileSystemChangeFinder.getUpperBound()
limit
- the maximum number of changes to fetch- Returns:
- the list of document changes
-
getUpperBound
public long getUpperBound()
Returns the last available log id in the audit log table (primary key) to be used as the upper bound of the event log id range clause in the change query.- Specified by:
getUpperBound
in interfaceFileSystemChangeFinder
-
queryAuditEntries
protected List<LogEntry> queryAuditEntries(CoreSession session, SynchronizationRoots activeRoots, Set<String> collectionSyncRootMemberIds, long lowerBound, long upperBound, int limit)
-
getCurrentRootFilteringClause
protected String getCurrentRootFilteringClause(Set<String> rootPaths, Map<String,Object> params)
-
getCollectionSyncRootFilteringClause
protected String getCollectionSyncRootFilteringClause(Set<String> collectionSyncRootMemberIds, Map<String,Object> params)
-
getJPARangeClause
protected String getJPARangeClause(long lowerBound, long upperBound, Map<String,Object> params)
Using event log id to ensure consistency, see https://jira.nuxeo.com/browse/NXP-14826.
-
getFileSystemItemChange
protected FileSystemItemChange getFileSystemItemChange(CoreSession session, DocumentRef docRef, LogEntry entry, String expectedFileSystemItemId)
-
-