Class DatabaseEnvironment
Configuration (the database section of "service.yaml" on the
classpath) is loaded once into static final fields the first time this class is
loaded. The same static initializer then calls initGraphDB(): if the configured
OrientDB database does not exist yet, it is created, Record-Level Security is enabled
(setRecordLevelSecurity(OMetadata)), and the administrative user/password are set up;
only in that case (created == true) does the initializer go on to create the
AdminEnvironment, QueryTemplateEnvironment, TypeEnvironment, and the
Context partition tree (ContextEnvironment parent, then its
LiveContextEnvironment and CemeteryContextEnvironment children — the parent
must exist first so hierarchical role propagation applies at child creation), and finally runs
IsModelBootstrap.bootstrap(boolean) to register every information-system-model
type. On every subsequent JVM start against an already-initialized database, none of that
one-time setup runs again.
- Author:
- Luca Frosini (ISTI - CNR)
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.orientechnologies.orient.client.remote.OStorageRemote.CONNECTION_STRATEGYThe connection strategy parameter to use.protected static final StringINI variable name for key algorithm.protected static final StringINI variable name for key file.static final StringThe database server URI.static final StringThe default administrative role name.static final Map<Environment.PermissionMode,String> Default passwords for the read/write database accounts.static final booleanWhether bootstrap Discovery scans packages contributed by externalRegistrationProviderSPI implementations (e.g.static final StringOrientDB standard Edge class name.static final StringOperator-declared name of the runtime model, the one holding the types created through REST (seeModelIdentityResolver).static final StringOrientDB standard Vertex class name. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidchangeDefaultAdminPassword(com.orientechnologies.orient.core.metadata.security.OSecurity oSecurity) Deprecated.This code must be removed for OrientDB versions higher than 3.2.Xstatic KeyReturns the initialized database cryptographic symmetric key.protected static KeyInitializes the database key.protected static voidsetDateTimeFormat(com.orientechnologies.orient.core.db.document.ODatabaseDocument oDatabaseDocument) Sets the datetime format attribute for the given database connection.protected static voidsetRecordLevelSecurity(com.orientechnologies.orient.core.metadata.OMetadata oMetadata) Deprecated.This code must be removed for OrientDB versions higher than 3.2.X
-
Field Details
-
DISCOVER_ALL_REGISTRATION_PROVIDERS
public static final boolean DISCOVER_ALL_REGISTRATION_PROVIDERSWhether bootstrap Discovery scans packages contributed by externalRegistrationProviderSPI implementations (e.g.gcube-model's), in addition toinformation-system-model's own intrinsic packages (always scanned regardless). Defaults tofalsewhen absent from "service.yaml" — harmless in production, where no such SPI-contributed provider is ever present on the classpath; test environments that rely on an external provider's types (e.g.gcube-model) must set this explicitly totrue. It also decides whether the domain provider identifies the model (ModelIdentityResolver) and whether a migration realigns its types. -
RUNTIME_MODEL_NAME
Operator-declared name of the runtime model, the one holding the types created through REST (seeModelIdentityResolver).nullwhen absent from "service.yaml": the resolver's default applies. -
DEFAULT_ADMIN_ROLE
The default administrative role name.- See Also:
-
DEFAULT_PASSWORDS
Default passwords for the read/write database accounts. -
DB_URI
The database server URI. -
CONNECTION_STRATEGY_PARAMETER
public static final com.orientechnologies.orient.client.remote.OStorageRemote.CONNECTION_STRATEGY CONNECTION_STRATEGY_PARAMETERThe connection strategy parameter to use. -
DB_KEY_FILENAME_VARNAME
INI variable name for key file.- See Also:
-
DB_KEY_ALGORITHM_VARNAME
INI variable name for key algorithm.- See Also:
-
VERTEX_CLASS_NAME
OrientDB standard Vertex class name.- See Also:
-
EDGE_CLASS_NAME
OrientDB standard Edge class name.- See Also:
-
-
Constructor Details
-
DatabaseEnvironment
public DatabaseEnvironment()
-
-
Method Details
-
initDbKey
Initializes the database key.- Parameters:
dbSection- the database section of the configuration profile- Returns:
- the initialized key
-
setDateTimeFormat
protected static void setDateTimeFormat(com.orientechnologies.orient.core.db.document.ODatabaseDocument oDatabaseDocument) Sets the datetime format attribute for the given database connection.- Parameters:
oDatabaseDocument- the OrientDB database connection
-
setRecordLevelSecurity
@Deprecated protected static void setRecordLevelSecurity(com.orientechnologies.orient.core.metadata.OMetadata oMetadata) Deprecated.This code must be removed for OrientDB versions higher than 3.2.XConfigures Record-Level Security (RLS) on Vertex and Edge classes.- Parameters:
oMetadata- the OrientDB schema metadata
-
getDatabaseKey
Returns the initialized database cryptographic symmetric key.- Returns:
- the symmetric database key
-
changeDefaultAdminPassword
@Deprecated public static void changeDefaultAdminPassword(com.orientechnologies.orient.core.metadata.security.OSecurity oSecurity) Deprecated.This code must be removed for OrientDB versions higher than 3.2.XChanges the default passwords for database administrative accounts.- Parameters:
oSecurity- the OrientDB security context
-