public abstract class GraphUpdateContext extends Object implements AutoCloseable
Example
try (GraphUpdateContext ctx = graphRepository.beginGraphUpdate(Priority.NORMAL, user, authorizations)) {
ElementMutation<Vertex> m = graph.prepareVertex("v1", visibility);
ctx.update(m, updateContext -> {
BcProperties.FILE_NAME.updateProperty(updateContext, "key", fileName, metadata, visibility);
});
}
| Modifier and Type | Class and Description |
|---|---|
static interface |
GraphUpdateContext.Update<T extends Element> |
class |
GraphUpdateContext.UpdateFuture<T extends Element> |
| Modifier | Constructor and Description |
|---|---|
protected |
GraphUpdateContext(Graph graph,
WorkQueueRepository workQueueRepository,
WebQueueRepository webQueueRepository,
VisibilityTranslator visibilityTranslator,
Priority priority,
User user,
Authorizations authorizations) |
protected GraphUpdateContext(Graph graph, WorkQueueRepository workQueueRepository, WebQueueRepository webQueueRepository, VisibilityTranslator visibilityTranslator, Priority priority, User user, Authorizations authorizations)
public void close()
close in interface AutoCloseablepublic void flush()
protected void flushFutures()
protected void saveOutstandingUpdateFutures()
public <T extends Element> GraphUpdateContext.UpdateFuture<T> update(T element, GraphUpdateContext.Update<T> updateFn)
update(ElementMutation, Update) but
prepares the mutation from the element.public <T extends Element> GraphUpdateContext.UpdateFuture<T> update(T element, ZonedDateTime modifiedDate, VisibilityJson visibilityJson, GraphUpdateContext.Update<T> updateFn)
update(Element, Update) but calls
ElementUpdateContext.updateBuiltInProperties(ZonedDateTime, VisibilityJson) before calling
updateFn.public <T extends Element> GraphUpdateContext.UpdateFuture<T> update(T element, ZonedDateTime modifiedDate, VisibilityJson visibilityJson, String conceptType, GraphUpdateContext.Update<T> updateFn)
update(Element, Update) but calls
ElementUpdateContext.updateBuiltInProperties(ZonedDateTime, VisibilityJson) and
ElementUpdateContext.setConceptType(String) before calling
updateFn.public <T extends Element> GraphUpdateContext.UpdateFuture<T> update(ElementMutation<T> m, GraphUpdateContext.Update<T> updateFn)
public <T extends Element> GraphUpdateContext.UpdateFuture<T> update(ElementMutation<T> m, ZonedDateTime modifiedDate, VisibilityJson visibilityJson, GraphUpdateContext.Update<T> updateFn)
update(ElementMutation, Update) but calls
ElementUpdateContext.updateBuiltInProperties(ZonedDateTime, VisibilityJson) before calling
updateFn.public <T extends Element> GraphUpdateContext.UpdateFuture<T> update(ElementMutation<T> m, ZonedDateTime modifiedDate, VisibilityJson visibilityJson, String conceptType, GraphUpdateContext.Update<T> updateFn)
update(ElementMutation, Update) but calls
ElementUpdateContext.updateBuiltInProperties(ZonedDateTime, VisibilityJson) and
ElementUpdateContext.setConceptType(String) before calling
updateFn.public GraphUpdateContext.UpdateFuture<Vertex> getOrCreateVertexAndUpdate(String vertexId, Visibility visibility, String conceptType, GraphUpdateContext.Update<Vertex> updateFn)
getOrCreateVertexAndUpdate(String, Long, Visibility, String, Update)
using the current time as the timestamp.public GraphUpdateContext.UpdateFuture<Vertex> getOrCreateVertexAndUpdate(String vertexId, Long timestamp, Visibility visibility, String conceptType, GraphUpdateContext.Update<Vertex> updateFn)
vertexId - The existing vertex id, desired vertex id for new vertices, or null to generate a new id
and create a new vertex.timestamp - The timestamp to assign new vertices or null to use the current timevisibility - The visibility of the new vertexupdateFn - Closure in which all element updates should be madepublic GraphUpdateContext.UpdateFuture<Edge> getOrCreateEdgeAndUpdate(String edgeId, String outVertexId, String inVertexId, String label, Visibility visibility, GraphUpdateContext.Update<Edge> updateFn)
getOrCreateEdgeAndUpdate(String, String, String, String, Long, Visibility, Update)
using the current time as the timestamp.public GraphUpdateContext.UpdateFuture<Edge> getOrCreateEdgeAndUpdate(String edgeId, String outVertexId, String inVertexId, String label, Long timestamp, Visibility visibility, GraphUpdateContext.Update<Edge> updateFn)
edgeId - The existing edge id, desired edge id for new edges, or null to generate a new id
and create a new edge.outVertexId - the out vertex id of newly created edgesinVertexId - the in vertex id of newly created edgeslabel - the label to assign on newly created edgestimestamp - The timestamp to assign new edges or null to use the current timevisibility - The visibility of the new edgeupdateFn - Closure in which all element updates should be madepublic Priority getPriority()
public User getUser()
public Authorizations getAuthorizations()
public int getSaveQueueSize()
public GraphUpdateContext setSaveQueueSize(int saveQueueSize)
public boolean isPushOnQueue()
public Graph getGraph()
public GraphUpdateContext setPushOnQueue(boolean pushOnQueue)
Copyright © 2016–2021 MWARE SOLUTIONS. All rights reserved.