Package org.opensearch.common.blobstore
Class EncryptedBlobStore
java.lang.Object
org.opensearch.common.blobstore.EncryptedBlobStore
- All Implemented Interfaces:
Closeable
,AutoCloseable
,BlobStore
The EncryptedBlobStore is a decorator class that wraps an existing BlobStore and provides encryption and decryption
capabilities for the stored data. It uses a CryptoManager to handle encryption and decryption operations based on
the provided CryptoMetadata. The EncryptedBlobStore ensures that all data written to and read from the underlying
BlobStore is encrypted and decrypted transparently.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.opensearch.common.blobstore.BlobStore
BlobStore.Metric
-
Constructor Summary
ConstructorsConstructorDescriptionEncryptedBlobStore
(BlobStore blobStore, CryptoMetadata cryptoMetadata) Constructs an EncryptedBlobStore that wraps the provided BlobStore with encryption capabilities based on the given CryptoMetadata. -
Method Summary
Modifier and TypeMethodDescriptionblobContainer
(BlobPath path) Retrieves a BlobContainer from the underlying BlobStore based on the provided BlobPath.void
close()
Closes the EncryptedBlobStore by decrementing the reference count of the CryptoManager and closing the underlying BlobStore.Retrieves extended statistics about the BlobStore.void
reload
(RepositoryMetadata repositoryMetadata) Reoload blobstore metadatastats()
Retrieves statistics about the BlobStore.
-
Constructor Details
-
EncryptedBlobStore
Constructs an EncryptedBlobStore that wraps the provided BlobStore with encryption capabilities based on the given CryptoMetadata.- Parameters:
blobStore
- The underlying BlobStore to be wrapped and used for storing encrypted data.cryptoMetadata
- The CryptoMetadata containing information about the key provider and settings for encryption.- Throws:
CryptoRegistryException
- If the CryptoManager is not found during encrypted BlobStore creation.
-
-
Method Details
-
blobContainer
Retrieves a BlobContainer from the underlying BlobStore based on the provided BlobPath. The returned BlobContainer is wrapped in an EncryptedBlobContainer to enable transparent encryption and decryption of data.- Specified by:
blobContainer
in interfaceBlobStore
- Parameters:
path
- The BlobPath specifying the location of the BlobContainer.- Returns:
- An EncryptedBlobContainer wrapping the BlobContainer retrieved from the underlying BlobStore.
-
reload
Reoload blobstore metadata -
stats
Retrieves statistics about the BlobStore. Delegates the call to the underlying BlobStore's stats() method. -
extendedStats
Retrieves extended statistics about the BlobStore. Delegates the call to the underlying BlobStore's extendedStats() method.- Specified by:
extendedStats
in interfaceBlobStore
- Returns:
- A map containing extended statistics about the BlobStore.
-
close
Closes the EncryptedBlobStore by decrementing the reference count of the CryptoManager and closing the underlying BlobStore. This ensures proper cleanup of resources.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
- If an I/O error occurs while closing the BlobStore.
-