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
FieldsModifier and TypeFieldDescriptionstatic final StringValue for looking up the service's metadata from theServiceMetadataProvider.static final String -
Method Summary
Modifier and TypeMethodDescriptionstatic MediaStoreDataClientBuilderbuilder()Create a builder that can be used to configure and create aMediaStoreDataClient.static MediaStoreDataClientcreate()Create aMediaStoreDataClientwith the region loaded from theDefaultAwsRegionProviderChainand credentials loaded from theDefaultCredentialsProvider.default DeleteObjectResponsedeleteObject(Consumer<DeleteObjectRequest.Builder> deleteObjectRequest) Deletes an object at the specified path.default DeleteObjectResponsedeleteObject(DeleteObjectRequest deleteObjectRequest) Deletes an object at the specified path.default DescribeObjectResponsedescribeObject(Consumer<DescribeObjectRequest.Builder> describeObjectRequest) Gets the headers for an object at the specified path.default DescribeObjectResponsedescribeObject(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 GetObjectResponsegetObject(Consumer<GetObjectRequest.Builder> getObjectRequest, Path destinationPath) Downloads the object at the specified path.default <ReturnT> ReturnTgetObject(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 GetObjectResponsegetObject(GetObjectRequest getObjectRequest, Path destinationPath) Downloads the object at the specified path.default <ReturnT> ReturnTgetObject(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 ListItemsResponselistItems(Consumer<ListItemsRequest.Builder> listItemsRequest) Provides a list of metadata entries about folders and objects in the specified folder.default ListItemsResponselistItems(ListItemsRequest listItemsRequest) Provides a list of metadata entries about folders and objects in the specified folder.default ListItemsIterablelistItemsPaginator(Consumer<ListItemsRequest.Builder> listItemsRequest) This is a variant oflistItems(software.amazon.awssdk.services.mediastoredata.model.ListItemsRequest)operation.default ListItemsIterablelistItemsPaginator(ListItemsRequest listItemsRequest) This is a variant oflistItems(software.amazon.awssdk.services.mediastoredata.model.ListItemsRequest)operation.default PutObjectResponseputObject(Consumer<PutObjectRequest.Builder> putObjectRequest, Path sourcePath) Uploads an object to the specified path.default PutObjectResponseputObject(Consumer<PutObjectRequest.Builder> putObjectRequest, RequestBody requestBody) Uploads an object to the specified path.default PutObjectResponseputObject(PutObjectRequest putObjectRequest, Path sourcePath) Uploads an object to the specified path.default PutObjectResponseputObject(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 ServiceMetadataMethods inherited from interface software.amazon.awssdk.utils.SdkAutoCloseable
closeMethods 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.Builderavoiding the need to create one manually viaDeleteObjectRequest.builder()- Parameters:
deleteObjectRequest- AConsumerthat will call methods onDeleteObjectRequest.Builderto 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.Builderavoiding the need to create one manually viaDescribeObjectRequest.builder()- Parameters:
describeObjectRequest- AConsumerthat will call methods onDescribeObjectRequest.Builderto 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. SeeResponseTransformerfor 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.Builderavoiding the need to create one manually viaGetObjectRequest.builder()- Parameters:
getObjectRequest- AConsumerthat will call methods onGetObjectRequest.Builderto 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. SeeResponseTransformerfor 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-Pathto 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.Builderavoiding the need to create one manually viaGetObjectRequest.builder()- Parameters:
getObjectRequest- AConsumerthat will call methods onGetObjectRequest.Builderto create a request.destinationPath-Pathto 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
ResponseInputStreamcontaining 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.Builderavoiding the need to create one manually viaGetObjectRequest.builder()- Parameters:
getObjectRequest- AConsumerthat will call methods onGetObjectRequest.Builderto create a request.- Returns:
- A
ResponseInputStreamcontaining 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
ResponseBytesthat 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.Builderavoiding the need to create one manually viaGetObjectRequest.builder()- Parameters:
getObjectRequest- AConsumerthat will call methods onGetObjectRequest.Builderto create a request.- Returns:
- A
ResponseBytesthat 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.Builderavoiding the need to create one manually viaListItemsRequest.builder()- Parameters:
listItemsRequest- AConsumerthat will call methods onListItemsRequest.Builderto 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 Stream
2) Using For loopsoftware.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 Stream
2) Using For loopsoftware.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.Builderavoiding the need to create one manually viaListItemsRequest.builder()- Parameters:
listItemsRequest- AConsumerthat will call methods onListItemsRequest.Builderto 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. ARequestBodycan 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.
See documentation inRequestBody.fromFile(new File("myfile.txt"))RequestBodyfor 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.Builderavoiding the need to create one manually viaPutObjectRequest.builder()- Parameters:
putObjectRequest- AConsumerthat will call methods onPutObjectRequest.Builderto create a request.requestBody- The content to send to the service. ARequestBodycan 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.
See documentation inRequestBody.fromFile(new File("myfile.txt"))RequestBodyfor 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-Pathto 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.Builderavoiding the need to create one manually viaPutObjectRequest.builder()- Parameters:
putObjectRequest- AConsumerthat will call methods onPutObjectRequest.Builderto create a request.sourcePath-Pathto 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 aMediaStoreDataClientwith the region loaded from theDefaultAwsRegionProviderChainand credentials loaded from theDefaultCredentialsProvider. -
builder
Create a builder that can be used to configure and create aMediaStoreDataClient. -
serviceMetadata
-
serviceClientConfiguration
Description copied from interface:SdkClientThe SDK service client configuration exposes client settings to the user, e.g., ClientOverrideConfiguration- Specified by:
serviceClientConfigurationin interfaceAwsClient- Specified by:
serviceClientConfigurationin interfaceSdkClient- Returns:
- SdkServiceClientConfiguration
-