org.dataloader.BatchLoaderWithContext Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of java-dataloader Show documentation
Show all versions of java-dataloader Show documentation
A pure Java 8 port of Facebook Dataloader
package org.dataloader;
import org.dataloader.annotations.PublicSpi;
import java.util.List;
import java.util.concurrent.CompletionStage;
/**
* This form of {@link org.dataloader.BatchLoader} is given a {@link org.dataloader.BatchLoaderEnvironment} object
* that encapsulates the calling context. A typical use case is passing in security credentials or database connection details
* say.
*
* See {@link org.dataloader.BatchLoader} for more details on the design invariants that you must implement in order to
* use this interface.
*/
@PublicSpi
public interface BatchLoaderWithContext {
/**
* 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.
*
* @param keys the collection of keys to load
* @param environment an environment object that can help with the call
*
* @return a promise of the values for those keys
*/
CompletionStage> load(List keys, BatchLoaderEnvironment environment);
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy