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
Modifier and TypeMethodDescriptionasyncServiceCall(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.generateRequest(DynamoDbEnhancedClientExtension extension) This method generates the request that needs to be sent to a low levelDynamoDbClient.The type, or name, of the operation.serviceCall(DynamoDbClient dynamoDbClient) Provides a function for making the low level synchronous paginated SDK call to DynamoDb.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 Details
-
generateRequest
This method generates the request that needs to be sent to a low levelDynamoDbClient.- Parameters:
extension- ADynamoDbEnhancedClientExtensionthat 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
DynamoDbClientcall to perform the operation.
-
serviceCall
Provides a function for making the low level synchronous paginated SDK call to DynamoDb.- Parameters:
dynamoDbClient- A low levelDynamoDbClientto 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 levelDynamoDbAsyncClientto make the call against.- Returns:
- A function that calls DynamoDb with a provided request object and returns the response object.
-
transformResponse
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- ADynamoDbEnhancedClientExtensionthat 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 theSdkIterablethat was returned by the previous step with a transformation that turns each object returned to a high level result.- Parameters:
dynamoDbClient- ADynamoDbClientto make the call against.extension- ADynamoDbEnhancedClientExtensionthat may modify the request or result of this operation. A null value here will result in no modifications.- Returns:
- An
SdkIterablethat 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 theCompletableFuturereturned 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- ADynamoDbAsyncClientto make the call against.extension- ADynamoDbEnhancedClientExtensionthat may modify the request or result of this operation. A null value here will result in no modifications.- Returns:
- An
SdkPublisherthat 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.
-