Class MockIngestClient
- java.lang.Object
-
- com.attivio.sdk.test.MockIngestClient
-
- All Implemented Interfaces:
DocumentOutputClient,SecurityFeeder
public class MockIngestClient extends java.lang.Object implements DocumentOutputClient
-
-
Constructor Summary
Constructors Constructor Description MockIngestClient()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbulkUpdate(BulkUpdate message)Sendmessageto AIE.voidclear()booleancontainsDocumentWithId(java.lang.String docId)voiddelete(java.lang.String... ids)Delete a series of documents from AIE by document id.voiddelete(java.util.Collection<java.lang.String> ids)SeeDocumentOutputClient.delete(String...)for documentation.voiddeleteByQuery(java.lang.String queryWorkflows, Query query)Delete all documents that match theQuery.voiddeletePrincipal(AttivioPrincipalKey key)Deletes a principal from the index.voidendMessageGroup()Ends the current message group (if any).voidfeed(IngestDocument... docs)Senddocsto AIE.voidfeed(IngestDocument doc, AttivioAcl acl)Sendsdocto the document receiver with the given ACL.voidfeed(AttivioPrincipal principal)Ingests an AttivioPrincipal.voidfeed(java.lang.Iterable<IngestDocument> docs)Senddocsto AIE.java.util.List<BulkUpdate>getBulkList()java.util.List<IngestDocument>getDocumentList()longgetDocumentsSent()IngestDocumentgetDocumentWithId(java.lang.String docId)booleanisMessageGroupInProgress()voidstartMessageGroup()Starts a group of messages that will be processed together.
-
-
-
Method Detail
-
delete
public void delete(java.lang.String... ids) throws AttivioExceptionDescription copied from interface:DocumentOutputClientDelete a series of documents from AIE by document id.If batching is enabled, then these delete messages will be batched along with any fed documents. If these deletes are meant to apply to uncommitted documents previously fed with this ContentFeeder, then those documents must be committed to the index before this delete is called. When ordered commits is enabled, this entails calling:
contentFeeder.commit(); contentFeeder.waitForCompletion(); contentFeeder.delete("id1",...);When ordered commits is disabled, it entails calling:contentFeeder.waitForCompletion(); contentFeeder.commit(); contentFeeder.waitForCompletion(); contentFeeder.delete("id1",...);- Specified by:
deletein interfaceDocumentOutputClient- Parameters:
ids- The document IDs of the documents to delete.- Throws:
AttivioException- if sending of deletes fails.
-
delete
public void delete(java.util.Collection<java.lang.String> ids) throws AttivioExceptionDescription copied from interface:DocumentOutputClientSeeDocumentOutputClient.delete(String...)for documentation.- Specified by:
deletein interfaceDocumentOutputClient- Throws:
AttivioException
-
deleteByQuery
public void deleteByQuery(java.lang.String queryWorkflows, Query query) throws AttivioExceptionDescription copied from interface:DocumentOutputClientDelete all documents that match theQuery.If documents are currently batched up, then those documents will be sent along with this delete.
Use
DocumentOutputClient.bulkUpdate(BulkUpdate)to feed more complicated delete queries. If these deletes are meant to apply to uncommitted documents previously fed with this ContentFeeder, then those documents must be committed to the index before this delete is called. When ordered commits is enabled, this entails calling:contentFeeder.commit(); contentFeeder.waitForCompletion(); contentFeeder.delete("id1",...);When ordered commits is disabled, it entails calling:contentFeeder.waitForCompletion(); contentFeeder.commit(); contentFeeder.waitForCompletion(); contentFeeder.delete(...);
- Specified by:
deleteByQueryin interfaceDocumentOutputClient- Parameters:
queryWorkflows- the query workflow or null if none neededquery- query to delete by- Throws:
AttivioException
-
bulkUpdate
public void bulkUpdate(BulkUpdate message)
Description copied from interface:DocumentOutputClientSendmessageto AIE.- Specified by:
bulkUpdatein interfaceDocumentOutputClient
-
feed
public void feed(IngestDocument... docs) throws AttivioException
Description copied from interface:DocumentOutputClientSenddocsto AIE.- Specified by:
feedin interfaceDocumentOutputClient- Parameters:
docs- the documents to send.- Throws:
AttivioException
-
feed
public void feed(java.lang.Iterable<IngestDocument> docs) throws AttivioException
Description copied from interface:DocumentOutputClientSenddocsto AIE.- Specified by:
feedin interfaceDocumentOutputClient- Parameters:
docs- the documents to send.- Throws:
AttivioException
-
getDocumentsSent
public long getDocumentsSent()
-
isMessageGroupInProgress
public boolean isMessageGroupInProgress()
- Specified by:
isMessageGroupInProgressin interfaceDocumentOutputClient- Returns:
trueif a message group has been started and not yet ended.
-
startMessageGroup
public void startMessageGroup() throws AttivioExceptionDescription copied from interface:DocumentOutputClientStarts a group of messages that will be processed together. All documents and deletes in the group will be processed together and in the order created. NOTE: failure to end a started message group will cause the last message of the group in progress to not be sent.- Specified by:
startMessageGroupin interfaceDocumentOutputClient- Throws:
AttivioException
-
endMessageGroup
public void endMessageGroup() throws AttivioExceptionDescription copied from interface:DocumentOutputClientEnds the current message group (if any). The next feed or delete will not be part of any group unlessDocumentOutputClient.startMessageGroup()is called again.- Specified by:
endMessageGroupin interfaceDocumentOutputClient- Throws:
AttivioException
-
feed
public void feed(IngestDocument doc, AttivioAcl acl) throws AttivioException
Description copied from interface:SecurityFeederSendsdocto the document receiver with the given ACL.- Specified by:
feedin interfaceSecurityFeeder- Parameters:
doc- the documentacl- the ACL- Throws:
AttivioException
-
feed
public void feed(AttivioPrincipal principal) throws AttivioException
Description copied from interface:SecurityFeederIngests an AttivioPrincipal. Any existing data for the principal and its associations will be deleted.- Specified by:
feedin interfaceSecurityFeeder- Parameters:
principal- the principal- Throws:
AttivioException
-
deletePrincipal
public void deletePrincipal(AttivioPrincipalKey key) throws AttivioException
Description copied from interface:SecurityFeederDeletes a principal from the index.- Specified by:
deletePrincipalin interfaceSecurityFeeder- Parameters:
key- unique ID of the principal- Throws:
AttivioException
-
containsDocumentWithId
public boolean containsDocumentWithId(java.lang.String docId)
-
getDocumentWithId
public IngestDocument getDocumentWithId(java.lang.String docId)
-
getDocumentList
public java.util.List<IngestDocument> getDocumentList()
-
getBulkList
public java.util.List<BulkUpdate> getBulkList()
-
clear
public void clear()
-
-