Document Listeners
Receive notifications when Document batches have been processed.
public interface DocumentListener {
default void documentBatchIngestStarted(List<Document> batch) {};
default void documentBatchIngestFinished(List<Document> batch) {};
default void documentIngestionComplete(List<List<Document>> batch) {};
}AtomicBoolean finishedLoading = new AtomicBoolean(false);
public void doWork() {
byte[] byteArray = file.getContentAsByteArray();
contentRetriever.ingestDocument(fileName, byteArray);
while (!finishedLoading.get()) {
log.info("Still loading...");
Thread.sleep(2500);
}
}
@Override
public void documentIngestionComplete(List<List<Document>> batch) {
log.info("Finished processing demand attachments. Ready to continue.");
finishedLoading.set(true);
}Last updated
Was this helpful?
