Interface ReactiveObjectStorageOperations<I,O,D>

Type Parameters:
I - Cloud vendor-specific upload request class or builder.
O - Cloud vendor-specific upload response.
D - Cloud vendor-specific delete response.
All Known Implementing Classes:
AwsS3ReactiveOperations, AzureBlobStorageReactiveOperations, DefaultReactiveObjectStorageOperations, GoogleCloudStorageReactiveOperations, LocalStorageReactiveOperations, OracleCloudStorageReactiveOperations

public interface ReactiveObjectStorageOperations<I,O,D>
Reactive companion interface for object storage operations.

The phase-1 reactive API mirrors ObjectStorageOperations while preserving the existing UploadRequest and ObjectStorageEntry payload abstractions, which are still InputStream-based.

Since:
3.0.0
Author:
Álvaro Sánchez-Mariscal
  • Method Summary

    Modifier and Type
    Method
    Description
    @NonNull org.reactivestreams.Publisher<Void>
    copy(@NonNull String sourceKey, @NonNull String destinationKey)
    Copies an object stored at sourceKey to destinationKey, within the same object storage (bucket/container).
    @NonNull org.reactivestreams.Publisher<D>
    delete(@NonNull String key)
    Deletes an object from the object storage.
    @NonNull org.reactivestreams.Publisher<Boolean>
    exists(@NonNull String key)
    Checks whether an entry with the given key exists in the object storage.
    @NonNull org.reactivestreams.Publisher<Set<String>>
    Lists the objects that exist in the object storage.
    @NonNull org.reactivestreams.Publisher<ListObjectsResponse>
    listObjects(@NonNull ListObjectsRequest request)
    Lists a page of objects that exist in the object storage.
    <E extends ObjectStorageEntry<?>>
    @NonNull org.reactivestreams.Publisher<Optional<E>>
    retrieve(@NonNull String key)
    Gets the object from object storage.
    @NonNull org.reactivestreams.Publisher<UploadResponse<O>>
    upload(@NonNull UploadRequest request)
    Uploads an object to the object storage.
    @NonNull org.reactivestreams.Publisher<UploadResponse<O>>
    upload(@NonNull UploadRequest request, @NonNull Consumer<I> requestConsumer)
    Uploads an object to the object storage.
  • Method Details

    • upload

      @NonNull org.reactivestreams.Publisher<UploadResponse<O>> upload(@NonNull UploadRequest request)
      Uploads an object to the object storage. If there is an existing entry, it will be updated.
      Parameters:
      request - the upload request
      Returns:
      a publisher that emits the upload response
      Throws:
      ObjectStorageException - if there was a failure storing the object
    • upload

      @NonNull org.reactivestreams.Publisher<UploadResponse<O>> upload(@NonNull UploadRequest request, @NonNull Consumer<I> requestConsumer)
      Uploads an object to the object storage. If there is an existing entry, it will be updated.
      Parameters:
      request - the upload request
      requestConsumer - upload request builder consumer
      Returns:
      a publisher that emits the upload response
      Throws:
      ObjectStorageException - if there was a failure storing the object
    • retrieve

      <E extends ObjectStorageEntry<?>> @NonNull org.reactivestreams.Publisher<Optional<E>> retrieve(@NonNull String key)
      Gets the object from object storage.
      Type Parameters:
      E - an instance of ObjectStorageEntry
      Parameters:
      key - the object path in the format /foo/bar/file
      Returns:
      a publisher that emits an optional object storage entry
      Throws:
      ObjectStorageException - if there was a failure retrieving the object
    • delete

      @NonNull org.reactivestreams.Publisher<D> delete(@NonNull String key)
      Deletes an object from the object storage.
      Parameters:
      key - object path in the format /foo/bar/file
      Returns:
      a publisher that emits the cloud vendor-specific delete response
      Throws:
      ObjectStorageException - if there was a failure deleting the object
    • exists

      @NonNull org.reactivestreams.Publisher<Boolean> exists(@NonNull String key)
      Checks whether an entry with the given key exists in the object storage.
      Parameters:
      key - object path in the format /foo/bar/file
      Returns:
      a publisher that emits true if the entry exists, false otherwise
    • listObjects

      @NonNull org.reactivestreams.Publisher<Set<String>> listObjects()
      Lists the objects that exist in the object storage.
      Returns:
      a publisher that emits the full set of keys
    • listObjects

      @NonNull org.reactivestreams.Publisher<ListObjectsResponse> listObjects(@NonNull ListObjectsRequest request)
      Lists a page of objects that exist in the object storage.
      Parameters:
      request - the paginated listing request
      Returns:
      a publisher that emits the current page of object keys
    • copy

      @NonNull org.reactivestreams.Publisher<Void> copy(@NonNull String sourceKey, @NonNull String destinationKey)
      Copies an object stored at sourceKey to destinationKey, within the same object storage (bucket/container). If the destination exists, it will be overwritten.
      Parameters:
      sourceKey - the key of the source object
      destinationKey - the key of the destination object
      Returns:
      a completion-only publisher