public class AuditChangeFinder extends Object implements FileSystemChangeFinder
FileSystemChangeFinder
using the AuditReader
.Modifier and Type | Field and Description |
---|---|
protected Map<String,String> |
parameters |
Constructor and Description |
---|
AuditChangeFinder() |
Modifier and Type | Method and Description |
---|---|
protected long |
getClusteringDelay(Set<String> repositoryNames)
Returns the longest clustering delay among the given repositories for which clustering is enabled.
|
protected String |
getCollectionSyncRootFilteringClause(Set<String> collectionSyncRootMemberIds,
Map<String,Object> params) |
long |
getCurrentDate()
To be deprecated (in fact make throw
UnsupportedOperationException ), keeping for backward compatibility. |
protected String |
getCurrentRootFilteringClause(Set<String> rootPaths,
Map<String,Object> params) |
List<FileSystemItemChange> |
getFileSystemChanges(CoreSession session,
Set<IdRef> lastActiveRootRefs,
SynchronizationRoots activeRoots,
long lastSuccessfulSyncDate,
long syncDate,
int limit)
To be deprecated (in fact make throw
UnsupportedOperationException ), keeping old method based on log date
for backward compatibility. |
protected List<FileSystemItemChange> |
getFileSystemChanges(CoreSession session,
Set<IdRef> lastActiveRootRefs,
SynchronizationRoots activeRoots,
Set<String> collectionSyncRootMemberIds,
long lowerBound,
long upperBound,
boolean integerBounds,
int limit) |
List<FileSystemItemChange> |
getFileSystemChangesIntegerBounds(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,
boolean integerBounds,
Map<String,Object> params)
Now using event log id to ensure consistency, see https://jira.nuxeo.com/browse/NXP-14826.
|
long |
getUpperBound()
Return 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.
|
long |
getUpperBound(Set<String> repositoryNames)
Returns the last available log id in the audit log table (primary key) considering events older than the last
clustering invalidation date if clustering is enabled for at least one of the given repositories.
|
void |
handleParameters(Map<String,String> parameters)
Handles the parameters contributed through the
changeFinder contribution. |
protected List<LogEntry> |
queryAuditEntries(CoreSession session,
SynchronizationRoots activeRoots,
Set<String> collectionSyncRootMemberIds,
long lowerBound,
long upperBound,
boolean integerBounds,
int limit) |
protected Map<String,String> parameters
public AuditChangeFinder()
public void handleParameters(Map<String,String> parameters)
FileSystemChangeFinder
changeFinder
contribution.handleParameters
in interface FileSystemChangeFinder
public List<FileSystemItemChange> getFileSystemChanges(CoreSession session, Set<IdRef> lastActiveRootRefs, SynchronizationRoots activeRoots, long lastSuccessfulSyncDate, long syncDate, int limit) throws TooManyChangesException
UnsupportedOperationException
), keeping old method based on log date
for backward compatibility.
Now using event log id for lower and upper bounds to ensure consistency.
getFileSystemChanges
in interface FileSystemChangeFinder
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 rootslastSuccessfulSyncDate
- the last successful synchronization date as measured on the server for this user
device.syncDate
- the current synchronization date (upper bound on the date of the changes to return). This date is
typically obtained by calling FileSystemChangeFinder.getCurrentDate()
limit
- the maximum number of changes to fetchTooManyChangesException
- if the number of changes found has exceeded the limithttps://jira.nuxeo.com/browse/NXP-14826
,
getFileSystemChangesIntegerBounds(CoreSession, Set, SynchronizationRoots, Set, long, long, int)
public List<FileSystemItemChange> getFileSystemChangesIntegerBounds(CoreSession session, Set<IdRef> lastActiveRootRefs, SynchronizationRoots activeRoots, Set<String> collectionSyncRootMemberIds, long lowerBound, long upperBound, int limit) throws TooManyChangesException
FileSystemChangeFinder
getFileSystemChangesIntegerBounds
in interface FileSystemChangeFinder
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 calling #getUpperBound())
limit
- the maximum number of changes to fetchTooManyChangesException
- if the number of changes found has exceeded the limitprotected List<FileSystemItemChange> getFileSystemChanges(CoreSession session, Set<IdRef> lastActiveRootRefs, SynchronizationRoots activeRoots, Set<String> collectionSyncRootMemberIds, long lowerBound, long upperBound, boolean integerBounds, int limit) throws TooManyChangesException
TooManyChangesException
public long getCurrentDate()
UnsupportedOperationException
), keeping for backward compatibility.
Return the current time to query the logDate field of the audit log. This time intentionally truncated to 0 milliseconds to have a consistent behavior across databases.
Should now use last available log id in the audit log table as upper bound.
getCurrentDate
in interface FileSystemChangeFinder
https://jira.nuxeo.com/browse/NXP-14826
,
getUpperBound()
public long getUpperBound()
getUpperBound
in interface FileSystemChangeFinder
public long getUpperBound(Set<String> repositoryNames)
DocumentModel
further fetched from the session using the audit entry doc id is fresh.getUpperBound
in interface FileSystemChangeFinder
protected long getClusteringDelay(Set<String> repositoryNames)
protected List<LogEntry> queryAuditEntries(CoreSession session, SynchronizationRoots activeRoots, Set<String> collectionSyncRootMemberIds, long lowerBound, long upperBound, boolean integerBounds, int limit)
protected String getCurrentRootFilteringClause(Set<String> rootPaths, Map<String,Object> params)
protected String getCollectionSyncRootFilteringClause(Set<String> collectionSyncRootMemberIds, Map<String,Object> params)
protected String getJPARangeClause(long lowerBound, long upperBound, boolean integerBounds, Map<String,Object> params)
Keeping ability to use old clause based on log date for backward compatibility, to be deprecated.
protected FileSystemItemChange getFileSystemItemChange(CoreSession session, DocumentRef docRef, LogEntry entry, String expectedFileSystemItemId)
Copyright © 2018 Nuxeo. All rights reserved.