/
GraphContext.java
71 lines (56 loc) · 1.8 KB
/
GraphContext.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
package org.jboss.windup.graph;
import java.io.Closeable;
import java.nio.file.Path;
import java.util.Map;
import org.jboss.windup.graph.frames.TypeAwareFramedGraphQuery;
import com.thinkaurelius.titan.core.TitanGraph;
import com.tinkerpop.blueprints.util.wrappers.event.EventGraph;
import com.tinkerpop.frames.FramedGraph;
/**
* Context for interacting with the underlying graph database API.
*
* @author <a href="mailto:lincolnbaxter@gmail.com">Lincoln Baxter, III</a>
*/
public interface GraphContext extends Closeable
{
/**
* Get the {@link Path} on disk where this graph is stored.
*/
Path getGraphDirectory();
/**
* Get the underlying {@link EventGraph}, which is itself a wrapper for a {@link TitanGraph}.
*/
EventGraph<TitanGraph> getGraph();
/**
* Creates new graph using the configuration. In case there was already a graph located in the specified path, it will be deleted.
*/
GraphContext create();
/**
* Loads the graph using the configuration.
*/
GraphContext load();
/**
* Get the {@link FramedGraph} view of the underlying {@link EventGraph}.
*/
FramedGraph<EventGraph<TitanGraph>> getFramed();
/**
* Get the {@link GraphTypeManager}.
*/
GraphTypeManager getGraphTypeManager();
/**
* Get the {@link GraphModelScanner}.
*/
TypeAwareFramedGraphQuery getQuery();
/**
* Clear all data from the graph (note: the graph must be closed for this operation to succeed)
*/
void clear();
/**
* Sets the global configuration options to the provided {@link Map}.
*/
void setOptions(Map<String, Object> options);
/**
* Returns the globally configured options as an immutable {@link Map}
*/
Map<String, Object> getOptionMap();
}