Class OracleCloudStorageOperations
java.lang.Object
io.micronaut.objectstorage.oraclecloud.OracleCloudStorageOperations
- All Implemented Interfaces:
ObjectStorageOperations<com.oracle.bmc.objectstorage.requests.PutObjectRequest.Builder, com.oracle.bmc.objectstorage.responses.PutObjectResponse, com.oracle.bmc.objectstorage.responses.DeleteObjectResponse>
@EachBean(OracleCloudStorageConfiguration.class)
@Requires(condition=ToggeableCondition.class) @Requires(beans=OracleCloudStorageConfiguration.class)
public class OracleCloudStorageOperations
extends Object
implements ObjectStorageOperations<com.oracle.bmc.objectstorage.requests.PutObjectRequest.Builder, com.oracle.bmc.objectstorage.responses.PutObjectResponse, com.oracle.bmc.objectstorage.responses.DeleteObjectResponse>
Oracle Cloud implementation of
ObjectStorageOperations.- Since:
- 1.0
- Author:
- Pavol Gressa
-
Constructor Summary
ConstructorsConstructorDescriptionOracleCloudStorageOperations(OracleCloudStorageConfiguration configuration, com.oracle.bmc.objectstorage.ObjectStorage client, com.oracle.bmc.auth.RegionProvider regionProvider) -
Method Summary
Modifier and TypeMethodDescriptionvoidCopies an object stored atsourceKeytodestinationKey, within the same object storage (bucket/container).@NonNull Optional<PresignedUpload> createPresignedUpload(@NonNull CreatePresignedUploadRequest request) Creates a pre-signed upload request for a single object key.@NonNull com.oracle.bmc.objectstorage.responses.DeleteObjectResponseDeletes an object from the object storage.booleanChecks whether an entry with the given key exists in the object storage.protected @NonNull StringgetPreauthenticatedRequestName(@NonNull CreatePresignedUploadRequest request) protected @NonNull URIgetPreauthenticatedRequestUri(@NonNull com.oracle.bmc.objectstorage.model.PreauthenticatedRequest preauthenticatedRequest) protected @NonNull com.oracle.bmc.objectstorage.requests.PutObjectRequest.BuildergetRequestBuilder(@NonNull UploadRequest request) Lists the objects that exist in the object storage.@NonNull ListObjectsResponselistObjects(@NonNull ListObjectsRequest request) Lists a page of objects that exist in the object storage.@NonNull Optional<OracleCloudStorageEntry> Gets the object from object storage.toPortableHeaders(@NonNull CreatePresignedUploadRequest request) @NonNull UploadResponse<com.oracle.bmc.objectstorage.responses.PutObjectResponse> upload(@NonNull UploadRequest request) Uploads an object to the object storage.@NonNull UploadResponse<com.oracle.bmc.objectstorage.responses.PutObjectResponse> upload(@NonNull UploadRequest request, @NonNull Consumer<com.oracle.bmc.objectstorage.requests.PutObjectRequest.Builder> requestConsumer) Uploads an object to the object storage.
-
Constructor Details
-
OracleCloudStorageOperations
public OracleCloudStorageOperations(@Parameter OracleCloudStorageConfiguration configuration, com.oracle.bmc.objectstorage.ObjectStorage client, com.oracle.bmc.auth.RegionProvider regionProvider) - Parameters:
configuration- Oracle Cloud Storage Configurationclient- Object Storage ClientregionProvider- Region provider, to determine the current region
-
-
Method Details
-
upload
public @NonNull UploadResponse<com.oracle.bmc.objectstorage.responses.PutObjectResponse> upload(@NonNull UploadRequest request) Description copied from interface:ObjectStorageOperationsUploads an object to the object storage. If there is an existing entry, it will be updated.- Specified by:
uploadin interfaceObjectStorageOperations<com.oracle.bmc.objectstorage.requests.PutObjectRequest.Builder, com.oracle.bmc.objectstorage.responses.PutObjectResponse, com.oracle.bmc.objectstorage.responses.DeleteObjectResponse>- Parameters:
request- the upload request- Returns:
- the upload response
-
upload
public @NonNull UploadResponse<com.oracle.bmc.objectstorage.responses.PutObjectResponse> upload(@NonNull UploadRequest request, @NonNull Consumer<com.oracle.bmc.objectstorage.requests.PutObjectRequest.Builder> requestConsumer) Description copied from interface:ObjectStorageOperationsUploads an object to the object storage. If there is an existing entry, it will be updated.- Specified by:
uploadin interfaceObjectStorageOperations<com.oracle.bmc.objectstorage.requests.PutObjectRequest.Builder, com.oracle.bmc.objectstorage.responses.PutObjectResponse, com.oracle.bmc.objectstorage.responses.DeleteObjectResponse>- Parameters:
request- the upload requestrequestConsumer- Upload request builder consumer- Returns:
- the upload response
-
retrieve
Description copied from interface:ObjectStorageOperationsGets the object from object storage.- Specified by:
retrievein interfaceObjectStorageOperations<com.oracle.bmc.objectstorage.requests.PutObjectRequest.Builder, com.oracle.bmc.objectstorage.responses.PutObjectResponse, com.oracle.bmc.objectstorage.responses.DeleteObjectResponse>- Parameters:
key- the object path in the format/foo/bar/file- Returns:
- the object, or empty optional if the object does not exist
-
delete
public @NonNull com.oracle.bmc.objectstorage.responses.DeleteObjectResponse delete(@NonNull String key) Description copied from interface:ObjectStorageOperationsDeletes an object from the object storage.- Specified by:
deletein interfaceObjectStorageOperations<com.oracle.bmc.objectstorage.requests.PutObjectRequest.Builder, com.oracle.bmc.objectstorage.responses.PutObjectResponse, com.oracle.bmc.objectstorage.responses.DeleteObjectResponse>- Parameters:
key- object path in the format/foo/bar/file- Returns:
- Cloud vendor-specific delete response.
-
exists
Description copied from interface:ObjectStorageOperationsChecks whether an entry with the given key exists in the object storage.- Specified by:
existsin interfaceObjectStorageOperations<com.oracle.bmc.objectstorage.requests.PutObjectRequest.Builder, com.oracle.bmc.objectstorage.responses.PutObjectResponse, com.oracle.bmc.objectstorage.responses.DeleteObjectResponse>- Parameters:
key- object path in the format/foo/bar/file- Returns:
- true if the entry exists, false otherwise.
-
listObjects
Description copied from interface:ObjectStorageOperationsLists the objects that exist in the object storage.- Specified by:
listObjectsin interfaceObjectStorageOperations<com.oracle.bmc.objectstorage.requests.PutObjectRequest.Builder, com.oracle.bmc.objectstorage.responses.PutObjectResponse, com.oracle.bmc.objectstorage.responses.DeleteObjectResponse>- Returns:
- a list of keys (paths) of the existing objects, if any, or an empty list otherwise.
-
listObjects
Description copied from interface:ObjectStorageOperationsLists a page of objects that exist in the object storage.- Specified by:
listObjectsin interfaceObjectStorageOperations<com.oracle.bmc.objectstorage.requests.PutObjectRequest.Builder, com.oracle.bmc.objectstorage.responses.PutObjectResponse, com.oracle.bmc.objectstorage.responses.DeleteObjectResponse>- Parameters:
request- the paginated listing request- Returns:
- the ordered keys in the current page and an optional continuation token for the next page
-
copy
Description copied from interface:ObjectStorageOperationsCopies an object stored atsourceKeytodestinationKey, within the same object storage (bucket/container). If the destination exists, it will be overwritten.- Specified by:
copyin interfaceObjectStorageOperations<com.oracle.bmc.objectstorage.requests.PutObjectRequest.Builder, com.oracle.bmc.objectstorage.responses.PutObjectResponse, com.oracle.bmc.objectstorage.responses.DeleteObjectResponse>- Parameters:
sourceKey- the key of the source objectdestinationKey- the key of the destination object
-
createPresignedUpload
public @NonNull Optional<PresignedUpload> createPresignedUpload(@NonNull CreatePresignedUploadRequest request) Description copied from interface:ObjectStorageOperationsCreates a pre-signed upload request for a single object key.- Specified by:
createPresignedUploadin interfaceObjectStorageOperations<com.oracle.bmc.objectstorage.requests.PutObjectRequest.Builder, com.oracle.bmc.objectstorage.responses.PutObjectResponse, com.oracle.bmc.objectstorage.responses.DeleteObjectResponse>- Parameters:
request- the pre-signed upload request parameters- Returns:
- the signed upload request, if the provider supports it in the current configuration
-
getRequestBuilder
protected @NonNull com.oracle.bmc.objectstorage.requests.PutObjectRequest.Builder getRequestBuilder(@NonNull UploadRequest request) - Parameters:
request- Upload Request- Returns:
- The Put Object Request Builder
-
getPreauthenticatedRequestName
protected @NonNull String getPreauthenticatedRequestName(@NonNull CreatePresignedUploadRequest request) - Parameters:
request- the pre-signed upload request- Returns:
- the Oracle Cloud pre-authenticated request name
- Since:
- 3.0.0
-
getPreauthenticatedRequestUri
protected @NonNull URI getPreauthenticatedRequestUri(@NonNull com.oracle.bmc.objectstorage.model.PreauthenticatedRequest preauthenticatedRequest) - Parameters:
preauthenticatedRequest- the Oracle Cloud pre-authenticated request- Returns:
- the absolute request URI that clients should replay
- Since:
- 3.0.0
-
toPortableHeaders
protected @NonNull Map<String, List<String>> toPortableHeaders(@NonNull CreatePresignedUploadRequest request) - Parameters:
request- the pre-signed upload request- Returns:
- portable headers that callers should preserve on upload
- Since:
- 3.0.0
-