public class MockIngestAuditApi extends Object implements com.attivio.platform.store.audit.AieSystemAuditApi, AuditReaderApi
AuditWriterApi
and AuditReaderApi
interfaces.Modifier and Type | Class and Description |
---|---|
static class |
MockIngestAuditApi.AuditDetailCollector |
static class |
MockIngestAuditApi.ClientData |
static class |
MockIngestAuditApi.CorrelationIdFilter |
static class |
MockIngestAuditApi.DateFilter |
static class |
MockIngestAuditApi.DocIdCollector |
class |
MockIngestAuditApi.FilteredIterable |
static class |
MockIngestAuditApi.IdFilter |
static class |
MockIngestAuditApi.NoDetailFilter |
static class |
MockIngestAuditApi.ResultCodeFilter |
static class |
MockIngestAuditApi.SequenceIdFilter |
Modifier and Type | Field and Description |
---|---|
static Map<UUID,MockIngestAuditApi.ClientData> |
clientMap |
UNAVAILABLE
Constructor and Description |
---|
MockIngestAuditApi() |
Modifier and Type | Method and Description |
---|---|
long |
audit(AuditDetail detail)
Writes the audit information to the store.
|
long |
audit(List<AuditDetail> details)
Writes a batch of audit information to the store.
|
void |
clientHeartbeat(UUID clientId)
Updates the audit information to show that the client is still active so that the client will continue to be returned by
AuditReaderApi.getActiveClients() . |
void |
clientName(UUID clientId,
String name)
Sets a name to be associated with the client.
|
Iterable<UUID> |
getActiveClients()
Returns the clientIds for all active clients.
|
CloseableIterable<AuditDetail> |
getAll(UUID clientId,
long startSeq,
long count) |
Iterable<AuditDetail> |
getAuditDetails(String docId,
Date start,
Date end)
Returns an
Iterable of AuditDetail s associated with the document. |
Iterable<AuditDetail> |
getAuditDetails(String docId,
UUID clientId)
Returns an
Iterable of AuditDetail s associated with the document. |
Iterable<AuditDetail> |
getByCorrelationId(UUID clientId,
UUID correlationId)
Get all audit details for a document via its
correlationId . |
Iterable<String> |
getCreatedDocuments(Date start,
Date end)
Returns a list of IDs for all documents which were received by the system or created within the system during the specified
date range.
|
Iterable<String> |
getCreatedDocuments(UUID clientId)
Returns a list of IDs for all documents which were received by the system or created within the system by the specified
clientId.
|
Iterable<String> |
getDocuments(EnumSet<ProcessingResultCode> codeSet,
Date start,
Date end)
Returns a list of IDs for all documents for which a
resultCode in codeSet was received at some point during
content processing. |
Iterable<String> |
getDocuments(EnumSet<ProcessingResultCode> codeSet,
UUID clientId)
Returns a list of IDs for all documents for which a
resultCode in codeSet was received at some point during
content processing. |
List<ErrorRow> |
getErrorSummary(UUID clientId) |
Iterable<UUID> |
getInactiveClients()
Returns the clientIds for all inactive clients.
|
long |
getLastLossDetectionSequence(UUID clientId) |
Iterable<AuditDetail> |
getLostDetails(long startSeq,
long endSeq)
Returns all audit detail events that have been flagged as LOST and have a sequence id >=
startSeq and <
endSeq . |
Iterable<String> |
getProcessedDocuments(Date start,
Date end)
Returns a list of IDs for all documents which have completed processing during the specified date range.
|
Iterable<String> |
getProcessedDocuments(UUID clientId)
Returns a list of IDs for all documents which have completed processing which were sent by the specified client.
|
Iterable<String> |
getSearchableDocuments(String indexName,
Date start,
Date end)
Returns an
Iterable of IDs for all documents which became searchable during the specified date range. |
Iterable<String> |
getSearchableDocuments(String indexName,
UUID clientId)
Returns an
Iterable of IDs for all documents that are searchable and were fed by the specified client. |
AuditClientSummary |
getSummary(UUID clientId) |
void |
makeInactive(UUID clientId)
Marks the clientId as inactive.
|
void |
purge(Date start,
Date end)
Purges all audit data within the time range.
|
void |
purge(UUID clientId)
Purges all audit data associated with the client ID.
|
int |
purgeInactiveClients(long lastInactiveTimeToKeep)
Purges the audit data for all clients that are inactive and went inactive before
lastInactiveTimeToKeep |
static void |
reset() |
void |
setLastLossDetectionSequence(UUID clientId,
long seq) |
Iterable<AuditDetail> |
sort(List<AuditDetail> details) |
void |
truncateAll() |
void |
updateSummary(AuditClientSummary summary) |
AuditClientSummary |
waitForCompletion(UUID clientId)
Waits until all documents and messages created by this client have completed processing.
|
AuditClientSummary |
waitForCompletion(UUID clientId,
long timeout)
Waits until all documents and messages created by this client have completed processing.
|
Date |
whenSearchable(String indexName,
UUID clientId)
Returns the earliest date an index commit was received after all documents for the client were indexed.
|
Date |
whenSearchable(String indexName,
UUID clientId,
String docId)
Returns the earliest date an index commit was received after the document was indexed.
|
public static Map<UUID,MockIngestAuditApi.ClientData> clientMap
public static void reset()
public Iterable<String> getCreatedDocuments(Date start, Date end) throws AttivioException
getCreatedDocuments
in interface AuditReaderApi
start
- the inclusive start date.end
- the exclusive end date.AttivioException
- if query cannot be executedpublic Iterable<String> getCreatedDocuments(UUID clientId) throws AttivioException
getCreatedDocuments
in interface AuditReaderApi
clientId
- restricts results to clientId, null
not allowed.AttivioException
- if query cannot be executedpublic Iterable<String> getSearchableDocuments(String indexName, Date start, Date end) throws AttivioException
Iterable
of IDs for all documents which became searchable during the specified date range. Indexed
documents become searchable when an associated commit is received. The component with name <indexName>-content-dispatcher
generates ProcessingResultCode.OK
result codes for each document it sees document it
processes. Once it generates an associated OK
result for a Commit
message, those documents are searchable.
A reference algorithm is to find the latest commit (T1
) that occurred before the start of the time range and the
latest commit (T2
) before the end of the time range. Then any documents that reached the indexer in the time range
T1-T2
are the ones that became searchable.
getSearchableDocuments
in interface AuditReaderApi
indexName
- the name of the index. To look up index related information, the actual Attivio component that interfaces to
the index must be determined. The indexName
is used to compute this component name. This is done by adding
the suffix -content-dispatcher
to the indexName
. Additionally if indexName
does not supply
the workflow where the component is located (specified by a name followed by a .), the default name indexer.
will be prepended.start
- the inclusive start date.end
- the exclusive end date.AttivioException
- if query cannot be executedpublic Iterable<String> getSearchableDocuments(String indexName, UUID clientId) throws AttivioException
Iterable
of IDs for all documents that are searchable and were fed by the specified client. Indexed
documents become searchable when an associated commit is received. The component with name <indexName>-content-dispatcher
generates ProcessingResultCode.OK
result codes for each document it sees document it
processes. Once it generates an associated OK
result for a Commit
message, those documents are searchable.getSearchableDocuments
in interface AuditReaderApi
indexName
- the name of the index. To look up index related information, the actual Attivio component that interfaces to
the index must be determined. The indexName
is used to compute this component name. This is done by adding
the suffix -content-dispatcher
to the indexName
. Additionally if indexName
does not supply
the workflow where the component is located (specified by a name followed by a .), the default name indexer.
will be prepended.clientId
- restricts results to clientId, null
not allowed.AttivioException
- if query cannot be executedpublic Iterable<String> getProcessedDocuments(Date start, Date end) throws AttivioException
AuditDetail
for the document with a resultCode
of ProcessingResultCode.COMPLETED
.getProcessedDocuments
in interface AuditReaderApi
start
- the inclusive start date.end
- the exclusive end date.AttivioException
- if query cannot be executedpublic Iterable<String> getProcessedDocuments(UUID clientId) throws AttivioException
AuditDetail
for the document with a resultCode
of ProcessingResultCode.COMPLETED
.getProcessedDocuments
in interface AuditReaderApi
clientId
- restricts results to clientId, null
not allowed.AttivioException
- if query cannot be executedpublic Iterable<String> getDocuments(EnumSet<ProcessingResultCode> codeSet, UUID clientId) throws AttivioException
resultCode
in codeSet
was received at some point during
content processing. Since there are multiple content processing stages codes may appear multiple times and multiple codes may
match. The returned list will be restricted to documents fed by clientId
.getDocuments
in interface AuditReaderApi
codeSet
- set of result codes to matchclientId
- restricts results to clientId, null
not allowed.Iterable
of document IDs. Document IDs appear at most once.AttivioException
- if query cannot be executedpublic Iterable<String> getDocuments(EnumSet<ProcessingResultCode> codeSet, Date start, Date end) throws AttivioException
resultCode
in codeSet
was received at some point during
content processing. Since there are multiple content processing stages codes may appear multiple times and multiple codes may
match. The returned list will be restricted to documents fed within the specified time range.getDocuments
in interface AuditReaderApi
codeSet
- set of result codes to matchstart
- the inclusive start date.end
- the exclusive end date.Iterable
of document IDs. Document IDs appear at most once.AttivioException
- if query cannot be executedpublic Date whenSearchable(String indexName, UUID clientId, String docId) throws AttivioException
ProcessingResultCode.OK
audit result for the index content dispatcher component (
<indexName>-content-dispatcher
). Documents which are not marked OK
by the indexer are not considered by this
method as they will never become searchable.whenSearchable
in interface AuditReaderApi
indexName
- the name of the index. To look up index related information, the actual Attivio component that interfaces to
the index must be determined. The indexName
is used to compute this component name. This is done by adding
the suffix -content-dispatcher
to the indexName
. Additionally if indexName
does not supply
the workflow where the component is located (specified by a name followed by a .), the default name indexer.
will be prepended.clientId
- restricts results to clientId, null
not allowed.docId
became searchable or null
if not yet searchableAttivioException
- if query cannot be executedpublic Date whenSearchable(String indexName, UUID clientId) throws AttivioException
ProcessingResultCode.OK
audit result for the index content dispatcher
component (<indexName>-content-dispatcher
). Documents which are not marked OK
by the indexer are not
considered by this method as they will never become searchable.whenSearchable
in interface AuditReaderApi
indexName
- the name of the index. To look up index related information, the actual Attivio component that interfaces to
the index must be determined. The indexName
is used to compute this component name. This is done by adding
the suffix -content-dispatcher
to the indexName
. Additionally if indexName
does not supply
the workflow where the component is located (specified by a name followed by a .), the default name indexer.
will be prepended.clientId
- restricts results to clientId, null
not allowed.clientId
became searchable or null
if all
documents are not yet searchable or no documents have been submitted by the client.AttivioException
- if query cannot be executedpublic AuditClientSummary waitForCompletion(UUID clientId) throws AttivioException
waitForCompletion
in interface AuditReaderApi
clientId
- restricts results to clientId, null
not allowed.null
if the client does not exist.AttivioException
- if query cannot be executedpublic AuditClientSummary waitForCompletion(UUID clientId, long timeout) throws AttivioException
waitForCompletion
in interface AuditReaderApi
AuditClientSummary
if waited successfully, null
if timeout occurred or client does not
exist.AttivioException
- if query cannot be executedpublic AuditClientSummary getSummary(UUID clientId) throws AttivioException
getSummary
in interface AuditReaderApi
clientId
- restricts results to clientId, null
not allowed.null
if the client does not exist.AttivioException
- if query cannot be executedpublic long audit(List<AuditDetail> details) throws AttivioException
AuditWriterApi
AuditReaderApi.getActiveClients()
. Note, that if an exception is encountered while
storing the audit information, the rest of the list will still be attempted to be stored. All exceptions encountered while
persisting the list are returned with any exception after the first added as suppressed exceptions of the first.audit
in interface AuditWriterApi
AttivioException
- if the audit information could not be storedpublic long audit(AuditDetail detail) throws AttivioException
AuditWriterApi
AuditReaderApi.getActiveClients()
.audit
in interface AuditWriterApi
AttivioException
- if the audit information could not be storedpublic Iterable<UUID> getActiveClients() throws AttivioException
getActiveClients
in interface AuditReaderApi
AttivioException
public Iterable<UUID> getInactiveClients() throws AttivioException
getInactiveClients
in interface AuditReaderApi
AttivioException
public CloseableIterable<AuditDetail> getAll(UUID clientId, long startSeq, long count) throws AttivioException
getAll
in interface AuditReaderApi
startSeq
- starting sequence ID for responsecount
- the maximum number of audit details to return, use Long.MAX_VALUE
for allAttivioException
public Iterable<AuditDetail> getByCorrelationId(UUID clientId, UUID correlationId) throws AttivioException
correlationId
.getByCorrelationId
in interface AuditReaderApi
AttivioException
public Iterable<AuditDetail> getAuditDetails(String docId, UUID clientId) throws AttivioException
Iterable
of AuditDetail
s associated with the document. This list may include the audit information
for a number of components and will include the creation and completion audit records if available. This method may be called
while the document is still being processed.getAuditDetails
in interface AuditReaderApi
docId
- the document ID to matchclientId
- restricts results to clientId, null
not allowed.AttivioException
- if query cannot be executedpublic Iterable<AuditDetail> getAuditDetails(String docId, Date start, Date end) throws AttivioException
Iterable
of AuditDetail
s associated with the document. This list may include the audit information
for a number of components and will include the creation and completion audit records if available. This method may be called
while the document is still being processed. null
values for start
and end
will return all available
audit records for the document.getAuditDetails
in interface AuditReaderApi
docId
- the document ID to matchstart
- the inclusive start date.end
- the exclusive end date.AttivioException
- if query cannot be executedpublic Iterable<AuditDetail> getLostDetails(long startSeq, long endSeq) throws AttivioException
AuditReaderApi
startSeq
and <
endSeq
.
NOTE: this method is used internally to replay LOST messages for fault tolerance.
getLostDetails
in interface AuditReaderApi
AttivioException
public Iterable<AuditDetail> sort(List<AuditDetail> details)
public void makeInactive(UUID clientId) throws AttivioException
AuditReaderApi.getActiveClients()
.makeInactive
in interface AuditWriterApi
AttivioException
public void clientHeartbeat(UUID clientId) throws AttivioException
AuditReaderApi.getActiveClients()
.clientHeartbeat
in interface AuditWriterApi
AttivioException
public void clientName(UUID clientId, String name) throws AttivioException
AuditReaderApi.getSummary(UUID)
is
guaranteed to return a non-null
value with clientName and lastActionTime having the value of the set time.clientName
in interface AuditWriterApi
AttivioException
public void purge(UUID clientId) throws AttivioException
AuditWriterApi
purge
in interface AuditWriterApi
clientId
- restricts results to clientId, null
not allowed.AttivioException
public void purge(Date start, Date end) throws AttivioException
AuditWriterApi
start
and end
are both null
, deletes all records and summary records. Otherwise, summary records
are retained. If deleting individual summary records is required, use AuditWriterApi.purge(UUID)
insteadpurge
in interface AuditWriterApi
start
- the inclusive start date.end
- the exclusive end date.AttivioException
public int purgeInactiveClients(long lastInactiveTimeToKeep) throws AttivioException
lastInactiveTimeToKeep
purgeInactiveClients
in interface AuditWriterApi
AttivioException
public void truncateAll() throws AttivioException
truncateAll
in interface com.attivio.platform.store.audit.AieSystemAuditApi
AttivioException
public List<ErrorRow> getErrorSummary(UUID clientId)
getErrorSummary
in interface com.attivio.platform.store.audit.AieSystemAuditApi
public void updateSummary(AuditClientSummary summary) throws AttivioException
updateSummary
in interface com.attivio.platform.store.audit.AieSystemAuditApi
AttivioException
public void setLastLossDetectionSequence(UUID clientId, long seq) throws AttivioException
setLastLossDetectionSequence
in interface com.attivio.platform.store.audit.AieSystemAuditApi
AttivioException
public long getLastLossDetectionSequence(UUID clientId) throws AttivioException
getLastLossDetectionSequence
in interface com.attivio.platform.store.audit.AieSystemAuditApi
AttivioException
Copyright © 2018 Attivio, Inc. All Rights Reserved.
PATENT NOTICE: Attivio, Inc. Software Related Patents. With respect to the Attivio software product(s) being used, the following patents apply: Querying Joined Data Within A Search Engine Index: United States Patent No.(s): 8,073,840. Ordered Processing of Groups of Messages: U.S. Patent No.(s) 8,495,656. Signal processing approach to sentiment analysis for entities in documents: U.S. Patent No.(s) 8,725,494. Other U.S. and International Patents Pending.