com.smbtec.xo.tinkerpop.blueprints.impl.TinkerPopDatastore Maven / Gradle / Ivy
package com.smbtec.xo.tinkerpop.blueprints.impl;
import java.util.Collection;
import org.apache.commons.configuration.Configuration;
import com.buschmais.xo.spi.datastore.Datastore;
import com.buschmais.xo.spi.datastore.DatastoreMetadataFactory;
import com.buschmais.xo.spi.metadata.type.TypeMetadata;
import com.smbtec.xo.tinkerpop.blueprints.api.TinkerPopDatastoreSession;
import com.smbtec.xo.tinkerpop.blueprints.impl.metadata.EdgeMetadata;
import com.smbtec.xo.tinkerpop.blueprints.impl.metadata.VertexMetadata;
import com.tinkerpop.blueprints.Graph;
import com.tinkerpop.blueprints.GraphFactory;
/**
*
* @author Lars Martin - [email protected]
* @author Rick-Rainer Ludwig
*
*/
public class TinkerPopDatastore implements Datastore, VertexMetadata, String, EdgeMetadata, String> {
private Graph graph;
public TinkerPopDatastore(final Configuration config) {
graph = GraphFactory.open(config);
}
@Override
public void init(final Collection registeredMetadata) {
// handle indices
}
@Override
public DatastoreMetadataFactory getMetadataFactory() {
return new TinkerPopMetadataFactory();
}
@Override
public TinkerPopDatastoreSession createSession() {
return new TinkerPopDatastoreSessionImpl(graph);
}
@Override
public void close() {
graph.shutdown();
graph = null;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy