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 toDataSourceScanner
to allow it to publish Attivio documents. See theSampleDataSourceScanner
andSampleIncrementalDataSourceScanner
SDK examples.
-
-
Method Summary
All Methods Instance Methods Abstract 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
feed(IngestDocument... doc)
Feed one of more documents to Attivio.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.-
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 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
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 aContentPointer
in the indicated document field.- 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
void delete(java.lang.String... docIds) throws AttivioException
Delete 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 AttivioException
Delete 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 AttivioException
Wait 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
-
-