Package com.attivio.sdk.connector
Interface DocumentPublisher
-
- All Superinterfaces:
SecurityFeeder
- All Known Implementing Classes:
ConcurrentScannerMessagePublisher,MockPublisher
public interface DocumentPublisher extends SecurityFeeder
This interface is passed toDataSourceScannerto allow it to publish Attivio documents. See theSampleDataSourceScannerandSampleIncrementalDataSourceScannerSDK examples.
-
-
Method Summary
All Methods Instance Methods Abstract 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.voidfeed(IngestDocument... doc)Feed one of more documents to Attivio.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.-
Methods inherited from interface com.attivio.sdk.security.SecurityFeeder
deletePrincipal, feed, feed
-
-
-
-
Method Detail
-
getClientId
java.util.UUID getClientId()
- Returns:
- the clientId used to feed content to Attivio.
-
feed
void feed(IngestDocument... doc) throws AttivioException
Feed one of more documents to Attivio.- 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
void put(IngestDocument doc, java.lang.String fieldName, java.lang.String id, java.io.InputStream is) throws AttivioException
Store the content stream in the content store an put aContentPointerin the indicated document field.- 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
void delete(java.lang.String... docIds) throws AttivioExceptionDelete a list of documents.- Parameters:
docIds- the ids of the documents to delete.- Throws:
AttivioException
-
delete
void delete(java.lang.String queryWorkflow, Query query) throws AttivioExceptionDelete all documents that match a query.- Parameters:
queryWorkflow- to use for query processingquery-- Throws:
AttivioException
-
bulkUpdate
void bulkUpdate(BulkUpdate bulkUpdateMessage) throws AttivioException
Issue a bulk update.- Parameters:
bulkUpdateMessage-- Throws:
AttivioException
-
isStopped
boolean isStopped()
- Returns:
- true if the scan has been stopped by user intervention.
-
waitForCompletion
boolean waitForCompletion(long time) throws AttivioExceptionWait the specified number of milliseconds for all the documents to be processed. A timeout of<=0
means to wait forever.- Parameters:
timeout- max time to wait in milliseconds- Returns:
- true if all document processing message results were received before the timeout.
- Throws:
AttivioException
-
isInTestMode
boolean isInTestMode()
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.- Returns:
- true if running in test mode
-
-