Class RepositoryClient

java.lang.Object
ai.pipeline.connector.intake.service.RepositoryClient

@ApplicationScoped public class RepositoryClient extends Object
Client for repository-service integration.

Handles document storage via repository-service's CreateNode RPC.

  • Constructor Details

    • RepositoryClient

      public RepositoryClient()
      Default constructor for CDI.
  • Method Details

    • storeDocument

      public io.smallrye.mutiny.Uni<String> storeDocument(String drive, String connectorId, String name, String path, String contentType, byte[] data, Map<String,String> metadata)
      Store a document in the repository-service.

      Builds a CreateNodeRequest and invokes the filesystem gRPC API to persist content and metadata. A client-side UUID is generated and passed as documentId, but the repository-service may override it. Reactive semantics:

      • Returns a Uni<String> that emits the final document ID upon successful creation.
      • gRPC failures are mapped to io.grpc.StatusRuntimeException with INTERNAL status.
      Side effects: network call to repository-service; content is stored remotely.
      Parameters:
      drive - Drive/bucket name
      connectorId - Connector ID
      name - Document name
      path - Document path (folder-like hierarchy)
      contentType - MIME type of the content
      data - Document content bytes
      metadata - Arbitrary metadata map serialized as JSON
      Returns:
      a Uni emitting the repository-assigned document ID