Class OrientGraphFactory
java.lang.Object
org.apache.tinkerpop.gremlin.orientdb.OrientGraphFactory
- All Implemented Interfaces:
AutoCloseable,OrientGraphBaseFactory
public final class OrientGraphFactory
extends Object
implements AutoCloseable, OrientGraphBaseFactory
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringprotected org.apache.commons.configuration2.Configurationprotected Stringprotected Stringprotected OrientDBprotected booleanprotected final Stringprotected OPartitionedReCreatableDatabasePoolprotected booleanprotected Optional<ODatabaseType>protected final String -
Constructor Summary
ConstructorsConstructorDescriptionOrientGraphFactory(OrientDB orientdb, String dbName, ODatabaseType type, String user, String password) OrientGraphFactory(String url) OrientGraphFactory(String url, ODatabaseType type) OrientGraphFactory(String url, String user, String password) OrientGraphFactory(String url, String user, String password, ODatabaseType type) OrientGraphFactory(org.apache.commons.configuration2.Configuration config) -
Method Summary
Modifier and TypeMethodDescriptionprotected ODatabaseDocumentacquireFromPool(boolean create, boolean open) voidclose()Closes all pooled databases and clear the pool.voiddrop()protected org.apache.commons.configuration2.ConfigurationgetConfiguration(boolean create, boolean open, boolean transactional) getDatabase(boolean create, boolean open) protected OrientGraphgetGraph(boolean create, boolean open, boolean transactional) getNoTx()getNoTx(boolean create, boolean open) Gets transactional graph with the database from pool if pool is configured.getTx()getTx(boolean create, boolean open) protected voidbooleanisOpen()pool()setLabelAsClassName(boolean is) Enable or disable the prefixing of class names with V_<label> for vertices or E_<label> for edges.setupPool(int max) Setting up the factory to use database pool instead of creation a new instance of database connection each time.setupPool(int maxPartitionSize, int max) toString()
-
Field Details
-
ADMIN
- See Also:
-
connectionURI
-
dbName
-
user
-
password
-
configuration
protected org.apache.commons.configuration2.Configuration configuration -
pool
-
labelAsClassName
protected boolean labelAsClassName -
type
-
factory
-
shouldCloseOrientDB
protected boolean shouldCloseOrientDB
-
-
Constructor Details
-
OrientGraphFactory
public OrientGraphFactory(OrientDB orientdb, String dbName, ODatabaseType type, String user, String password) -
OrientGraphFactory
public OrientGraphFactory() -
OrientGraphFactory
-
OrientGraphFactory
-
OrientGraphFactory
-
OrientGraphFactory
-
OrientGraphFactory
public OrientGraphFactory(org.apache.commons.configuration2.Configuration config)
-
-
Method Details
-
getNoTx
Gets transactional graph with the database from pool if pool is configured. Otherwise creates a graph with new db instance. The Graph instance inherits the factory's configuration.- Parameters:
create- if true automatically creates database if database with given URL does not existopen- if true automatically opens the database
-
getNoTx
- Specified by:
getNoTxin interfaceOrientGraphBaseFactory
-
getTx
-
getTx
- Specified by:
getTxin interfaceOrientGraphBaseFactory
-
getGraph
-
initGraph
-
getConfiguration
protected org.apache.commons.configuration2.Configuration getConfiguration(boolean create, boolean open, boolean transactional) -
getDatabase
- Specified by:
getDatabasein interfaceOrientGraphBaseFactory- Parameters:
create- if true automatically creates database if database with given URL does not existopen- if true automatically opens the database
-
acquireFromPool
- Parameters:
create- if true automatically creates database if database with given URL does not existopen- if true automatically opens the database
-
setLabelAsClassName
Enable or disable the prefixing of class names with V_<label> for vertices or E_<label> for edges.- Parameters:
is- if true classname equals label, if false classname is prefixed with V_ or E_ (default)
-
setupPool
Setting up the factory to use database pool instead of creation a new instance of database connection each time. -
setupPool
-
pool
-
close
public void close()Closes all pooled databases and clear the pool.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceOrientGraphBaseFactory
-
drop
public void drop()- Specified by:
dropin interfaceOrientGraphBaseFactory
-
toString
-
isOpen
public boolean isOpen()- Specified by:
isOpenin interfaceOrientGraphBaseFactory
-