public abstract class GraphDB
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private static GraphDB |
instance
The singleton implementation of our graph DB.
|
Constructor and Description |
---|
GraphDB() |
Modifier and Type | Method and Description |
---|---|
protected abstract org.apache.tinkerpop.gremlin.structure.Graph |
connectGraphDBImpl(org.apache.commons.configuration.Configuration configuration)
Obtain a graph DB with the connection details specified in the given
Configuration . |
static void |
createIndex(org.apache.tinkerpop.gremlin.structure.Graph db,
java.lang.String key,
java.lang.Class<?> datatype,
boolean element,
boolean uniq)
Create a single-property index in the given graph DB.
|
protected abstract void |
createIndexImpl(org.apache.tinkerpop.gremlin.structure.Graph db,
java.lang.String key,
java.lang.Class<?> datatype,
boolean element,
boolean uniq)
Create a single-property index in the given graph DB.
|
static org.apache.tinkerpop.gremlin.structure.Graph |
obtainGraphDB(org.apache.commons.configuration.Configuration configuration)
Obtain a graph DB with the connection details specified in the given
Configuration . |
private static final GraphDB instance
public static org.apache.tinkerpop.gremlin.structure.Graph obtainGraphDB(org.apache.commons.configuration.Configuration configuration)
Configuration
.configuration
- The connection details.public static void createIndex(org.apache.tinkerpop.gremlin.structure.Graph db, java.lang.String key, java.lang.Class<?> datatype, boolean element, boolean uniq)
TODO: multiple properties and custom index backends.
db
- The graph DB.key
- The property key name to be indexed. This will also be the index name.datatype
- The key's type.element
- true
if the vertex element should be indexed, otherwise the edge element
will be indexed.uniq
- true
if the index should enforce uniqueness of the given key.protected abstract org.apache.tinkerpop.gremlin.structure.Graph connectGraphDBImpl(org.apache.commons.configuration.Configuration configuration)
Configuration
.configuration
- The connection details.protected abstract void createIndexImpl(org.apache.tinkerpop.gremlin.structure.Graph db, java.lang.String key, java.lang.Class<?> datatype, boolean element, boolean uniq)
TODO: multiple properties and custom index backends.
db
- The graph DB.key
- The property key name to be indexed. This will also be the index name.datatype
- The key's type.element
- true
if the vertex element should be indexed, otherwise the edge element
will be indexed.uniq
- true
if the index should enforce uniqueness of the given key.