public class ESAuditChangeFinder extends AuditChangeFinder
The structure of the query executed by the AuditChangeFinder
is:
from LogEntry log where log.repositoryId = :repositoryId + AND if ActiveRoots (activeRoots) NOT empty from LogEntry log where log.repositoryId = :repositoryId and ( LIST_DOC_EVENTS_IDS_QUERY and ( ROOT_PATHS or COLECTIONS_PATHS) or (log.category = 'NuxeoDrive' and log.eventId != 'rootUnregistered') ) if ActiveRoots EMPTY: from LogEntry log where log.repositoryId = :repositoryId and ((log.category = 'NuxeoDrive' and log.eventId != 'rootUnregistered')) + AND (log.id > :lowerBound and log.id <= :upperBound) + order by log.repositoryId asc, log.eventDate desc
Modifier and Type | Field and Description |
---|---|
protected ESClient |
esClient |
static org.apache.commons.logging.Log |
log |
parameters
Constructor and Description |
---|
ESAuditChangeFinder() |
Modifier and Type | Method and Description |
---|---|
protected org.elasticsearch.index.query.QueryBuilder |
buildFilterClauses(CoreSession session,
SynchronizationRoots activeRoots,
Set<String> collectionSyncRootMemberIds,
long lowerBound,
long upperBound,
boolean integerBounds,
int limit) |
protected ESClient |
getClient() |
protected org.elasticsearch.index.query.TermsQueryBuilder |
getCollectionSyncRootClause(Set<String> collectionSyncRootMemberIds) |
protected org.elasticsearch.index.query.BoolQueryBuilder |
getCurrentRootsClause(Set<String> rootPaths) |
protected org.elasticsearch.index.query.BoolQueryBuilder |
getDriveLogsQueryClause() |
protected String |
getESIndexName() |
protected org.elasticsearch.index.query.BoolQueryBuilder |
getEventsClause(String category,
String[] eventIds,
boolean shouldMatch) |
protected org.elasticsearch.index.query.RangeQueryBuilder |
getLogIdBoundsClause(long lowerBound,
long upperBound) |
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 index considering events older than the last clustering
invalidation date if clustering is enabled for at least one of the given repositories.
|
protected void |
logSearchRequest(org.elasticsearch.action.search.SearchRequest request) |
protected void |
logSearchResponse(org.elasticsearch.action.search.SearchResponse response) |
protected List<LogEntry> |
queryAuditEntries(CoreSession session,
SynchronizationRoots activeRoots,
Set<String> collectionSyncRootMemberIds,
long lowerBound,
long upperBound,
boolean integerBounds,
int limit) |
protected List<LogEntry> |
queryESAuditEntries(CoreSession session,
SynchronizationRoots activeRoots,
Set<String> collectionSyncRootMemberIds,
long lowerBound,
long upperBound,
boolean integerBounds,
int limit) |
getClusteringDelay, getCollectionSyncRootFilteringClause, getCurrentDate, getCurrentRootFilteringClause, getFileSystemChanges, getFileSystemChanges, getFileSystemChangesIntegerBounds, getFileSystemItemChange, getJPARangeClause, handleParameters
public static final org.apache.commons.logging.Log log
public ESAuditChangeFinder()
protected List<LogEntry> queryESAuditEntries(CoreSession session, SynchronizationRoots activeRoots, Set<String> collectionSyncRootMemberIds, long lowerBound, long upperBound, boolean integerBounds, int limit)
protected org.elasticsearch.index.query.QueryBuilder buildFilterClauses(CoreSession session, SynchronizationRoots activeRoots, Set<String> collectionSyncRootMemberIds, long lowerBound, long upperBound, boolean integerBounds, int limit)
protected org.elasticsearch.index.query.RangeQueryBuilder getLogIdBoundsClause(long lowerBound, long upperBound)
protected org.elasticsearch.index.query.TermsQueryBuilder getCollectionSyncRootClause(Set<String> collectionSyncRootMemberIds)
protected org.elasticsearch.index.query.BoolQueryBuilder getCurrentRootsClause(Set<String> rootPaths)
protected org.elasticsearch.index.query.BoolQueryBuilder getDriveLogsQueryClause()
protected org.elasticsearch.index.query.BoolQueryBuilder getEventsClause(String category, String[] eventIds, boolean shouldMatch)
public long getUpperBound()
AuditChangeFinder
getUpperBound
in interface FileSystemChangeFinder
getUpperBound
in class AuditChangeFinder
public long getUpperBound(Set<String> repositoryNames)
DocumentModel
further fetched from the session using the audit entry doc id is fresh.getUpperBound
in interface FileSystemChangeFinder
getUpperBound
in class AuditChangeFinder
protected List<LogEntry> queryAuditEntries(CoreSession session, SynchronizationRoots activeRoots, Set<String> collectionSyncRootMemberIds, long lowerBound, long upperBound, boolean integerBounds, int limit)
queryAuditEntries
in class AuditChangeFinder
protected String getESIndexName()
protected void logSearchRequest(org.elasticsearch.action.search.SearchRequest request)
protected void logSearchResponse(org.elasticsearch.action.search.SearchResponse response)
Copyright © 2018 Nuxeo. All rights reserved.