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 Details

  • Method Details

    • upload

      @NonNull public @NonNull UploadResponse<com.oracle.bmc.objectstorage.responses.PutObjectResponse> upload(@NonNull @NonNull UploadRequest request)
      Description copied from interface: ObjectStorageOperations
      Uploads an object to the object storage. If there is an existing entry, it will be updated.
      Specified by:
      upload in interface ObjectStorageOperations<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

      @NonNull public @NonNull UploadResponse<com.oracle.bmc.objectstorage.responses.PutObjectResponse> upload(@NonNull @NonNull UploadRequest request, @NonNull @NonNull Consumer<com.oracle.bmc.objectstorage.requests.PutObjectRequest.Builder> requestConsumer)
      Description copied from interface: ObjectStorageOperations
      Uploads an object to the object storage. If there is an existing entry, it will be updated.
      Specified by:
      upload in interface ObjectStorageOperations<com.oracle.bmc.objectstorage.requests.PutObjectRequest.Builder,com.oracle.bmc.objectstorage.responses.PutObjectResponse,com.oracle.bmc.objectstorage.responses.DeleteObjectResponse>
      Parameters:
      request - the upload request
      requestConsumer - Upload request builder consumer
      Returns:
      the upload response
    • retrieve

      @NonNull public @NonNull Optional<OracleCloudStorageEntry> retrieve(@NonNull @NonNull String key)
      Description copied from interface: ObjectStorageOperations
      Gets the object from object storage.
      Specified by:
      retrieve in interface ObjectStorageOperations<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

      @NonNull public @NonNull com.oracle.bmc.objectstorage.responses.DeleteObjectResponse delete(@NonNull @NonNull String key)
      Description copied from interface: ObjectStorageOperations
      Deletes an object from the object storage.
      Specified by:
      delete in interface ObjectStorageOperations<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

      public boolean exists(@NonNull @NonNull String key)
      Description copied from interface: ObjectStorageOperations
      Checks whether an entry with the given key exists in the object storage.
      Specified by:
      exists in interface ObjectStorageOperations<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

      @NonNull public @NonNull Set<String> listObjects()
      Description copied from interface: ObjectStorageOperations
      Lists the objects that exist in the object storage.
      Specified by:
      listObjects in interface ObjectStorageOperations<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.
    • copy

      public void copy(@NonNull @NonNull String sourceKey, @NonNull @NonNull String destinationKey)
      Description copied from interface: ObjectStorageOperations
      Copies an object stored at sourceKey to destinationKey, within the same object storage (bucket/container). If the destination exists, it will be overwritten.
      Specified by:
      copy in interface ObjectStorageOperations<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 object
      destinationKey - the key of the destination object
    • getRequestBuilder

      @NonNull protected com.oracle.bmc.objectstorage.requests.PutObjectRequest.Builder getRequestBuilder(@NonNull @NonNull UploadRequest request)
      Parameters:
      request - Upload Request
      Returns:
      The Put Object Request Builder