Class CrawlDocumentRepository
java.lang.Object
ai.pipestream.connector.intake.repository.CrawlDocumentRepository
- All Implemented Interfaces:
io.quarkus.hibernate.orm.panache.PanacheRepository<CrawlDocument>, io.quarkus.hibernate.orm.panache.PanacheRepositoryBase<CrawlDocument, Long>
@ApplicationScoped
public class CrawlDocumentRepository
extends Object
implements io.quarkus.hibernate.orm.panache.PanacheRepository<CrawlDocument>
Repository for crawl document tracking operations.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddeleteBySessionId(String sessionId) Delete all tracked document entries for the given session.findByDocumentId(String documentId) Find all tracked entries referencing the given repository document ID across sessions.findBySessionAndSource(String sessionId, String sourceId) Find a tracked document by session and source ID.findBySessionId(String sessionId) Find all tracked documents for a given session.voidtrackDocument(String sessionId, String sourceId, String documentId) Track a document in a session.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.quarkus.hibernate.orm.panache.PanacheRepositoryBase
count, count, count, count, delete, delete, delete, delete, deleteAll, deleteById, find, find, find, find, find, find, findAll, findAll, findById, findById, findByIdOptional, findByIdOptional, findByIds, flush, getEntityManager, getSession, isPersistent, list, list, list, list, list, list, listAll, listAll, persist, persist, persist, persist, persistAndFlush, stream, stream, stream, stream, stream, stream, streamAll, streamAll, update, update, update
-
Constructor Details
-
CrawlDocumentRepository
public CrawlDocumentRepository()Default constructor for CDI.
-
-
Method Details
-
findBySessionAndSource
Find a tracked document by session and source ID.- Parameters:
sessionId- crawl session identifiersourceId- source-system document identifier- Returns:
- an
Optionalcontaining the tracked document if present; otherwise empty
-
findBySessionId
Find all tracked documents for a given session.- Parameters:
sessionId- crawl session identifier- Returns:
- list of
CrawlDocumententries for the session (possibly empty)
-
findByDocumentId
Find all tracked entries referencing the given repository document ID across sessions.- Parameters:
documentId- repository-assigned document identifier- Returns:
- list of tracking entries that reference the given
documentId(possibly empty)
-
trackDocument
Track a document in a session.Persists a mapping from the connector's
sourceIdto the repositorydocumentIdwithin the givensessionId. Used later for orphan detection and reporting.If a document with the same session and source ID already exists, this method will update the existing record with the new document ID (handles re-uploads gracefully).
- Parameters:
sessionId- crawl session identifiersourceId- source-system document identifierdocumentId- repository-assigned document identifier
-
deleteBySessionId
Delete all tracked document entries for the given session.- Parameters:
sessionId- crawl session identifier
-