Class GetItemOperation<T>
- java.lang.Object
-
- software.amazon.awssdk.enhanced.dynamodb.internal.operations.GetItemOperation<T>
-
- All Implemented Interfaces:
BatchableReadOperation
,CommonOperation<T,GetItemRequest,GetItemResponse,GetItemEnhancedResponse<T>>
,TableOperation<T,GetItemRequest,GetItemResponse,GetItemEnhancedResponse<T>>
,TransactableReadOperation<T>
public class GetItemOperation<T> extends Object implements TableOperation<T,GetItemRequest,GetItemResponse,GetItemEnhancedResponse<T>>, BatchableReadOperation, TransactableReadOperation<T>
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Function<GetItemRequest,CompletableFuture<GetItemResponse>>
asyncServiceCall(DynamoDbAsyncClient dynamoDbAsyncClient)
Provides a function for making the low level non-blocking asynchronous SDK call to DynamoDb.Boolean
consistentRead()
static <T> GetItemOperation<T>
create(GetItemEnhancedRequest request)
GetItemRequest
generateRequest(TableSchema<T> tableSchema, OperationContext context, DynamoDbEnhancedClientExtension extension)
This method generates the request that needs to be sent to a low levelDynamoDbClient
.TransactGetItem
generateTransactGetItem(TableSchema<T> tableSchema, OperationContext operationContext, DynamoDbEnhancedClientExtension dynamoDbEnhancedClientExtension)
Key
key()
OperationName
operationName()
The type, or name, of the operation.Function<GetItemRequest,GetItemResponse>
serviceCall(DynamoDbClient dynamoDbClient)
Provides a function for making the low level synchronous SDK call to DynamoDb.GetItemEnhancedResponse<T>
transformResponse(GetItemResponse response, TableSchema<T> tableSchema, OperationContext context, DynamoDbEnhancedClientExtension extension)
Takes the response object returned by the actual DynamoDb call and maps it into a higher level abstracted result object.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface software.amazon.awssdk.enhanced.dynamodb.internal.operations.CommonOperation
execute, executeAsync
-
Methods inherited from interface software.amazon.awssdk.enhanced.dynamodb.internal.operations.TableOperation
executeOnPrimaryIndex, executeOnPrimaryIndexAsync
-
-
-
-
Method Detail
-
create
public static <T> GetItemOperation<T> create(GetItemEnhancedRequest request)
-
consistentRead
public Boolean consistentRead()
- Specified by:
consistentRead
in interfaceBatchableReadOperation
-
key
public Key key()
- Specified by:
key
in interfaceBatchableReadOperation
-
operationName
public OperationName operationName()
Description copied from interface:CommonOperation
The type, or name, of the operation.- Specified by:
operationName
in interfaceCommonOperation<T,GetItemRequest,GetItemResponse,GetItemEnhancedResponse<T>>
-
generateRequest
public GetItemRequest generateRequest(TableSchema<T> tableSchema, OperationContext context, DynamoDbEnhancedClientExtension extension)
Description copied from interface:CommonOperation
This method generates the request that needs to be sent to a low levelDynamoDbClient
.- Specified by:
generateRequest
in interfaceCommonOperation<T,GetItemRequest,GetItemResponse,GetItemEnhancedResponse<T>>
- Parameters:
tableSchema
- ATableSchema
that maps the table to a modelled object.context
- An object containing the context, or target, of the command execution.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.
-
transformResponse
public GetItemEnhancedResponse<T> transformResponse(GetItemResponse response, TableSchema<T> tableSchema, OperationContext context, DynamoDbEnhancedClientExtension extension)
Description copied from interface:CommonOperation
Takes the response object returned by the actual DynamoDb call and maps it into a higher level abstracted result object.- Specified by:
transformResponse
in interfaceCommonOperation<T,GetItemRequest,GetItemResponse,GetItemEnhancedResponse<T>>
- Parameters:
response
- The response object returned by the DynamoDb call for this operation.tableSchema
- ATableSchema
that maps the table to a modelled object.context
- An object containing the context, or target, of the command execution.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.
-
serviceCall
public Function<GetItemRequest,GetItemResponse> serviceCall(DynamoDbClient dynamoDbClient)
Description copied from interface:CommonOperation
Provides a function for making the low level synchronous SDK call to DynamoDb.- Specified by:
serviceCall
in interfaceCommonOperation<T,GetItemRequest,GetItemResponse,GetItemEnhancedResponse<T>>
- 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
public Function<GetItemRequest,CompletableFuture<GetItemResponse>> asyncServiceCall(DynamoDbAsyncClient dynamoDbAsyncClient)
Description copied from interface:CommonOperation
Provides a function for making the low level non-blocking asynchronous SDK call to DynamoDb.- Specified by:
asyncServiceCall
in interfaceCommonOperation<T,GetItemRequest,GetItemResponse,GetItemEnhancedResponse<T>>
- 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.
-
generateTransactGetItem
public TransactGetItem generateTransactGetItem(TableSchema<T> tableSchema, OperationContext operationContext, DynamoDbEnhancedClientExtension dynamoDbEnhancedClientExtension)
- Specified by:
generateTransactGetItem
in interfaceTransactableReadOperation<T>
-
-