Package org.dataloader
Interface BatchLoaderWithContext<K,V>
-
@PublicSpi public interface BatchLoaderWithContext<K,V>
This form ofBatchLoaderis given aBatchLoaderEnvironmentobject that encapsulates the calling context. A typical use case is passing in security credentials or database connection details say. SeeBatchLoaderfor more details on the design invariants that you must implement in order to use this interface.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.concurrent.CompletionStage<java.util.List<V>>load(java.util.List<K> keys, BatchLoaderEnvironment environment)Called to batch load the provided keys and return a promise to a list of values.
-
-
-
Method Detail
-
load
java.util.concurrent.CompletionStage<java.util.List<V>> load(java.util.List<K> keys, BatchLoaderEnvironment environment)
Called to batch load the provided keys and return a promise to a list of values. This default version can be given an environment object to that maybe be useful during the call. A typical use case is passing in security credentials or database details for example.- Parameters:
keys- the collection of keys to loadenvironment- an environment object that can help with the call- Returns:
- a promise of the values for those keys
-
-