Package com.attivio.connector
Class ConcurrentScannerMessagePublisher
- java.lang.Object
-
- com.attivio.connector.ConcurrentScannerMessagePublisher
-
- All Implemented Interfaces:
DocumentPublisher,SecurityFeeder
public class ConcurrentScannerMessagePublisher extends java.lang.Object implements DocumentPublisher
Synchronizes feeding and content store access to make it suitable for concurrent scanners
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbulkUpdate(BulkUpdate bulkUpdateMessage)Issue a bulk update.voiddelete(java.lang.String... docIds)Delete a list of documents.voiddelete(java.lang.String queryWorkflow, Query query)Delete all documents that match a query.voiddeletePrincipal(AttivioPrincipalKey key)Deletes a principal from the index.voidfeed(IngestDocument... doc)Feed one of more documents to Attivio.voidfeed(IngestDocument doc, AttivioAcl acl)Sendsdocto the document receiver with the given ACL.voidfeed(AttivioPrincipal principal)Ingests an AttivioPrincipal.java.util.UUIDgetClientId()booleanisInTestMode()Test mode is set by the user to quickly test that scanner can connect and fetch data.booleanisStopped()voidput(IngestDocument doc, java.lang.String fieldName, java.lang.String id, java.io.InputStream is)Store the content stream in the content store an put aContentPointerin the indicated document field.booleanwaitForCompletion(long time)Wait the specified number of milliseconds for all the documents to be processed.
-
-
-
Method Detail
-
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
-
getClientId
public java.util.UUID getClientId()
- Specified by:
getClientIdin interfaceDocumentPublisher- Returns:
- the clientId used to feed content to Attivio.
-
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
-
feed
public void feed(IngestDocument... doc) throws AttivioException
Description copied from interface:DocumentPublisherFeed one of more documents to Attivio.- Specified by:
feedin interfaceDocumentPublisher- Parameters:
doc- documents to feed- Throws:
AttivioException- The publisher will throw anAttivioExceptionwith an error code ofConnectorError.CRAWL_STOPPEDif the scanner was stopped by the administrator or the limit on the number of documents was reached - seeAttivioException.getErrorCode(). Exceptions with other error code indicate an error.
-
put
public void put(IngestDocument doc, java.lang.String fieldName, java.lang.String id, java.io.InputStream is) throws AttivioException
Description copied from interface:DocumentPublisherStore the content stream in the content store an put aContentPointerin the indicated document field.- Specified by:
putin interfaceDocumentPublisher- Parameters:
doc- the Attivio document where theContentPointershould be placed.fieldName- to put theContentPointerin.id- An id to identify the content in the content store. Could be any id that will guarantee uniqueness e.g.UUID.randomUUID().is- the stream of content.- Throws:
AttivioException
-
delete
public void delete(java.lang.String... docIds) throws AttivioExceptionDescription copied from interface:DocumentPublisherDelete a list of documents.- Specified by:
deletein interfaceDocumentPublisher- Parameters:
docIds- the ids of the documents to delete.- Throws:
AttivioException
-
delete
public void delete(java.lang.String queryWorkflow, Query query) throws AttivioExceptionDescription copied from interface:DocumentPublisherDelete all documents that match a query.- Specified by:
deletein interfaceDocumentPublisher- Parameters:
queryWorkflow- to use for query processing- Throws:
AttivioException
-
bulkUpdate
public void bulkUpdate(BulkUpdate bulkUpdateMessage) throws AttivioException
Description copied from interface:DocumentPublisherIssue a bulk update.- Specified by:
bulkUpdatein interfaceDocumentPublisher- Throws:
AttivioException
-
isStopped
public boolean isStopped()
- Specified by:
isStoppedin interfaceDocumentPublisher- Returns:
- true if the scan has been stopped by user intervention.
-
waitForCompletion
public boolean waitForCompletion(long time) throws AttivioExceptionDescription copied from interface:DocumentPublisherWait the specified number of milliseconds for all the documents to be processed. A timeout of<=0
means to wait forever.- Specified by:
waitForCompletionin interfaceDocumentPublisher- Returns:
- true if all document processing message results were received before the timeout.
- Throws:
AttivioException
-
isInTestMode
public boolean isInTestMode()
Description copied from interface:DocumentPublisherTest mode is set by the user to quickly test that scanner can connect and fetch data. It is typically used by the scanner to avoid changing the state of incremental scanning when in test mode.- Specified by:
isInTestModein interfaceDocumentPublisher- Returns:
- true if running in test mode
-
-