
public class OrientDBEmbedded extends Object implements OrientDBInternal
| Modifier and Type | Class and Description |
|---|---|
protected static interface |
OrientDBEmbedded.DatabaseFound |
static interface |
OrientDBEmbedded.InstanceFactory<T> |
| Modifier and Type | Field and Description |
|---|---|
protected String |
basePath |
protected OrientDBConfig |
configurations |
protected OEngine |
disk |
protected long |
maxWALSegmentSize |
protected OEngine |
memory |
protected Orient |
orient |
protected Set<ODatabasePoolInternal> |
pools |
protected Map<String,OAbstractPaginatedStorage> |
storages |
| Constructor and Description |
|---|
OrientDBEmbedded(String directoryPath,
OrientDBConfig configurations,
Orient orient) |
| Modifier and Type | Method and Description |
|---|---|
protected String |
buildName(String name) |
void |
close()
Close the factory with all related databases and pools.
|
void |
create(String name,
String user,
String password,
ODatabaseType type)
Create a new database
|
void |
create(String name,
String user,
String password,
ODatabaseType type,
OrientDBConfig config)
Create a new database
|
void |
drop(String name,
String user,
String password)
Drop a database
|
boolean |
exists(String name,
String user,
String password)
Check if a database exists
|
void |
forceDatabaseClose(String iDatabaseName) |
protected int |
generateStorageId() |
OrientDBConfig |
getConfigurations() |
String |
getDatabasePath(String iDatabaseName) |
OEmbeddedDatabaseInstanceFactory |
getFactory() |
protected OAbstractPaginatedStorage |
getOrInitStorage(String name) |
OAbstractPaginatedStorage |
getStorage(String name) |
Collection<OStorage> |
getStorages() |
void |
initAutoClose(long delay) |
void |
initCustomStorage(String name,
String path,
String userName,
String userPassword) |
void |
internalClose()
Should be called only by shutdown listeners
|
protected ODatabaseDocumentEmbedded |
internalCreate(OrientDBConfig config,
OAbstractPaginatedStorage storage) |
boolean |
isEmbedded() |
boolean |
isOpen()
Check if the current instance is open
|
Set<String> |
listDatabases(String user,
String password)
List of database exiting in the current environment
|
void |
loadAllDatabases() |
ODatabaseDocumentInternal |
open(String name,
String user,
String password)
Open a database specified by name using the username and password if needed
|
ODatabaseDocumentInternal |
open(String name,
String user,
String password,
OrientDBConfig config)
Open a database specified by name using the username and password if needed, with specific configuration
|
ODatabaseDocumentEmbedded |
openNoAuthenticate(String name,
String user) |
ODatabaseDocumentEmbedded |
openNoAuthorization(String name) |
ODatabasePoolInternal |
openPool(String name,
String user,
String password)
Open a pool of databases, similar to open but with multiple instances.
|
ODatabasePoolInternal |
openPool(String name,
String user,
String password,
OrientDBConfig config)
Open a pool of databases, similar to open but with multiple instances.
|
ODatabaseDocumentInternal |
poolOpen(String name,
String user,
String password,
ODatabasePoolInternal pool)
Internal api for request to open a database with a pool
|
void |
removePool(ODatabasePoolInternal pool)
Internal API for pool close
|
void |
removeShutdownHook() |
void |
replaceFactory(OEmbeddedDatabaseInstanceFactory factory) |
void |
restore(String name,
InputStream in,
Map<String,Object> options,
Callable<Object> callable,
OCommandOutputListener iListener) |
void |
restore(String name,
String user,
String password,
ODatabaseType type,
String path,
OrientDBConfig config) |
protected OrientDBConfig |
solveConfig(OrientDBConfig config) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitdistributed, embedded, extract, fromUrl, fullSync, newOrientDB, remoteprotected final Map<String,OAbstractPaginatedStorage> storages
protected final Set<ODatabasePoolInternal> pools
protected final OrientDBConfig configurations
protected final String basePath
protected final OEngine memory
protected final OEngine disk
protected final Orient orient
protected final long maxWALSegmentSize
public OrientDBEmbedded(String directoryPath, OrientDBConfig configurations, Orient orient)
public void initAutoClose(long delay)
public ODatabaseDocumentInternal open(String name, String user, String password)
OrientDBInternalopen in interface OrientDBInternalname - of the database to openuser - the username allowed to open the databasepassword - related to the specified usernamepublic ODatabaseDocumentEmbedded openNoAuthenticate(String name, String user)
openNoAuthenticate in interface OrientDBInternalpublic ODatabaseDocumentEmbedded openNoAuthorization(String name)
openNoAuthorization in interface OrientDBInternalpublic ODatabaseDocumentInternal open(String name, String user, String password, OrientDBConfig config)
OrientDBInternalopen in interface OrientDBInternalname - of the database to openuser - the username allowed to open the databasepassword - related to the specified usernameconfig - database specific configuration that override the factory global settings where needed.protected OrientDBConfig solveConfig(OrientDBConfig config)
public ODatabaseDocumentInternal poolOpen(String name, String user, String password, ODatabasePoolInternal pool)
OrientDBInternalpoolOpen in interface OrientDBInternalprotected OAbstractPaginatedStorage getOrInitStorage(String name)
protected final int generateStorageId()
public OAbstractPaginatedStorage getStorage(String name)
public void create(String name, String user, String password, ODatabaseType type)
OrientDBInternalcreate in interface OrientDBInternalname - database nameuser - the username of a user allowed to create a database, in case of remote is a server user for embedded it can be
left emptypassword - the password relative to the usertype - can be plocal or memorypublic void create(String name, String user, String password, ODatabaseType type, OrientDBConfig config)
OrientDBInternalcreate in interface OrientDBInternalname - database nameuser - the username of a user allowed to create a database, in case of remote is a server user for embedded it can be
left emptypassword - the password relative to the usertype - can be plocal or memoryconfig - database specific configuration that override the factory global settings where needed.public void restore(String name, String user, String password, ODatabaseType type, String path, OrientDBConfig config)
restore in interface OrientDBInternalpublic void restore(String name, InputStream in, Map<String,Object> options, Callable<Object> callable, OCommandOutputListener iListener)
restore in interface OrientDBInternalprotected ODatabaseDocumentEmbedded internalCreate(OrientDBConfig config, OAbstractPaginatedStorage storage)
public boolean exists(String name, String user, String password)
OrientDBInternalexists in interface OrientDBInternalname - database name to checkuser - the username of a user allowed to check the database existence, in case of remote is a server user for embedded
it can be left empty.password - the password relative to the userpublic void drop(String name, String user, String password)
OrientDBInternaldrop in interface OrientDBInternalname - database nameuser - the username of a user allowed to drop a database, in case of remote is a server user for embedded it can be
left emptypassword - the password relative to the userpublic Set<String> listDatabases(String user, String password)
OrientDBInternallistDatabases in interface OrientDBInternaluser - the username of a user allowed to list databases, in case of remote is a server user for embedded it can be
left emptypassword - the password relative to the userpublic void loadAllDatabases()
loadAllDatabases in interface OrientDBInternalpublic ODatabasePoolInternal openPool(String name, String user, String password)
OrientDBInternalopenPool in interface OrientDBInternalname - database nameuser - the username allowed to open the databasepassword - the password relative to the userpublic ODatabasePoolInternal openPool(String name, String user, String password, OrientDBConfig config)
OrientDBInternalopenPool in interface OrientDBInternalname - database nameuser - the username allowed to open the databasepassword - the password relative to the userconfig - database specific configuration that override the factory global settings where needed.public void close()
OrientDBInternalclose in interface OrientDBInternalclose in interface AutoCloseablepublic void internalClose()
OrientDBInternalinternalClose in interface OrientDBInternalpublic OrientDBConfig getConfigurations()
public void removePool(ODatabasePoolInternal pool)
OrientDBInternalremovePool in interface OrientDBInternalpublic void initCustomStorage(String name, String path, String userName, String userPassword)
initCustomStorage in interface OrientDBInternalpublic void removeShutdownHook()
removeShutdownHook in interface OrientDBInternalpublic Collection<OStorage> getStorages()
getStorages in interface OrientDBInternalpublic void forceDatabaseClose(String iDatabaseName)
forceDatabaseClose in interface OrientDBInternalpublic void replaceFactory(OEmbeddedDatabaseInstanceFactory factory)
replaceFactory in interface OrientDBInternalpublic OEmbeddedDatabaseInstanceFactory getFactory()
getFactory in interface OrientDBInternalpublic boolean isOpen()
OrientDBInternalisOpen in interface OrientDBInternalpublic boolean isEmbedded()
isEmbedded in interface OrientDBInternalCopyright © 2009–2025 OrientDB. All rights reserved.