public interface AuditSearchService
Implement to allow inspection of the AuditEntity
s that have been consumed.
As per AuditConsumer
it is expected that we will have multiple implementations eg:
inspect entities recorded in a relational database
inspect entities recorded in a file
Modifier and Type | Method and Description |
---|---|
long |
count(AuditQuery query) |
default Page<AuditEntity,AuditEntityCursor> |
findBy(AuditQuery query,
PageRequest<AuditEntityCursor> pageRequest)
Use to find
AuditEntity s that have been consumed |
Page<AuditEntity,AuditEntityCursor> |
findBy(AuditQuery query,
PageRequest<AuditEntityCursor> pageRequest,
int scanLimit)
Use to find
AuditEntity s that have been consumed while protecting data store from being overloaded by
expensive queries. |
void |
stream(AuditQuery query,
int offset,
int limit,
Consumer<AuditEntity> consumer)
Searches database for AuditEntities and feeds the results one by one to the consumer
|
@Nonnull default Page<AuditEntity,AuditEntityCursor> findBy(@Nonnull AuditQuery query, @Nonnull PageRequest<AuditEntityCursor> pageRequest) throws TimeoutException
AuditEntity
s that have been consumedquery
- filter the entities to be returned.pageRequest
- specifies which page of entities to be returned.TimeoutException
@Nonnull Page<AuditEntity,AuditEntityCursor> findBy(@Nonnull AuditQuery query, @Nonnull PageRequest<AuditEntityCursor> pageRequest, int scanLimit) throws TimeoutException
AuditEntity
s that have been consumed while protecting data store from being overloaded by
expensive queries.query
- filter the entities to be returned.pageRequest
- specifies which page of entities to be returned.scanLimit
- the maximum number of entities to be scanned in the inverse insertion order,
the Integer.MAX_VALUE which means there is no limit.TimeoutException
void stream(@Nonnull AuditQuery query, int offset, int limit, @Nonnull Consumer<AuditEntity> consumer) throws TimeoutException
query
- to filter the entities being returnedoffset
- number of records to skiplimit
- maximum number of records to produceconsumer
- consumes the AuditEntityTimeoutException
long count(@Nullable AuditQuery query) throws TimeoutException
query
- filter used to search entities, null filter will count all entitiesTimeoutException
Copyright © 2020 Atlassian. All rights reserved.