public class BatchOperations extends Object
Constructor and Description |
---|
BatchOperations(com.tinkerpop.frames.FramedGraph<?> graph)
Simple constructor, with system scope, version creation
activated and tolerant mode off.
|
BatchOperations(com.tinkerpop.frames.FramedGraph<?> graph,
PermissionScope scopeOpt,
boolean version,
boolean tolerant,
List<ImportCallback> callbacks)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
int |
batchDelete(List<String> ids,
Actioner actioner,
Optional<String> logMessage)
Delete a batch of items by ID.
|
ImportLog |
batchImport(InputStream inputStream,
Actioner actioner,
Optional<String> logMessage)
Create or update a batch of items.
|
ImportLog |
batchUpdate(InputStream inputStream,
Actioner actioner,
Optional<String> logMessage)
Update a batch of items.
|
BatchOperations |
setScope(PermissionScope scope)
Set the permission scope.
|
BatchOperations |
setTolerant(boolean tolerant)
Toggle tolerant mode, which will prevent the entire batch
failing if a single item fails to validate.
|
BatchOperations |
setVersioning(boolean versioning)
Toggle versioning for item updates.
|
BatchOperations |
withCallbacks(ImportCallback... callbacks)
Add import callbacks to the importer.
|
public BatchOperations(com.tinkerpop.frames.FramedGraph<?> graph, PermissionScope scopeOpt, boolean version, boolean tolerant, List<ImportCallback> callbacks)
graph
- the graph objectscopeOpt
- a nullable scope entityversion
- whether to created versioned for changed itemstolerant
- whether to allow individual validation errors
without failing the entire batchpublic BatchOperations(com.tinkerpop.frames.FramedGraph<?> graph)
graph
- the graph objectpublic BatchOperations setTolerant(boolean tolerant)
tolerant
- true or falsepublic BatchOperations setVersioning(boolean versioning)
versioning
- true or falsepublic BatchOperations setScope(PermissionScope scope)
scope
- a permission scope framepublic BatchOperations withCallbacks(ImportCallback... callbacks)
callbacks
- one or more ImportCallback instancespublic ImportLog batchImport(InputStream inputStream, Actioner actioner, Optional<String> logMessage) throws DeserializationError, ItemNotFound, ValidationError
inputStream
- an input stream containing a JSON list of
bundles corresponding to the items to update
or create.actioner
- the current userlogMessage
- a log messageDeserializationError
ItemNotFound
ValidationError
public ImportLog batchUpdate(InputStream inputStream, Actioner actioner, Optional<String> logMessage) throws DeserializationError, ItemNotFound, ValidationError
inputStream
- an input stream containing a JSON list of
bundles corresponding to the items to update.actioner
- the current userlogMessage
- a log messageDeserializationError
ItemNotFound
ValidationError
public int batchDelete(List<String> ids, Actioner actioner, Optional<String> logMessage) throws ItemNotFound
ids
- a list of item IDsactioner
- the current userlogMessage
- an optional log messageItemNotFound
Copyright © 2018 The European Holocaust Research Infrastructure (EHRI). All rights reserved.