public abstract class AbstractImporter<I,T extends Accessible> extends Object implements ItemImporter<I,T>
Modifier and Type | Field and Description |
---|---|
protected Actioner |
actioner |
protected com.tinkerpop.frames.FramedGraph<?> |
framedGraph |
protected ImportLog |
log |
protected GraphManager |
manager |
protected PermissionScope |
permissionScope |
Constructor and Description |
---|
AbstractImporter(com.tinkerpop.frames.FramedGraph<?> graph,
PermissionScope scope,
Actioner actioner,
ImportLog log)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addCallback(ImportCallback callback)
Add a callback to run when an item is created.
|
void |
addErrorCallback(ErrorCallback errorCallback)
Add a callback to run when an item errors.
|
Actioner |
getActioner() |
PermissionScope |
getPermissionScope() |
BundleManager |
getPersister() |
protected BundleManager |
getPersister(List<String> scopeIds) |
protected void |
handleCallbacks(Mutation<? extends Accessible> mutation)
Call all registered ImportCallbacks for the given mutation.
|
void |
handleError(Exception ex)
Used to indicate a validation error in the
handler for a given element.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
importItem, importItem
protected final PermissionScope permissionScope
protected final Actioner actioner
protected final com.tinkerpop.frames.FramedGraph<?> framedGraph
protected final GraphManager manager
protected final ImportLog log
public AbstractImporter(com.tinkerpop.frames.FramedGraph<?> graph, PermissionScope scope, Actioner actioner, ImportLog log)
graph
- the framed graphscope
- the permission scopeactioner
- the user performing the importlog
- the log objectprotected void handleCallbacks(Mutation<? extends Accessible> mutation)
mutation
- the Mutation to handle callbacks forpublic PermissionScope getPermissionScope()
public Actioner getActioner()
protected BundleManager getPersister(List<String> scopeIds)
public BundleManager getPersister()
public void addCallback(ImportCallback callback)
ItemImporter
addCallback
in interface ItemImporter<I,T extends Accessible>
callback
- a callback function objectpublic void addErrorCallback(ErrorCallback errorCallback)
ItemImporter
addErrorCallback
in interface ItemImporter<I,T extends Accessible>
errorCallback
- a callback function objectpublic void handleError(Exception ex)
ItemImporter
handleError
in interface ItemImporter<I,T extends Accessible>
ex
- a validation exceptionCopyright © 2018 The European Holocaust Research Infrastructure (EHRI). All rights reserved.