29#include <shared_mutex>
31#include <unordered_map>
116 std::function<bool(std::size_t bytes_transferred, std::size_t total_bytes)>;
216 -> VoidResult
override;
226 [[nodiscard]]
auto retrieve(std::string_view sop_instance_uid)
235 [[nodiscard]]
auto remove(std::string_view sop_instance_uid)
236 -> VoidResult
override;
246 [[nodiscard]]
auto exists(std::string_view sop_instance_uid)
const
303 ->
Result<core::dicom_dataset>;
311 [[nodiscard]] auto
get_object_key(std::string_view sop_instance_uid) const
319 [[nodiscard]] auto
bucket_name() const -> const std::
string &;
352 std::string_view series_uid,
353 std::string_view sop_uid) const
361 [[nodiscard]] static auto
sanitize_uid(std::string_view
uid) -> std::
string;
371 const std::vector<std::uint8_t> &data,
380 [[nodiscard]] static auto
matches_query(const core::dicom_dataset &dataset,
381 const core::dicom_dataset &query)
Abstract interface for S3 client operations.
auto build_object_key(std::string_view study_uid, std::string_view series_uid, std::string_view sop_uid) const -> std::string
Build S3 object key for a dataset.
s3_storage(s3_storage &&)=delete
Non-movable (contains mutex)
s3_storage & operator=(s3_storage &&)=delete
auto rebuild_index() -> VoidResult
Rebuild the local index from S3.
auto get_object_key(std::string_view sop_instance_uid) const -> std::string
Get the S3 object key for a SOP Instance UID.
auto store(const core::dicom_dataset &dataset) -> VoidResult override
Store a DICOM dataset to S3.
static auto sanitize_uid(std::string_view uid) -> std::string
Sanitize UID for use in S3 object key.
cloud_storage_config config_
Storage configuration.
auto retrieve(std::string_view sop_instance_uid) -> Result< core::dicom_dataset > override
Retrieve a DICOM dataset by SOP Instance UID.
s3_storage & operator=(const s3_storage &)=delete
auto remove(std::string_view sop_instance_uid) -> VoidResult override
Remove a DICOM object from S3.
auto get_statistics() const -> storage_statistics override
Get storage statistics.
std::unique_ptr< s3_client_interface > client_
S3 client (mock for testing, AWS SDK for production)
auto verify_integrity() -> VoidResult override
Verify storage integrity.
std::shared_mutex mutex_
Mutex for thread-safe access.
s3_storage(const cloud_storage_config &config)
Construct S3 storage with configuration.
auto is_connected() const -> bool
Check S3 connectivity.
auto exists(std::string_view sop_instance_uid) const -> bool override
Check if a DICOM instance exists in S3.
auto retrieve_with_progress(std::string_view sop_instance_uid, progress_callback callback) -> Result< core::dicom_dataset >
Retrieve with progress tracking.
auto store_with_progress(const core::dicom_dataset &dataset, progress_callback callback) -> VoidResult
Store with progress tracking.
auto find(const core::dicom_dataset &query) -> Result< std::vector< core::dicom_dataset > > override
Find DICOM datasets matching query criteria.
auto upload_multipart(const std::string &key, const std::vector< std::uint8_t > &data, progress_callback callback) -> VoidResult
Execute multipart upload for large files.
std::unordered_map< std::string, s3_object_info > index_
Mapping from SOP Instance UID to S3 object info.
s3_storage(const s3_storage &)=delete
Non-copyable (contains mutex)
~s3_storage() override
Destructor.
static auto matches_query(const core::dicom_dataset &dataset, const core::dicom_dataset &query) -> bool
Check if dataset matches query criteria.
auto bucket_name() const -> const std::string &
Get the bucket name.
DICOM Dataset - ordered collection of Data Elements.
std::function< bool(std::size_t bytes_transferred, std::size_t total_bytes)> progress_callback
Callback type for upload/download progress tracking.
Abstract storage interface for DICOM persistent storage backends.
Configuration for S3-compatible cloud storage.
std::string region
AWS region (e.g., "us-east-1", "eu-west-1")
std::string storage_class
Storage class for S3 objects (STANDARD, INTELLIGENT_TIERING, etc.)
std::string secret_access_key
AWS secret access key for authentication.
std::optional< std::string > endpoint_url
Optional custom endpoint URL for MinIO or S3-compatible services If empty, uses the default AWS S3 en...
std::string access_key_id
AWS access key ID for authentication.
std::string bucket_name
S3 bucket name for storing DICOM files.
std::size_t max_connections
Maximum number of concurrent upload connections.
bool enable_encryption
Enable server-side encryption (SSE-S3)
std::size_t part_size
Part size for multipart upload in bytes (default: 10MB)
std::uint32_t request_timeout_ms
Request timeout in milliseconds.
std::uint32_t connect_timeout_ms
Connection timeout in milliseconds.
std::size_t multipart_threshold
Threshold for multipart upload in bytes (default: 100MB) Files larger than this will use multipart up...
Information about an S3 object.
std::string key
S3 object key (path within bucket)
std::string study_instance_uid
Study Instance UID.
std::string etag
ETag for integrity verification.
std::string content_type
Content type.
std::string sop_instance_uid
SOP Instance UID from DICOM metadata.
std::size_t size_bytes
Object size in bytes.
std::string series_instance_uid
Series Instance UID.
Storage statistics structure.