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 TypeMethodDescription@NonNull org.reactivestreams.Publisher<Void> Copies an object stored atsourceKeytodestinationKey, within the same object storage (bucket/container).@NonNull org.reactivestreams.Publisher<D> Deletes an object from the object storage.@NonNull org.reactivestreams.Publisher<Boolean> Checks whether an entry with the given key exists in the object storage.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>> 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
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 requestrequestConsumer- 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 ofObjectStorageEntry- 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
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
-
listObjects
-
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 atsourceKeytodestinationKey, within the same object storage (bucket/container). If the destination exists, it will be overwritten.- Parameters:
sourceKey- the key of the source objectdestinationKey- the key of the destination object- Returns:
- a completion-only publisher
-