Interface MediaStoreDataAsyncClient

  • All Superinterfaces:
    AutoCloseable, AwsClient, SdkAutoCloseable, SdkClient

    @Generated("software.amazon.awssdk:codegen")
    @ThreadSafe
    public interface MediaStoreDataAsyncClient
    extends AwsClient
    Service client for accessing MediaStore Data asynchronously. This can be created using the static builder() method.The asynchronous client performs non-blocking I/O when configured with any SdkAsyncHttpClient supported in the SDK. However, full non-blocking is not guaranteed as the async client may perform blocking calls in some cases such as credentials retrieval and endpoint discovery as part of the async API call.

    An AWS Elemental MediaStore asset is an object, similar to an object in the Amazon S3 service. Objects are the fundamental entities that are stored in AWS Elemental MediaStore.

    • Method Detail

      • deleteObject

        default CompletableFuture<DeleteObjectResponse> deleteObject​(DeleteObjectRequest deleteObjectRequest)

        Deletes an object at the specified path.

        Parameters:
        deleteObjectRequest -
        Returns:
        A Java Future containing the result of the DeleteObject operation returned by the service.
        The CompletableFuture returned by this method can be completed exceptionally with the following exceptions.
        • ContainerNotFoundException The specified container was not found for the specified account.
        • ObjectNotFoundException Could not perform an operation on an object that does not exist.
        • InternalServerErrorException The service is temporarily unavailable.
        • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
        • SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
        • MediaStoreDataException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
        See Also:
        AWS API Documentation
      • deleteObject

        default CompletableFuture<DeleteObjectResponse> deleteObject​(Consumer<DeleteObjectRequest.Builder> deleteObjectRequest)

        Deletes an object at the specified path.


        This is a convenience which creates an instance of the DeleteObjectRequest.Builder avoiding the need to create one manually via DeleteObjectRequest.builder()

        Parameters:
        deleteObjectRequest - A Consumer that will call methods on DeleteObjectRequest.Builder to create a request.
        Returns:
        A Java Future containing the result of the DeleteObject operation returned by the service.
        The CompletableFuture returned by this method can be completed exceptionally with the following exceptions.
        • ContainerNotFoundException The specified container was not found for the specified account.
        • ObjectNotFoundException Could not perform an operation on an object that does not exist.
        • InternalServerErrorException The service is temporarily unavailable.
        • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
        • SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
        • MediaStoreDataException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
        See Also:
        AWS API Documentation
      • describeObject

        default CompletableFuture<DescribeObjectResponse> describeObject​(DescribeObjectRequest describeObjectRequest)

        Gets the headers for an object at the specified path.

        Parameters:
        describeObjectRequest -
        Returns:
        A Java Future containing the result of the DescribeObject operation returned by the service.
        The CompletableFuture returned by this method can be completed exceptionally with the following exceptions.
        • ContainerNotFoundException The specified container was not found for the specified account.
        • ObjectNotFoundException Could not perform an operation on an object that does not exist.
        • InternalServerErrorException The service is temporarily unavailable.
        • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
        • SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
        • MediaStoreDataException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
        See Also:
        AWS API Documentation
      • describeObject

        default CompletableFuture<DescribeObjectResponse> describeObject​(Consumer<DescribeObjectRequest.Builder> describeObjectRequest)

        Gets the headers for an object at the specified path.


        This is a convenience which creates an instance of the DescribeObjectRequest.Builder avoiding the need to create one manually via DescribeObjectRequest.builder()

        Parameters:
        describeObjectRequest - A Consumer that will call methods on DescribeObjectRequest.Builder to create a request.
        Returns:
        A Java Future containing the result of the DescribeObject operation returned by the service.
        The CompletableFuture returned by this method can be completed exceptionally with the following exceptions.
        • ContainerNotFoundException The specified container was not found for the specified account.
        • ObjectNotFoundException Could not perform an operation on an object that does not exist.
        • InternalServerErrorException The service is temporarily unavailable.
        • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
        • SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
        • MediaStoreDataException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
        See Also:
        AWS API Documentation
      • getObject

        default <ReturnT> CompletableFuture<ReturnT> getObject​(GetObjectRequest getObjectRequest,
                                                               AsyncResponseTransformer<GetObjectResponse,​ReturnT> asyncResponseTransformer)

        Downloads the object at the specified path. If the object’s upload availability is set to streaming, AWS Elemental MediaStore downloads the object even if it’s still uploading the object.

        Parameters:
        getObjectRequest -
        asyncResponseTransformer - The response transformer for processing the streaming response in a non-blocking manner. See AsyncResponseTransformer for details on how this callback should be implemented and for links to precanned implementations for common scenarios like downloading to a file. The service documentation for the response content is as follows '

        The bytes of the object.

        '.
        Returns:
        A future to the transformed result of the AsyncResponseTransformer.
        The CompletableFuture returned by this method can be completed exceptionally with the following exceptions.
        • ContainerNotFoundException The specified container was not found for the specified account.
        • ObjectNotFoundException Could not perform an operation on an object that does not exist.
        • RequestedRangeNotSatisfiableException The requested content range is not valid.
        • InternalServerErrorException The service is temporarily unavailable.
        • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
        • SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
        • MediaStoreDataException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
        See Also:
        AWS API Documentation
      • getObject

        default <ReturnT> CompletableFuture<ReturnT> getObject​(Consumer<GetObjectRequest.Builder> getObjectRequest,
                                                               AsyncResponseTransformer<GetObjectResponse,​ReturnT> asyncResponseTransformer)

        Downloads the object at the specified path. If the object’s upload availability is set to streaming, AWS Elemental MediaStore downloads the object even if it’s still uploading the object.


        This is a convenience which creates an instance of the GetObjectRequest.Builder avoiding the need to create one manually via GetObjectRequest.builder()

        Parameters:
        getObjectRequest - A Consumer that will call methods on GetObjectRequest.Builder to create a request.
        asyncResponseTransformer - The response transformer for processing the streaming response in a non-blocking manner. See AsyncResponseTransformer for details on how this callback should be implemented and for links to precanned implementations for common scenarios like downloading to a file. The service documentation for the response content is as follows '

        The bytes of the object.

        '.
        Returns:
        A future to the transformed result of the AsyncResponseTransformer.
        The CompletableFuture returned by this method can be completed exceptionally with the following exceptions.
        • ContainerNotFoundException The specified container was not found for the specified account.
        • ObjectNotFoundException Could not perform an operation on an object that does not exist.
        • RequestedRangeNotSatisfiableException The requested content range is not valid.
        • InternalServerErrorException The service is temporarily unavailable.
        • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
        • SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
        • MediaStoreDataException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
        See Also:
        AWS API Documentation
      • getObject

        default CompletableFuture<GetObjectResponse> getObject​(GetObjectRequest getObjectRequest,
                                                               Path destinationPath)

        Downloads the object at the specified path. If the object’s upload availability is set to streaming, AWS Elemental MediaStore downloads the object even if it’s still uploading the object.

        Parameters:
        getObjectRequest -
        destinationPath - Path to file that response contents will be written to. The file must not exist or this method will throw an exception. If the file is not writable by the current user then an exception will be thrown. The service documentation for the response content is as follows '

        The bytes of the object.

        '.
        Returns:
        A future to the transformed result of the AsyncResponseTransformer.
        The CompletableFuture returned by this method can be completed exceptionally with the following exceptions.
        • ContainerNotFoundException The specified container was not found for the specified account.
        • ObjectNotFoundException Could not perform an operation on an object that does not exist.
        • RequestedRangeNotSatisfiableException The requested content range is not valid.
        • InternalServerErrorException The service is temporarily unavailable.
        • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
        • SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
        • MediaStoreDataException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
        See Also:
        AWS API Documentation
      • getObject

        default CompletableFuture<GetObjectResponse> getObject​(Consumer<GetObjectRequest.Builder> getObjectRequest,
                                                               Path destinationPath)

        Downloads the object at the specified path. If the object’s upload availability is set to streaming, AWS Elemental MediaStore downloads the object even if it’s still uploading the object.


        This is a convenience which creates an instance of the GetObjectRequest.Builder avoiding the need to create one manually via GetObjectRequest.builder()

        Parameters:
        getObjectRequest - A Consumer that will call methods on GetObjectRequest.Builder to create a request.
        destinationPath - Path to file that response contents will be written to. The file must not exist or this method will throw an exception. If the file is not writable by the current user then an exception will be thrown. The service documentation for the response content is as follows '

        The bytes of the object.

        '.
        Returns:
        A future to the transformed result of the AsyncResponseTransformer.
        The CompletableFuture returned by this method can be completed exceptionally with the following exceptions.
        • ContainerNotFoundException The specified container was not found for the specified account.
        • ObjectNotFoundException Could not perform an operation on an object that does not exist.
        • RequestedRangeNotSatisfiableException The requested content range is not valid.
        • InternalServerErrorException The service is temporarily unavailable.
        • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
        • SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
        • MediaStoreDataException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
        See Also:
        AWS API Documentation
      • listItems

        default CompletableFuture<ListItemsResponse> listItems​(ListItemsRequest listItemsRequest)

        Provides a list of metadata entries about folders and objects in the specified folder.

        Parameters:
        listItemsRequest -
        Returns:
        A Java Future containing the result of the ListItems operation returned by the service.
        The CompletableFuture returned by this method can be completed exceptionally with the following exceptions.
        • ContainerNotFoundException The specified container was not found for the specified account.
        • InternalServerErrorException The service is temporarily unavailable.
        • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
        • SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
        • MediaStoreDataException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
        See Also:
        AWS API Documentation
      • listItems

        default CompletableFuture<ListItemsResponse> listItems​(Consumer<ListItemsRequest.Builder> listItemsRequest)

        Provides a list of metadata entries about folders and objects in the specified folder.


        This is a convenience which creates an instance of the ListItemsRequest.Builder avoiding the need to create one manually via ListItemsRequest.builder()

        Parameters:
        listItemsRequest - A Consumer that will call methods on ListItemsRequest.Builder to create a request.
        Returns:
        A Java Future containing the result of the ListItems operation returned by the service.
        The CompletableFuture returned by this method can be completed exceptionally with the following exceptions.
        • ContainerNotFoundException The specified container was not found for the specified account.
        • InternalServerErrorException The service is temporarily unavailable.
        • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
        • SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
        • MediaStoreDataException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
        See Also:
        AWS API Documentation
      • listItemsPaginator

        default ListItemsPublisher listItemsPaginator​(ListItemsRequest listItemsRequest)

        This is a variant of listItems(software.amazon.awssdk.services.mediastoredata.model.ListItemsRequest) operation. The return type is a custom publisher that can be subscribed to request a stream of response pages. SDK will internally handle making service calls for you.

        When the operation is called, an instance of this class is returned. At this point, no service calls are made yet and so there is no guarantee that the request is valid. If there are errors in your request, you will see the failures only after you start streaming the data. The subscribe method should be called as a request to start streaming data. For more info, see Publisher.subscribe(org.reactivestreams.Subscriber). Each call to the subscribe method will result in a new Subscription i.e., a new contract to stream data from the starting request.

        The following are few ways to use the response class:

        1) Using the subscribe helper method
         
         software.amazon.awssdk.services.mediastoredata.paginators.ListItemsPublisher publisher = client.listItemsPaginator(request);
         CompletableFuture<Void> future = publisher.subscribe(res -> { // Do something with the response });
         future.get();
         
         
        2) Using a custom subscriber
         
         software.amazon.awssdk.services.mediastoredata.paginators.ListItemsPublisher publisher = client.listItemsPaginator(request);
         publisher.subscribe(new Subscriber<software.amazon.awssdk.services.mediastoredata.model.ListItemsResponse>() {
         
         public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
         
         
         public void onNext(software.amazon.awssdk.services.mediastoredata.model.ListItemsResponse response) { //... };
         });
         
        As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2.

        Please notice that the configuration of MaxResults won't limit the number of results you get with the paginator. It only limits the number of results in each page.

        Note: If you prefer to have control on service calls, use the listItems(software.amazon.awssdk.services.mediastoredata.model.ListItemsRequest) operation.

        Parameters:
        listItemsRequest -
        Returns:
        A custom publisher that can be subscribed to request a stream of response pages.
        The CompletableFuture returned by this method can be completed exceptionally with the following exceptions.
        • ContainerNotFoundException The specified container was not found for the specified account.
        • InternalServerErrorException The service is temporarily unavailable.
        • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
        • SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
        • MediaStoreDataException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
        See Also:
        AWS API Documentation
      • listItemsPaginator

        default ListItemsPublisher listItemsPaginator​(Consumer<ListItemsRequest.Builder> listItemsRequest)

        This is a variant of listItems(software.amazon.awssdk.services.mediastoredata.model.ListItemsRequest) operation. The return type is a custom publisher that can be subscribed to request a stream of response pages. SDK will internally handle making service calls for you.

        When the operation is called, an instance of this class is returned. At this point, no service calls are made yet and so there is no guarantee that the request is valid. If there are errors in your request, you will see the failures only after you start streaming the data. The subscribe method should be called as a request to start streaming data. For more info, see Publisher.subscribe(org.reactivestreams.Subscriber). Each call to the subscribe method will result in a new Subscription i.e., a new contract to stream data from the starting request.

        The following are few ways to use the response class:

        1) Using the subscribe helper method
         
         software.amazon.awssdk.services.mediastoredata.paginators.ListItemsPublisher publisher = client.listItemsPaginator(request);
         CompletableFuture<Void> future = publisher.subscribe(res -> { // Do something with the response });
         future.get();
         
         
        2) Using a custom subscriber
         
         software.amazon.awssdk.services.mediastoredata.paginators.ListItemsPublisher publisher = client.listItemsPaginator(request);
         publisher.subscribe(new Subscriber<software.amazon.awssdk.services.mediastoredata.model.ListItemsResponse>() {
         
         public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
         
         
         public void onNext(software.amazon.awssdk.services.mediastoredata.model.ListItemsResponse response) { //... };
         });
         
        As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2.

        Please notice that the configuration of MaxResults won't limit the number of results you get with the paginator. It only limits the number of results in each page.

        Note: If you prefer to have control on service calls, use the listItems(software.amazon.awssdk.services.mediastoredata.model.ListItemsRequest) operation.


        This is a convenience which creates an instance of the ListItemsRequest.Builder avoiding the need to create one manually via ListItemsRequest.builder()

        Parameters:
        listItemsRequest - A Consumer that will call methods on ListItemsRequest.Builder to create a request.
        Returns:
        A custom publisher that can be subscribed to request a stream of response pages.
        The CompletableFuture returned by this method can be completed exceptionally with the following exceptions.
        • ContainerNotFoundException The specified container was not found for the specified account.
        • InternalServerErrorException The service is temporarily unavailable.
        • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
        • SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
        • MediaStoreDataException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
        See Also:
        AWS API Documentation
      • putObject

        default CompletableFuture<PutObjectResponse> putObject​(PutObjectRequest putObjectRequest,
                                                               AsyncRequestBody requestBody)

        Uploads an object to the specified path. Object sizes are limited to 25 MB for standard upload availability and 10 MB for streaming upload availability.

        Parameters:
        putObjectRequest -
        requestBody - Functional interface that can be implemented to produce the request content in a non-blocking manner. The size of the content is expected to be known up front. See AsyncRequestBody for specific details on implementing this interface as well as links to precanned implementations for common scenarios like uploading from a file. The service documentation for the request content is as follows '

        The bytes to be stored.

        '
        Returns:
        A Java Future containing the result of the PutObject operation returned by the service.
        The CompletableFuture returned by this method can be completed exceptionally with the following exceptions.
        • ContainerNotFoundException The specified container was not found for the specified account.
        • InternalServerErrorException The service is temporarily unavailable.
        • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
        • SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
        • MediaStoreDataException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
        See Also:
        AWS API Documentation
      • putObject

        default CompletableFuture<PutObjectResponse> putObject​(Consumer<PutObjectRequest.Builder> putObjectRequest,
                                                               AsyncRequestBody requestBody)

        Uploads an object to the specified path. Object sizes are limited to 25 MB for standard upload availability and 10 MB for streaming upload availability.


        This is a convenience which creates an instance of the PutObjectRequest.Builder avoiding the need to create one manually via PutObjectRequest.builder()

        Parameters:
        putObjectRequest - A Consumer that will call methods on PutObjectRequest.Builder to create a request.
        requestBody - Functional interface that can be implemented to produce the request content in a non-blocking manner. The size of the content is expected to be known up front. See AsyncRequestBody for specific details on implementing this interface as well as links to precanned implementations for common scenarios like uploading from a file. The service documentation for the request content is as follows '

        The bytes to be stored.

        '
        Returns:
        A Java Future containing the result of the PutObject operation returned by the service.
        The CompletableFuture returned by this method can be completed exceptionally with the following exceptions.
        • ContainerNotFoundException The specified container was not found for the specified account.
        • InternalServerErrorException The service is temporarily unavailable.
        • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
        • SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
        • MediaStoreDataException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
        See Also:
        AWS API Documentation
      • putObject

        default CompletableFuture<PutObjectResponse> putObject​(PutObjectRequest putObjectRequest,
                                                               Path sourcePath)

        Uploads an object to the specified path. Object sizes are limited to 25 MB for standard upload availability and 10 MB for streaming upload availability.

        Parameters:
        putObjectRequest -
        sourcePath - Path to file containing data to send to the service. File will be read entirely and may be read multiple times in the event of a retry. If the file does not exist or the current user does not have access to read it then an exception will be thrown. The service documentation for the request content is as follows '

        The bytes to be stored.

        '
        Returns:
        A Java Future containing the result of the PutObject operation returned by the service.
        The CompletableFuture returned by this method can be completed exceptionally with the following exceptions.
        • ContainerNotFoundException The specified container was not found for the specified account.
        • InternalServerErrorException The service is temporarily unavailable.
        • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
        • SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
        • MediaStoreDataException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
        See Also:
        AWS API Documentation
      • putObject

        default CompletableFuture<PutObjectResponse> putObject​(Consumer<PutObjectRequest.Builder> putObjectRequest,
                                                               Path sourcePath)

        Uploads an object to the specified path. Object sizes are limited to 25 MB for standard upload availability and 10 MB for streaming upload availability.


        This is a convenience which creates an instance of the PutObjectRequest.Builder avoiding the need to create one manually via PutObjectRequest.builder()

        Parameters:
        putObjectRequest - A Consumer that will call methods on PutObjectRequest.Builder to create a request.
        sourcePath - Path to file containing data to send to the service. File will be read entirely and may be read multiple times in the event of a retry. If the file does not exist or the current user does not have access to read it then an exception will be thrown. The service documentation for the request content is as follows '

        The bytes to be stored.

        '
        Returns:
        A Java Future containing the result of the PutObject operation returned by the service.
        The CompletableFuture returned by this method can be completed exceptionally with the following exceptions.
        • ContainerNotFoundException The specified container was not found for the specified account.
        • InternalServerErrorException The service is temporarily unavailable.
        • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
        • SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
        • MediaStoreDataException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
        See Also:
        AWS API Documentation