Interface PaginatedDatabaseOperation<RequestT,ResponseT,ResultT>
-
- Type Parameters:
RequestT
- The type of the request object for the DynamoDb call in the low levelDynamoDbClient
.ResponseT
- The type of the response object for the DynamoDb call in the low levelDynamoDbClient
.ResultT
- The type of the mapped result object that will be returned by the execution of this operation.
- All Known Implementing Classes:
BatchGetItemOperation
public interface PaginatedDatabaseOperation<RequestT,ResponseT,ResultT>
Interface for an operation that can be executed against a mapped database and is expected to return a paginated list of results. These operations do not operate on a specific table or index, and may reference multiple tables and indexes (eg: batch operations). Typically, each page of results that is served will automatically perform an additional service call to DynamoDb to retrieve the next set of results.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description Function<RequestT,SdkPublisher<ResponseT>>
asyncServiceCall(DynamoDbAsyncClient dynamoDbAsyncClient)
Provides a function for making the low level non-blocking asynchronous paginated SDK call to DynamoDb.default SdkIterable<ResultT>
execute(DynamoDbClient dynamoDbClient, DynamoDbEnhancedClientExtension extension)
Default implementation of a complete synchronous execution of this operation against a database.default SdkPublisher<ResultT>
executeAsync(DynamoDbAsyncClient dynamoDbAsyncClient, DynamoDbEnhancedClientExtension extension)
Default implementation of a complete non-blocking asynchronous execution of this operation against a database.RequestT
generateRequest(DynamoDbEnhancedClientExtension extension)
This method generates the request that needs to be sent to a low levelDynamoDbClient
.OperationName
operationName()
The type, or name, of the operation.Function<RequestT,SdkIterable<ResponseT>>
serviceCall(DynamoDbClient dynamoDbClient)
Provides a function for making the low level synchronous paginated SDK call to DynamoDb.ResultT
transformResponse(ResponseT response, DynamoDbEnhancedClientExtension extension)
Takes the response object returned by the actual DynamoDb call and maps it into a higher level abstracted result object.
-
-
-
Method Detail
-
generateRequest
RequestT generateRequest(DynamoDbEnhancedClientExtension extension)
This method generates the request that needs to be sent to a low levelDynamoDbClient
.- Parameters:
extension
- ADynamoDbEnhancedClientExtension
that may modify the request of this operation. A null value here will result in no modifications.- Returns:
- A request that can be used as an argument to a
DynamoDbClient
call to perform the operation.
-
serviceCall
Function<RequestT,SdkIterable<ResponseT>> serviceCall(DynamoDbClient dynamoDbClient)
Provides a function for making the low level synchronous paginated SDK call to DynamoDb.- Parameters:
dynamoDbClient
- A low levelDynamoDbClient
to make the call against.- Returns:
- A function that calls DynamoDb with a provided request object and returns the response object.
-
asyncServiceCall
Function<RequestT,SdkPublisher<ResponseT>> asyncServiceCall(DynamoDbAsyncClient dynamoDbAsyncClient)
Provides a function for making the low level non-blocking asynchronous paginated SDK call to DynamoDb.- Parameters:
dynamoDbAsyncClient
- A low levelDynamoDbAsyncClient
to make the call against.- Returns:
- A function that calls DynamoDb with a provided request object and returns the response object.
-
transformResponse
ResultT transformResponse(ResponseT response, DynamoDbEnhancedClientExtension extension)
Takes the response object returned by the actual DynamoDb call and maps it into a higher level abstracted result object.- Parameters:
response
- The response object returned by the DynamoDb call for this operation.extension
- ADynamoDbEnhancedClientExtension
that may modify the result of this operation. A null value here will result in no modifications.- Returns:
- A high level result object as specified by the implementation of this operation.
-
execute
default SdkIterable<ResultT> execute(DynamoDbClient dynamoDbClient, DynamoDbEnhancedClientExtension extension)
Default implementation of a complete synchronous execution of this operation against a database. It performs three steps: 1) Call generateRequest() to get the request object. 2) Call getServiceCall() and call it using the request object generated in the previous step. 3) Wraps theSdkIterable
that was returned by the previous step with a transformation that turns each object returned to a high level result.- Parameters:
dynamoDbClient
- ADynamoDbClient
to make the call against.extension
- ADynamoDbEnhancedClientExtension
that may modify the request or result of this operation. A null value here will result in no modifications.- Returns:
- An
SdkIterable
that will iteratively return pages of high level result objects as specified by the implementation of this operation.
-
executeAsync
default SdkPublisher<ResultT> executeAsync(DynamoDbAsyncClient dynamoDbAsyncClient, DynamoDbEnhancedClientExtension extension)
Default implementation of a complete non-blocking asynchronous execution of this operation against a database. It performs three steps: 1) Call generateRequest() to get the request object. 2) Call getServiceCall() and call it using the request object generated in the previous step. 3) Wraps theCompletableFuture
returned by the SDK in a new one that calls transformResponse() to convert the response object returned in the previous step to a high level result.- Parameters:
dynamoDbAsyncClient
- ADynamoDbAsyncClient
to make the call against.extension
- ADynamoDbEnhancedClientExtension
that may modify the request or result of this operation. A null value here will result in no modifications.- Returns:
- An
SdkPublisher
that will publish pages of the high level result object as specified by the implementation of this operation.
-
operationName
OperationName operationName()
The type, or name, of the operation.
-
-