Class OrientDBEmbedded
java.lang.Object
com.orientechnologies.orient.core.db.OrientDBEmbedded
- All Implemented Interfaces:
OrientDBInternal,OSchedulerInternal,AutoCloseable
- Direct Known Subclasses:
OrientDBDistributed
Created by tglman on 08/04/16.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Stringprotected final OCachedDatabasePoolFactoryprotected final OrientDBConfigprotected final AtomicIntegerprotected final Orientprotected final Set<ODatabasePoolInternal>protected final Map<String,OSharedContext> -
Constructor Summary
ConstructorsConstructorDescriptionOrientDBEmbedded(String directoryPath, OrientDBConfig configurations, Orient orient) -
Method Summary
Modifier and TypeMethodDescriptionprotected StringcachedPool(String database, String user, String password) cachedPool(String database, String user, String password, OrientDBConfig config) protected voidvoidclose()Close the factory with all related databases and pools.voidcreate(String name, String user, String password, ODatabaseType type) Create a new databasevoidcreate(String name, String user, String password, ODatabaseType type, OrientDBConfig config) Create a new databasevoidcreate(String name, String user, String password, ODatabaseType type, OrientDBConfig config, ODatabaseTask<Void> createOps) protected OCachedDatabasePoolFactoryprotected OSharedContextcreateSharedContext(OStorage storage) voidDrop a databasevoidFuture<?><X> Future<X>execute(String database, String user, ODatabaseTask<X> task) <X> Future<X><X> Future<X>executeNoAuthorization(String database, ODatabaseTask<X> task) <X> Future<X>executeNoDb(Callable<X> callable) executeServerStatement(String script, String username, String pw, Object... args) booleanCheck if a database existsvoidforceDatabaseClose(String iDatabaseName) protected OStoragegetAndOpenStorage(String name, OrientDBConfig config) getDatabasePath(String iDatabaseName) protected OSharedContextgetOrCreateSharedContext(OStorage storage) getStorage(String name) voidinitAutoClose(long delay) voidinitCustomStorage(String name, String path, String userName, String userPassword) protected voidvoidShould be called only by shutdown listenersprotected ODatabaseDocumentEmbeddedinternalCreate(OrientDBConfig config, OStorage storage) voidinternalDrop(String database) booleanbooleanbooleanisOpen()Check if the current instance is openlistDatabases(String user, String password) List of database exiting in the current environmentvoidvoidnetworkRestore(String name, InputStream in, Callable<Object> callable) protected ODatabaseDocumentEmbeddednewCreateSessionInstance(OStorage storage, OrientDBConfig config) protected ODatabaseDocumentEmbeddednewPooledSessionInstance(ODatabasePoolInternal pool, OStorage storage, OSharedContext sharedContext) protected ODatabaseDocumentEmbeddednewSessionInstance(OStorage storage, OrientDBConfig config) open(OAuthenticationInfo authenticationInfo, OrientDBConfig config) Open a database specified by name using the authentication info provided, with specific configurationOpen a database specified by name using the username and password if neededopen(String name, String user, String password, OrientDBConfig config) Open a database specified by name using the username and password if needed, with specific configurationopenNoAuthenticate(String name, String user) openNoAuthorization(String name) Open a pool of databases, similar to open but with multiple instances.openPool(String name, String user, String password, OrientDBConfig config) Open a pool of databases, similar to open but with multiple instances.poolOpen(String name, String user, String password, ODatabasePoolInternal pool) Internal api for request to open a database with a poolvoidpreClose()voidInternal API for pool closevoidvoidrestore(String name, InputStream in, Map<String, Object> options, Callable<Object> callable, OCommandOutputListener iListener) voidrestore(String name, String user, String password, ODatabaseType type, String path, OrientDBConfig config) voidvoidscheduleOnce(TimerTask task, long delay) protected OrientDBConfigsolveConfig(OrientDBConfig config) voidstartCommand(Optional<Long> timeout) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.orientechnologies.orient.core.db.OrientDBInternal
deltaSync, distributedSetOnline, fullSync, newNetworkMessage, newOrientDB, newOrientDBNoClose
-
Field Details
-
storages
-
pools
-
configurations
-
basePath
-
orient
-
cachedPoolFactory
-
dbCount
-
-
Constructor Details
-
OrientDBEmbedded
-
-
Method Details
-
initEngines
protected void initEngines() -
getEngine
-
getDefaultEngine
-
createCachedDatabasePoolFactory
-
initAutoClose
public void initAutoClose(long delay) -
open
Description copied from interface:OrientDBInternalOpen a database specified by name using the username and password if needed- Specified by:
openin interfaceOrientDBInternal- Parameters:
name- of the database to openuser- the username allowed to open the databasepassword- related to the specified username- Returns:
- the opened database
-
openNoAuthenticate
- Specified by:
openNoAuthenticatein interfaceOrientDBInternal
-
newSessionInstance
-
newCreateSessionInstance
protected ODatabaseDocumentEmbedded newCreateSessionInstance(OStorage storage, OrientDBConfig config) -
openNoAuthorization
- Specified by:
openNoAuthorizationin interfaceOrientDBInternal
-
open
public ODatabaseDocumentInternal open(String name, String user, String password, OrientDBConfig config) Description copied from interface:OrientDBInternalOpen a database specified by name using the username and password if needed, with specific configuration- Specified by:
openin interfaceOrientDBInternal- Parameters:
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.- Returns:
- the opened database
-
open
public ODatabaseDocumentInternal open(OAuthenticationInfo authenticationInfo, OrientDBConfig config) Description copied from interface:OrientDBInternalOpen a database specified by name using the authentication info provided, with specific configuration- Specified by:
openin interfaceOrientDBInternal- Parameters:
authenticationInfo- authentication informations provided for the authentication.config- database specific configuration that override the factory global settings where needed.- Returns:
- the opened database
-
getAndOpenStorage
-
solveConfig
-
poolOpen
public ODatabaseDocumentInternal poolOpen(String name, String user, String password, ODatabasePoolInternal pool) Description copied from interface:OrientDBInternalInternal api for request to open a database with a pool- Specified by:
poolOpenin interfaceOrientDBInternal
-
getStorage
-
buildName
-
create
Description copied from interface:OrientDBInternalCreate a new database- Specified by:
createin interfaceOrientDBInternal- Parameters:
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 memory
-
create
public void create(String name, String user, String password, ODatabaseType type, OrientDBConfig config) Description copied from interface:OrientDBInternalCreate a new database- Specified by:
createin interfaceOrientDBInternal- Parameters:
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.
-
create
public void create(String name, String user, String password, ODatabaseType type, OrientDBConfig config, ODatabaseTask<Void> createOps) - Specified by:
createin interfaceOrientDBInternal
-
networkRestore
- Specified by:
networkRestorein interfaceOrientDBInternal
-
restore
public void restore(String name, String user, String password, ODatabaseType type, String path, OrientDBConfig config) - Specified by:
restorein interfaceOrientDBInternal
-
restore
public void restore(String name, InputStream in, Map<String, Object> options, Callable<Object> callable, OCommandOutputListener iListener) - Specified by:
restorein interfaceOrientDBInternal
-
internalCreate
-
exists
Description copied from interface:OrientDBInternalCheck if a database exists- Specified by:
existsin interfaceOrientDBInternal- Parameters:
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 user- Returns:
- boolean true if exist false otherwise.
-
internalDrop
- Specified by:
internalDropin interfaceOrientDBInternal
-
drop
Description copied from interface:OrientDBInternalDrop a database- Specified by:
dropin interfaceOrientDBInternal- Parameters:
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 user
-
listDatabases
Description copied from interface:OrientDBInternalList of database exiting in the current environment- Specified by:
listDatabasesin interfaceOrientDBInternal- Parameters:
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 user- Returns:
- a set of databases names.
-
loadAllDatabases
public void loadAllDatabases()- Specified by:
loadAllDatabasesin interfaceOrientDBInternal
-
openPool
Description copied from interface:OrientDBInternalOpen a pool of databases, similar to open but with multiple instances.- Specified by:
openPoolin interfaceOrientDBInternal- Parameters:
name- database nameuser- the username allowed to open the databasepassword- the password relative to the user- Returns:
- a new pool of databases.
-
openPool
public ODatabasePoolInternal openPool(String name, String user, String password, OrientDBConfig config) Description copied from interface:OrientDBInternalOpen a pool of databases, similar to open but with multiple instances.- Specified by:
openPoolin interfaceOrientDBInternal- Parameters:
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.- Returns:
- a new pool of databases.
-
cachedPool
- Specified by:
cachedPoolin interfaceOrientDBInternal
-
cachedPool
public ODatabasePoolInternal cachedPool(String database, String user, String password, OrientDBConfig config) - Specified by:
cachedPoolin interfaceOrientDBInternal
-
close
public void close()Description copied from interface:OrientDBInternalClose the factory with all related databases and pools.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceOrientDBInternal
-
preClose
public void preClose() -
internalClose
public void internalClose()Description copied from interface:OrientDBInternalShould be called only by shutdown listeners- Specified by:
internalClosein interfaceOrientDBInternal
-
getConfigurations
- Specified by:
getConfigurationsin interfaceOrientDBInternal
-
removePool
Description copied from interface:OrientDBInternalInternal API for pool close- Specified by:
removePoolin interfaceOrientDBInternal
-
initCustomStorage
- Specified by:
initCustomStoragein interfaceOrientDBInternal
-
removeShutdownHook
public void removeShutdownHook()- Specified by:
removeShutdownHookin interfaceOrientDBInternal
-
getStorages
- Specified by:
getStoragesin interfaceOrientDBInternal
-
forceDatabaseClose
- Specified by:
forceDatabaseClosein interfaceOrientDBInternal
-
getDatabasePath
-
checkOpen
protected void checkOpen() -
isOpen
public boolean isOpen()Description copied from interface:OrientDBInternalCheck if the current instance is open- Specified by:
isOpenin interfaceOrientDBInternal
-
isEmbedded
public boolean isEmbedded()- Specified by:
isEmbeddedin interfaceOrientDBInternal
-
schedule
- Specified by:
schedulein interfaceOSchedulerInternal
-
scheduleOnce
- Specified by:
scheduleOncein interfaceOSchedulerInternal
-
execute
- Specified by:
executein interfaceOrientDBInternal
-
execute
- Specified by:
executein interfaceOrientDBInternal
-
execute
- Specified by:
executein interfaceOrientDBInternal
-
executeNoAuthorization
- Specified by:
executeNoAuthorizationin interfaceOrientDBInternal
-
executeNoDb
-
getScriptManager
- Specified by:
getScriptManagerin interfaceOrientDBInternal
-
executeServerStatement
public OResultSet executeServerStatement(String script, String username, String pw, Map<String, Object> args) - Specified by:
executeServerStatementin interfaceOrientDBInternal
-
executeServerStatement
- Specified by:
executeServerStatementin interfaceOrientDBInternal
-
getSystemDatabase
- Specified by:
getSystemDatabasein interfaceOrientDBInternal
-
getSecuritySystem
- Specified by:
getSecuritySystemin interfaceOrientDBInternal
-
getBasePath
- Specified by:
getBasePathin interfaceOrientDBInternal
-
isMemoryOnly
public boolean isMemoryOnly()- Specified by:
isMemoryOnlyin interfaceOrientDBInternal
-
listLodadedDatabases
- Specified by:
listLodadedDatabasesin interfaceOrientDBInternal
-
startCommand
- Specified by:
startCommandin interfaceOrientDBInternal
-
endCommand
public void endCommand()- Specified by:
endCommandin interfaceOrientDBInternal
-
getConnectionUrl
- Specified by:
getConnectionUrlin interfaceOrientDBInternal
-
getIoExecutor
-