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 void
bulkUpdate(BulkUpdate bulkUpdateMessage)
Issue a bulk update.void
delete(java.lang.String... docIds)
Delete a list of documents.void
delete(java.lang.String queryWorkflow, Query query)
Delete all documents that match a query.void
deletePrincipal(AttivioPrincipalKey key)
Deletes a principal from the index.void
feed(IngestDocument... doc)
Feed one of more documents to Attivio.void
feed(IngestDocument doc, AttivioAcl acl)
Sendsdoc
to the document receiver with the given ACL.void
feed(AttivioPrincipal principal)
Ingests an AttivioPrincipal.java.util.UUID
getClientId()
boolean
isInTestMode()
Test mode is set by the user to quickly test that scanner can connect and fetch data.boolean
isStopped()
void
put(IngestDocument doc, java.lang.String fieldName, java.lang.String id, java.io.InputStream is)
Store the content stream in the content store an put aContentPointer
in the indicated document field.boolean
waitForCompletion(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:SecurityFeeder
Sendsdoc
to the document receiver with the given ACL.- Specified by:
feed
in interfaceSecurityFeeder
- Parameters:
doc
- the documentacl
- the ACL- Throws:
AttivioException
-
feed
public void feed(AttivioPrincipal principal) throws AttivioException
Description copied from interface:SecurityFeeder
Ingests an AttivioPrincipal. Any existing data for the principal and its associations will be deleted.- Specified by:
feed
in interfaceSecurityFeeder
- Parameters:
principal
- the principal- Throws:
AttivioException
-
getClientId
public java.util.UUID getClientId()
- Specified by:
getClientId
in interfaceDocumentPublisher
- Returns:
- the clientId used to feed content to Attivio.
-
deletePrincipal
public void deletePrincipal(AttivioPrincipalKey key) throws AttivioException
Description copied from interface:SecurityFeeder
Deletes a principal from the index.- Specified by:
deletePrincipal
in interfaceSecurityFeeder
- Parameters:
key
- unique ID of the principal- Throws:
AttivioException
-
feed
public void feed(IngestDocument... doc) throws AttivioException
Description copied from interface:DocumentPublisher
Feed one of more documents to Attivio.- Specified by:
feed
in interfaceDocumentPublisher
- Parameters:
doc
- documents to feed- Throws:
AttivioException
- The publisher will throw anAttivioException
with an error code ofConnectorError.CRAWL_STOPPED
if 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:DocumentPublisher
Store the content stream in the content store an put aContentPointer
in the indicated document field.- Specified by:
put
in interfaceDocumentPublisher
- Parameters:
doc
- the Attivio document where theContentPointer
should be placed.fieldName
- to put theContentPointer
in.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 AttivioException
Description copied from interface:DocumentPublisher
Delete a list of documents.- Specified by:
delete
in interfaceDocumentPublisher
- Parameters:
docIds
- the ids of the documents to delete.- Throws:
AttivioException
-
delete
public void delete(java.lang.String queryWorkflow, Query query) throws AttivioException
Description copied from interface:DocumentPublisher
Delete all documents that match a query.- Specified by:
delete
in interfaceDocumentPublisher
- Parameters:
queryWorkflow
- to use for query processing- Throws:
AttivioException
-
bulkUpdate
public void bulkUpdate(BulkUpdate bulkUpdateMessage) throws AttivioException
Description copied from interface:DocumentPublisher
Issue a bulk update.- Specified by:
bulkUpdate
in interfaceDocumentPublisher
- Throws:
AttivioException
-
isStopped
public boolean isStopped()
- Specified by:
isStopped
in interfaceDocumentPublisher
- Returns:
- true if the scan has been stopped by user intervention.
-
waitForCompletion
public boolean waitForCompletion(long time) throws AttivioException
Description copied from interface:DocumentPublisher
Wait the specified number of milliseconds for all the documents to be processed. A timeout of<=0
means to wait forever.- Specified by:
waitForCompletion
in interfaceDocumentPublisher
- Returns:
- true if all document processing message results were received before the timeout.
- Throws:
AttivioException
-
isInTestMode
public boolean isInTestMode()
Description copied from interface:DocumentPublisher
Test 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:
isInTestMode
in interfaceDocumentPublisher
- Returns:
- true if running in test mode
-
-