Package org.nuxeo.drive.elasticsearch
Class ESAuditChangeFinder
java.lang.Object
org.nuxeo.drive.service.impl.AuditChangeFinder
org.nuxeo.drive.elasticsearch.ESAuditChangeFinder
- All Implemented Interfaces:
FileSystemChangeFinder
Override the JPA audit based change finder to execute query in ES.
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
- Since:
- 7.3
-
Field Summary
Fields inherited from class org.nuxeo.drive.service.impl.AuditChangeFinder
parameters
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected org.opensearch.index.query.QueryBuilder
buildFilterClauses
(CoreSession session, SynchronizationRoots activeRoots, Set<String> collectionSyncRootMemberIds, long lowerBound, long upperBound) protected ESClient
protected org.opensearch.index.query.TermsQueryBuilder
getCollectionSyncRootClause
(Set<String> collectionSyncRootMemberIds) protected org.opensearch.index.query.BoolQueryBuilder
getCurrentRootsClause
(Set<String> rootPaths) protected org.opensearch.index.query.BoolQueryBuilder
protected String
protected org.opensearch.index.query.BoolQueryBuilder
getEventsClause
(String category, String[] eventIds, boolean shouldMatch) protected org.opensearch.index.query.RangeQueryBuilder
getLogIdBoundsClause
(long lowerBound, long upperBound) long
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.protected void
logSearchRequest
(org.opensearch.action.search.SearchRequest request) protected void
logSearchResponse
(org.opensearch.action.search.SearchResponse response) queryAuditEntries
(CoreSession session, SynchronizationRoots activeRoots, Set<String> collectionSyncRootMemberIds, long lowerBound, long upperBound, int limit) queryESAuditEntries
(CoreSession session, SynchronizationRoots activeRoots, Set<String> collectionSyncRootMemberIds, long lowerBound, long upperBound, int limit) Methods inherited from class org.nuxeo.drive.service.impl.AuditChangeFinder
getCollectionSyncRootFilteringClause, getCurrentRootFilteringClause, getFileSystemChanges, getFileSystemItemChange, getJPARangeClause, handleParameters
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
-
Field Details
-
EVENT_ID
- See Also:
-
-
Constructor Details
-
ESAuditChangeFinder
public ESAuditChangeFinder()
-
-
Method Details
-
queryESAuditEntries
protected List<LogEntry> queryESAuditEntries(CoreSession session, SynchronizationRoots activeRoots, Set<String> collectionSyncRootMemberIds, long lowerBound, long upperBound, int limit) -
buildFilterClauses
protected org.opensearch.index.query.QueryBuilder buildFilterClauses(CoreSession session, SynchronizationRoots activeRoots, Set<String> collectionSyncRootMemberIds, long lowerBound, long upperBound) -
getLogIdBoundsClause
protected org.opensearch.index.query.RangeQueryBuilder getLogIdBoundsClause(long lowerBound, long upperBound) -
getCollectionSyncRootClause
-
getCurrentRootsClause
-
getDriveLogsQueryClause
protected org.opensearch.index.query.BoolQueryBuilder getDriveLogsQueryClause() -
getEventsClause
-
getUpperBound
public long getUpperBound()Description copied from class:AuditChangeFinder
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
- Overrides:
getUpperBound
in classAuditChangeFinder
-
queryAuditEntries
protected List<LogEntry> queryAuditEntries(CoreSession session, SynchronizationRoots activeRoots, Set<String> collectionSyncRootMemberIds, long lowerBound, long upperBound, int limit) - Overrides:
queryAuditEntries
in classAuditChangeFinder
-
getClient
-
getESIndexName
-
logSearchRequest
protected void logSearchRequest(org.opensearch.action.search.SearchRequest request) -
logSearchResponse
protected void logSearchResponse(org.opensearch.action.search.SearchResponse response)
-