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 OCachedDatabasePoolFactory |
cachedPoolFactory |
protected OrientDBConfig |
configurations |
protected OEngine |
disk |
protected long |
doubleWriteLogMaxSegSize |
protected long |
maxWALSegmentSize |
protected OEngine |
memory |
protected Orient |
orient |
protected Set<ODatabasePoolInternal> |
pools |
protected Map<String,OSharedContext> |
sharedContexts |
protected Map<String,OAbstractPaginatedStorage> |
storages |
Constructor and Description |
---|
OrientDBEmbedded(String directoryPath,
OrientDBConfig configurations,
Orient orient) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
distributed, embedded, extract, fromUrl, fullSync, newOrientDB, remote
protected final Map<String,OAbstractPaginatedStorage> storages
protected final Map<String,OSharedContext> sharedContexts
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 OCachedDatabasePoolFactory cachedPoolFactory
protected final long maxWALSegmentSize
protected final long doubleWriteLogMaxSegSize
public OrientDBEmbedded(String directoryPath, OrientDBConfig configurations, Orient orient)
protected OCachedDatabasePoolFactory createCachedDatabasePoolFactory(OrientDBConfig config)
public void initAutoClose(long delay)
public ODatabaseDocumentInternal open(String name, String user, String password)
OrientDBInternal
open
in interface OrientDBInternal
name
- 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 OrientDBInternal
protected ODatabaseDocumentEmbedded newSessionInstance(OAbstractPaginatedStorage storage)
public ODatabaseDocumentEmbedded openNoAuthorization(String name)
openNoAuthorization
in interface OrientDBInternal
public ODatabaseDocumentInternal open(String name, String user, String password, OrientDBConfig config)
OrientDBInternal
open
in interface OrientDBInternal
name
- 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)
OrientDBInternal
poolOpen
in interface OrientDBInternal
protected ODatabaseDocumentEmbedded newPooledSessionInstance(ODatabasePoolInternal pool, OAbstractPaginatedStorage storage)
protected OAbstractPaginatedStorage getOrInitStorage(String name)
protected final int generateStorageId()
public OAbstractPaginatedStorage getStorage(String name)
public void create(String name, String user, String password, ODatabaseType type)
OrientDBInternal
create
in interface OrientDBInternal
name
- 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)
OrientDBInternal
create
in interface OrientDBInternal
name
- 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 networkRestore(String name, InputStream in, Callable<Object> callable)
networkRestore
in interface OrientDBInternal
public void restore(String name, String user, String password, ODatabaseType type, String path, OrientDBConfig config)
restore
in interface OrientDBInternal
public void restore(String name, InputStream in, Map<String,Object> options, Callable<Object> callable, OCommandOutputListener iListener)
restore
in interface OrientDBInternal
protected ODatabaseDocumentEmbedded internalCreate(OrientDBConfig config, OAbstractPaginatedStorage storage)
protected OSharedContext getOrCreateSharedContext(OAbstractPaginatedStorage storage)
protected OSharedContext createSharedContext(OAbstractPaginatedStorage storage)
public boolean exists(String name, String user, String password)
OrientDBInternal
exists
in interface OrientDBInternal
name
- 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)
OrientDBInternal
drop
in interface OrientDBInternal
name
- 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)
OrientDBInternal
listDatabases
in interface OrientDBInternal
user
- 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 OrientDBInternal
public ODatabasePoolInternal openPool(String name, String user, String password)
OrientDBInternal
openPool
in interface OrientDBInternal
name
- 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)
OrientDBInternal
openPool
in interface OrientDBInternal
name
- 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 ODatabasePoolInternal cachedPool(String database, String user, String password)
cachedPool
in interface OrientDBInternal
public ODatabasePoolInternal cachedPool(String database, String user, String password, OrientDBConfig config)
cachedPool
in interface OrientDBInternal
public void close()
OrientDBInternal
close
in interface OrientDBInternal
close
in interface AutoCloseable
public void internalClose()
OrientDBInternal
internalClose
in interface OrientDBInternal
public OrientDBConfig getConfigurations()
public void removePool(ODatabasePoolInternal pool)
OrientDBInternal
removePool
in interface OrientDBInternal
public void initCustomStorage(String name, String path, String userName, String userPassword)
initCustomStorage
in interface OrientDBInternal
public void removeShutdownHook()
removeShutdownHook
in interface OrientDBInternal
public Collection<OStorage> getStorages()
getStorages
in interface OrientDBInternal
public void forceDatabaseClose(String iDatabaseName)
forceDatabaseClose
in interface OrientDBInternal
protected void checkOpen()
public boolean isOpen()
OrientDBInternal
isOpen
in interface OrientDBInternal
public boolean isEmbedded()
isEmbedded
in interface OrientDBInternal
public void schedule(TimerTask task, long delay, long period)
schedule
in interface OSchedulerInternal
public void scheduleOnce(TimerTask task, long delay)
scheduleOnce
in interface OSchedulerInternal
public <X> Future<X> execute(String database, String user, ODatabaseTask<X> task)
execute
in interface OrientDBInternal
public <X> Future<X> executeNoAuthorization(String database, ODatabaseTask<X> task)
executeNoAuthorization
in interface OrientDBInternal
public OScriptManager getScriptManager()
getScriptManager
in interface OrientDBInternal
Copyright © 2009–2020 OrientDB. All rights reserved.