Package org.dataloader
Class BatchLoaderEnvironment
- java.lang.Object
-
- org.dataloader.BatchLoaderEnvironment
-
@PublicApi public class BatchLoaderEnvironment extends java.lang.Object
This object is passed to a batch loader as calling context. It could contain security credentials of the calling users for example or database parameters that allow the data layer call to succeed.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
BatchLoaderEnvironment.Builder
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> T
getContext()
Returns the overall context object provided byBatchLoaderContextProvider
java.util.Map<java.lang.Object,java.lang.Object>
getKeyContexts()
Each call toDataLoader.load(Object, Object)
orDataLoader.loadMany(java.util.List, java.util.List)
can be given a context object when it is invoked.java.util.List<java.lang.Object>
getKeyContextsList()
Each call toDataLoader.load(Object, Object)
orDataLoader.loadMany(java.util.List, java.util.List)
can be given a context object when it is invoked.static BatchLoaderEnvironment.Builder
newBatchLoaderEnvironment()
-
-
-
Method Detail
-
getContext
public <T> T getContext()
Returns the overall context object provided byBatchLoaderContextProvider
- Type Parameters:
T
- the type you would like the object to be- Returns:
- a context object or null if there isn't one
-
getKeyContexts
public java.util.Map<java.lang.Object,java.lang.Object> getKeyContexts()
Each call toDataLoader.load(Object, Object)
orDataLoader.loadMany(java.util.List, java.util.List)
can be given a context object when it is invoked. A map of them is present by this method.- Returns:
- a map of key context objects
-
getKeyContextsList
public java.util.List<java.lang.Object> getKeyContextsList()
Each call toDataLoader.load(Object, Object)
orDataLoader.loadMany(java.util.List, java.util.List)
can be given a context object when it is invoked. A list of them is present by this method.- Returns:
- a list of key context objects in the order they were encountered
-
newBatchLoaderEnvironment
public static BatchLoaderEnvironment.Builder newBatchLoaderEnvironment()
-
-