public class Schema extends Object implements sirius.kernel.Startable, sirius.kernel.di.Initializable
Constructor and Description |
---|
Schema() |
Modifier and Type | Method and Description |
---|---|
void |
computeRequiredSchemaChanges()
(Re-)Computes the changes required on the database schema to match the expectations of the software.
|
SchemaUpdateAction |
executeSchemaUpdateAction(String id)
Executes the schema change action with the given id.
|
Database |
getDatabase(String realm)
Provides the underlying database instance used to perform the actual statements.
|
int |
getPriority() |
sirius.kernel.async.Future |
getReadyFuture()
Provides a
Future which is fullfilled when then schema is fully initialized |
List<SchemaUpdateAction> |
getSchemaUpdateActions()
Lists the update actions which need to be performed on the current database to match the expectation of the
software.
|
void |
initialize() |
boolean |
isConfigured(String realm)
Determines if a JDBC database is configured for the given realm
|
void |
started() |
protected void |
updateSchemaAtStartup() |
@Nullable public Database getDatabase(String realm)
realm
- the realm to determine the database forpublic boolean isConfigured(String realm)
realm
- the realm to check forpublic sirius.kernel.async.Future getReadyFuture()
Future
which is fullfilled when then schema is fully initializedprotected void updateSchemaAtStartup()
public void computeRequiredSchemaChanges()
All non critical changes (new tables, new columns) are performed at system startup to prevent errors.
public List<SchemaUpdateAction> getSchemaUpdateActions()
@Nullable public SchemaUpdateAction executeSchemaUpdateAction(String id)
id
- the id of the action to executepublic int getPriority()
getPriority
in interface sirius.kernel.di.std.Priorized
getPriority
in interface sirius.kernel.Startable
public void started()
started
in interface sirius.kernel.Startable
Copyright © 2018. All rights reserved.