Interface MediaStoreDataClient
- All Superinterfaces:
AutoCloseable
,AwsClient
,SdkAutoCloseable
,SdkClient
builder()
method.
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.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Value for looking up the service's metadata from theServiceMetadataProvider
.static final String
-
Method Summary
Modifier and TypeMethodDescriptionstatic MediaStoreDataClientBuilder
builder()
Create a builder that can be used to configure and create aMediaStoreDataClient
.static MediaStoreDataClient
create()
Create aMediaStoreDataClient
with the region loaded from theDefaultAwsRegionProviderChain
and credentials loaded from theDefaultCredentialsProvider
.default DeleteObjectResponse
deleteObject
(Consumer<DeleteObjectRequest.Builder> deleteObjectRequest) Deletes an object at the specified path.default DeleteObjectResponse
deleteObject
(DeleteObjectRequest deleteObjectRequest) Deletes an object at the specified path.default DescribeObjectResponse
describeObject
(Consumer<DescribeObjectRequest.Builder> describeObjectRequest) Gets the headers for an object at the specified path.default DescribeObjectResponse
describeObject
(DescribeObjectRequest describeObjectRequest) Gets the headers for an object at the specified path.default ResponseInputStream
<GetObjectResponse> getObject
(Consumer<GetObjectRequest.Builder> getObjectRequest) Downloads the object at the specified path.default GetObjectResponse
getObject
(Consumer<GetObjectRequest.Builder> getObjectRequest, Path destinationPath) Downloads the object at the specified path.default <ReturnT> ReturnT
getObject
(Consumer<GetObjectRequest.Builder> getObjectRequest, ResponseTransformer<GetObjectResponse, ReturnT> responseTransformer) Downloads the object at the specified path.default ResponseInputStream
<GetObjectResponse> getObject
(GetObjectRequest getObjectRequest) Downloads the object at the specified path.default GetObjectResponse
getObject
(GetObjectRequest getObjectRequest, Path destinationPath) Downloads the object at the specified path.default <ReturnT> ReturnT
getObject
(GetObjectRequest getObjectRequest, ResponseTransformer<GetObjectResponse, ReturnT> responseTransformer) Downloads the object at the specified path.default ResponseBytes
<GetObjectResponse> getObjectAsBytes
(Consumer<GetObjectRequest.Builder> getObjectRequest) Downloads the object at the specified path.default ResponseBytes
<GetObjectResponse> getObjectAsBytes
(GetObjectRequest getObjectRequest) Downloads the object at the specified path.default ListItemsResponse
listItems
(Consumer<ListItemsRequest.Builder> listItemsRequest) Provides a list of metadata entries about folders and objects in the specified folder.default ListItemsResponse
listItems
(ListItemsRequest listItemsRequest) Provides a list of metadata entries about folders and objects in the specified folder.default ListItemsIterable
listItemsPaginator
(Consumer<ListItemsRequest.Builder> listItemsRequest) This is a variant oflistItems(software.amazon.awssdk.services.mediastoredata.model.ListItemsRequest)
operation.default ListItemsIterable
listItemsPaginator
(ListItemsRequest listItemsRequest) This is a variant oflistItems(software.amazon.awssdk.services.mediastoredata.model.ListItemsRequest)
operation.default PutObjectResponse
putObject
(Consumer<PutObjectRequest.Builder> putObjectRequest, Path sourcePath) Uploads an object to the specified path.default PutObjectResponse
putObject
(Consumer<PutObjectRequest.Builder> putObjectRequest, RequestBody requestBody) Uploads an object to the specified path.default PutObjectResponse
putObject
(PutObjectRequest putObjectRequest, Path sourcePath) Uploads an object to the specified path.default PutObjectResponse
putObject
(PutObjectRequest putObjectRequest, RequestBody requestBody) Uploads an object to the specified path.The SDK service client configuration exposes client settings to the user, e.g., ClientOverrideConfigurationstatic ServiceMetadata
Methods inherited from interface software.amazon.awssdk.utils.SdkAutoCloseable
close
Methods inherited from interface software.amazon.awssdk.core.SdkClient
serviceName
-
Field Details
-
SERVICE_NAME
- See Also:
-
SERVICE_METADATA_ID
Value for looking up the service's metadata from theServiceMetadataProvider
.- See Also:
-
-
Method Details
-
deleteObject
default DeleteObjectResponse deleteObject(DeleteObjectRequest deleteObjectRequest) throws ContainerNotFoundException, ObjectNotFoundException, InternalServerErrorException, AwsServiceException, SdkClientException, MediaStoreDataException Deletes an object at the specified path.
- Parameters:
deleteObjectRequest
-- Returns:
- Result of the DeleteObject operation returned by the service.
- See Also:
-
deleteObject
default DeleteObjectResponse deleteObject(Consumer<DeleteObjectRequest.Builder> deleteObjectRequest) throws ContainerNotFoundException, ObjectNotFoundException, InternalServerErrorException, AwsServiceException, SdkClientException, MediaStoreDataException 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 viaDeleteObjectRequest.builder()
- Parameters:
deleteObjectRequest
- AConsumer
that will call methods onDeleteObjectRequest.Builder
to create a request.- Returns:
- Result of the DeleteObject operation returned by the service.
- See Also:
-
describeObject
default DescribeObjectResponse describeObject(DescribeObjectRequest describeObjectRequest) throws ContainerNotFoundException, ObjectNotFoundException, InternalServerErrorException, AwsServiceException, SdkClientException, MediaStoreDataException Gets the headers for an object at the specified path.
- Parameters:
describeObjectRequest
-- Returns:
- Result of the DescribeObject operation returned by the service.
- See Also:
-
describeObject
default DescribeObjectResponse describeObject(Consumer<DescribeObjectRequest.Builder> describeObjectRequest) throws ContainerNotFoundException, ObjectNotFoundException, InternalServerErrorException, AwsServiceException, SdkClientException, MediaStoreDataException 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 viaDescribeObjectRequest.builder()
- Parameters:
describeObjectRequest
- AConsumer
that will call methods onDescribeObjectRequest.Builder
to create a request.- Returns:
- Result of the DescribeObject operation returned by the service.
- See Also:
-
getObject
default <ReturnT> ReturnT getObject(GetObjectRequest getObjectRequest, ResponseTransformer<GetObjectResponse, ReturnT> responseTransformer) throws ContainerNotFoundException, ObjectNotFoundException, RequestedRangeNotSatisfiableException, InternalServerErrorException, AwsServiceException, SdkClientException, MediaStoreDataExceptionDownloads 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
-responseTransformer
- Functional interface for processing the streamed response content. The unmarshalled GetObjectResponse and an InputStream to the response content are provided as parameters to the callback. The callback may return a transformed type which will be the return value of this method. SeeResponseTransformer
for details on implementing this interface and for links to pre-canned 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:
- The transformed result of the ResponseTransformer.
- See Also:
-
getObject
default <ReturnT> ReturnT getObject(Consumer<GetObjectRequest.Builder> getObjectRequest, ResponseTransformer<GetObjectResponse, ReturnT> responseTransformer) throws ContainerNotFoundException, ObjectNotFoundException, RequestedRangeNotSatisfiableException, InternalServerErrorException, AwsServiceException, SdkClientException, MediaStoreDataExceptionDownloads 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 viaGetObjectRequest.builder()
- Parameters:
getObjectRequest
- AConsumer
that will call methods onGetObjectRequest.Builder
to create a request.responseTransformer
- Functional interface for processing the streamed response content. The unmarshalled GetObjectResponse and an InputStream to the response content are provided as parameters to the callback. The callback may return a transformed type which will be the return value of this method. SeeResponseTransformer
for details on implementing this interface and for links to pre-canned 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:
- The transformed result of the ResponseTransformer.
- See Also:
-
getObject
default GetObjectResponse getObject(GetObjectRequest getObjectRequest, Path destinationPath) throws ContainerNotFoundException, ObjectNotFoundException, RequestedRangeNotSatisfiableException, InternalServerErrorException, AwsServiceException, SdkClientException, MediaStoreDataException 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:
- The transformed result of the ResponseTransformer.
- See Also:
-
getObject
default GetObjectResponse getObject(Consumer<GetObjectRequest.Builder> getObjectRequest, Path destinationPath) throws ContainerNotFoundException, ObjectNotFoundException, RequestedRangeNotSatisfiableException, InternalServerErrorException, AwsServiceException, SdkClientException, MediaStoreDataException 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 viaGetObjectRequest.builder()
- Parameters:
getObjectRequest
- AConsumer
that will call methods onGetObjectRequest.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:
- The transformed result of the ResponseTransformer.
- See Also:
-
getObject
default ResponseInputStream<GetObjectResponse> getObject(GetObjectRequest getObjectRequest) throws ContainerNotFoundException, ObjectNotFoundException, RequestedRangeNotSatisfiableException, InternalServerErrorException, AwsServiceException, SdkClientException, MediaStoreDataException 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
-- Returns:
- A
ResponseInputStream
containing data streamed from service. Note that this is an unmanaged reference to the underlying HTTP connection so great care must be taken to ensure all data if fully read from the input stream and that it is properly closed. Failure to do so may result in sub-optimal behavior and exhausting connections in the connection pool. The unmarshalled response object can be obtained viaResponseInputStream.response()
. The service documentation for the response content is as follows 'The bytes of the object.
'. - See Also:
-
getObject
default ResponseInputStream<GetObjectResponse> getObject(Consumer<GetObjectRequest.Builder> getObjectRequest) throws ContainerNotFoundException, ObjectNotFoundException, RequestedRangeNotSatisfiableException, InternalServerErrorException, AwsServiceException, SdkClientException, MediaStoreDataException 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 viaGetObjectRequest.builder()
- Parameters:
getObjectRequest
- AConsumer
that will call methods onGetObjectRequest.Builder
to create a request.- Returns:
- A
ResponseInputStream
containing data streamed from service. Note that this is an unmanaged reference to the underlying HTTP connection so great care must be taken to ensure all data if fully read from the input stream and that it is properly closed. Failure to do so may result in sub-optimal behavior and exhausting connections in the connection pool. The unmarshalled response object can be obtained viaResponseInputStream.response()
. The service documentation for the response content is as follows 'The bytes of the object.
'. - See Also:
-
getObjectAsBytes
default ResponseBytes<GetObjectResponse> getObjectAsBytes(GetObjectRequest getObjectRequest) throws ContainerNotFoundException, ObjectNotFoundException, RequestedRangeNotSatisfiableException, InternalServerErrorException, AwsServiceException, SdkClientException, MediaStoreDataException 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
-- Returns:
- A
ResponseBytes
that loads the data streamed from the service into memory and exposes it in convenient in-memory representations like a byte buffer or string. The unmarshalled response object can be obtained viaResponseBytes.response()
. The service documentation for the response content is as follows 'The bytes of the object.
'. - See Also:
-
getObjectAsBytes
default ResponseBytes<GetObjectResponse> getObjectAsBytes(Consumer<GetObjectRequest.Builder> getObjectRequest) throws ContainerNotFoundException, ObjectNotFoundException, RequestedRangeNotSatisfiableException, InternalServerErrorException, AwsServiceException, SdkClientException, MediaStoreDataException 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 viaGetObjectRequest.builder()
- Parameters:
getObjectRequest
- AConsumer
that will call methods onGetObjectRequest.Builder
to create a request.- Returns:
- A
ResponseBytes
that loads the data streamed from the service into memory and exposes it in convenient in-memory representations like a byte buffer or string. The unmarshalled response object can be obtained viaResponseBytes.response()
. The service documentation for the response content is as follows 'The bytes of the object.
'. - See Also:
-
listItems
default ListItemsResponse listItems(ListItemsRequest listItemsRequest) throws ContainerNotFoundException, InternalServerErrorException, AwsServiceException, SdkClientException, MediaStoreDataException Provides a list of metadata entries about folders and objects in the specified folder.
- Parameters:
listItemsRequest
-- Returns:
- Result of the ListItems operation returned by the service.
- See Also:
-
listItems
default ListItemsResponse listItems(Consumer<ListItemsRequest.Builder> listItemsRequest) throws ContainerNotFoundException, InternalServerErrorException, AwsServiceException, SdkClientException, MediaStoreDataException 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 viaListItemsRequest.builder()
- Parameters:
listItemsRequest
- AConsumer
that will call methods onListItemsRequest.Builder
to create a request.- Returns:
- Result of the ListItems operation returned by the service.
- See Also:
-
listItemsPaginator
default ListItemsIterable listItemsPaginator(ListItemsRequest listItemsRequest) throws ContainerNotFoundException, InternalServerErrorException, AwsServiceException, SdkClientException, MediaStoreDataException This is a variant of
listItems(software.amazon.awssdk.services.mediastoredata.model.ListItemsRequest)
operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will internally handle making service calls for you.When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response pages by making service calls until there are no pages left or your iteration stops. If there are errors in your request, you will see the failures only after you start iterating through the iterable.
The following are few ways to iterate through the response pages:
1) Using a Streamsoftware.amazon.awssdk.services.mediastoredata.paginators.ListItemsIterable responses = client.listItemsPaginator(request); responses.stream().forEach(....);
{ @code software.amazon.awssdk.services.mediastoredata.paginators.ListItemsIterable responses = client.listItemsPaginator(request); for (software.amazon.awssdk.services.mediastoredata.model.ListItemsResponse response : responses) { // do something; } }
3) Use iterator directlysoftware.amazon.awssdk.services.mediastoredata.paginators.ListItemsIterable responses = client.listItemsPaginator(request); responses.iterator().forEachRemaining(....);
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 iterable that can be used to iterate through all the response pages.
- See Also:
-
listItemsPaginator
default ListItemsIterable listItemsPaginator(Consumer<ListItemsRequest.Builder> listItemsRequest) throws ContainerNotFoundException, InternalServerErrorException, AwsServiceException, SdkClientException, MediaStoreDataException This is a variant of
listItems(software.amazon.awssdk.services.mediastoredata.model.ListItemsRequest)
operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will internally handle making service calls for you.When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response pages by making service calls until there are no pages left or your iteration stops. If there are errors in your request, you will see the failures only after you start iterating through the iterable.
The following are few ways to iterate through the response pages:
1) Using a Streamsoftware.amazon.awssdk.services.mediastoredata.paginators.ListItemsIterable responses = client.listItemsPaginator(request); responses.stream().forEach(....);
{ @code software.amazon.awssdk.services.mediastoredata.paginators.ListItemsIterable responses = client.listItemsPaginator(request); for (software.amazon.awssdk.services.mediastoredata.model.ListItemsResponse response : responses) { // do something; } }
3) Use iterator directlysoftware.amazon.awssdk.services.mediastoredata.paginators.ListItemsIterable responses = client.listItemsPaginator(request); responses.iterator().forEachRemaining(....);
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 viaListItemsRequest.builder()
- Parameters:
listItemsRequest
- AConsumer
that will call methods onListItemsRequest.Builder
to create a request.- Returns:
- A custom iterable that can be used to iterate through all the response pages.
- See Also:
-
putObject
default PutObjectResponse putObject(PutObjectRequest putObjectRequest, RequestBody requestBody) throws ContainerNotFoundException, InternalServerErrorException, AwsServiceException, SdkClientException, MediaStoreDataException 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
- The content to send to the service. ARequestBody
can be created using one of several factory methods for various sources of data. For example, to create a request body from a file you can do the following.RequestBody.fromFile(new File("myfile.txt"))
RequestBody
for additional details and which sources of data are supported. The service documentation for the request content is as follows 'The bytes to be stored.
'- Returns:
- Result of the PutObject operation returned by the service.
- See Also:
-
putObject
default PutObjectResponse putObject(Consumer<PutObjectRequest.Builder> putObjectRequest, RequestBody requestBody) throws ContainerNotFoundException, InternalServerErrorException, AwsServiceException, SdkClientException, MediaStoreDataException 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 viaPutObjectRequest.builder()
- Parameters:
putObjectRequest
- AConsumer
that will call methods onPutObjectRequest.Builder
to create a request.requestBody
- The content to send to the service. ARequestBody
can be created using one of several factory methods for various sources of data. For example, to create a request body from a file you can do the following.RequestBody.fromFile(new File("myfile.txt"))
RequestBody
for additional details and which sources of data are supported. The service documentation for the request content is as follows 'The bytes to be stored.
'- Returns:
- Result of the PutObject operation returned by the service.
- See Also:
-
putObject
default PutObjectResponse putObject(PutObjectRequest putObjectRequest, Path sourcePath) throws ContainerNotFoundException, InternalServerErrorException, AwsServiceException, SdkClientException, MediaStoreDataException 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:
- Result of the PutObject operation returned by the service.
- See Also:
-
putObject
default PutObjectResponse putObject(Consumer<PutObjectRequest.Builder> putObjectRequest, Path sourcePath) throws ContainerNotFoundException, InternalServerErrorException, AwsServiceException, SdkClientException, MediaStoreDataException 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 viaPutObjectRequest.builder()
- Parameters:
putObjectRequest
- AConsumer
that will call methods onPutObjectRequest.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:
- Result of the PutObject operation returned by the service.
- See Also:
-
create
Create aMediaStoreDataClient
with the region loaded from theDefaultAwsRegionProviderChain
and credentials loaded from theDefaultCredentialsProvider
. -
builder
Create a builder that can be used to configure and create aMediaStoreDataClient
. -
serviceMetadata
-
serviceClientConfiguration
Description copied from interface:SdkClient
The SDK service client configuration exposes client settings to the user, e.g., ClientOverrideConfiguration- Specified by:
serviceClientConfiguration
in interfaceAwsClient
- Specified by:
serviceClientConfiguration
in interfaceSdkClient
- Returns:
- SdkServiceClientConfiguration
-