public class Persistence extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
Persistence.DatabaseSetupEvent |
static class |
Persistence.Status |
| Modifier and Type | Field and Description |
|---|---|
static String |
APP_MODEL_DIRECTORY |
static String |
APP_MODEL_FILE
Deprecated.
|
protected org.apache.commons.vfs2.FileObject |
applicationDirectory |
com.manydesigns.portofino.cache.CacheResetListenerRegistry |
cacheResetListenerRegistry |
static String |
changelogFileNameTemplate |
protected com.manydesigns.portofino.config.ConfigurationSource |
configuration |
static String |
copyright |
protected com.manydesigns.portofino.model.database.platforms.DatabasePlatformsRegistry |
databasePlatformsRegistry |
io.reactivex.subjects.PublishSubject<Persistence.DatabaseSetupEvent> |
databaseSetupEvents |
static String |
LIQUIBASE_CONTEXT |
static org.slf4j.Logger |
logger |
protected com.manydesigns.portofino.model.Model |
model |
protected MultiTenancyImplementationFactory |
multiTenancyImplementationFactory |
protected Map<String,HibernateDatabaseSetup> |
setups |
io.reactivex.subjects.BehaviorSubject<Persistence.Status> |
status |
| Constructor and Description |
|---|
Persistence(org.apache.commons.vfs2.FileObject applicationDirectory,
com.manydesigns.portofino.config.ConfigurationSource configuration,
com.manydesigns.portofino.model.database.platforms.DatabasePlatformsRegistry databasePlatformsRegistry) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
closeSession(HibernateDatabaseSetup current) |
void |
closeSession(String databaseName) |
void |
closeSessions() |
JAXBContext |
createModelJAXBContext() |
protected void |
deleteUnusedDatabaseDirectories()
Delete the directories of the databases that are no longer present in the model
|
protected void |
deleteUnusedSchemaDirectories(com.manydesigns.portofino.model.database.Database database,
org.apache.commons.vfs2.FileObject databaseDir)
Delete the directories of the schemas that are no longer present in the model
|
protected HibernateDatabaseSetup |
ensureDatabaseSetup(String databaseName) |
org.apache.commons.vfs2.FileObject |
getApplicationDirectory() |
org.apache.commons.vfs2.FileObject |
getAppModelFile()
Deprecated.
|
com.manydesigns.portofino.config.ConfigurationSource |
getConfiguration() |
com.manydesigns.portofino.model.database.ConnectionProvider |
getConnectionProvider(String databaseName) |
com.manydesigns.portofino.model.database.platforms.DatabasePlatformsRegistry |
getDatabasePlatformsRegistry() |
HibernateDatabaseSetup |
getDatabaseSetup(String databaseName) |
org.apache.commons.vfs2.FileObject |
getLiquibaseChangelogFile(com.manydesigns.portofino.model.database.Schema schema) |
com.manydesigns.portofino.model.Model |
getModel() |
org.apache.commons.vfs2.FileObject |
getModelDirectory() |
org.apache.commons.vfs2.FileObject |
getModelFile()
Deprecated.
|
protected MultiTenancyImplementation |
getMultiTenancyImplementation(com.manydesigns.portofino.model.database.Database database) |
MultiTenancyImplementationFactory |
getMultiTenancyImplementationFactory() |
String |
getName()
Deprecated.
|
Session |
getSession(String databaseName) |
TableAccessor |
getTableAccessor(String databaseName,
String entityName) |
TableAccessor |
getTableAccessor(com.manydesigns.portofino.model.database.Table table) |
protected void |
initConnectionProvider(com.manydesigns.portofino.model.database.Database database) |
void |
initModel() |
protected void |
loadXmlDatabase(Unmarshaller um,
com.manydesigns.portofino.model.Model model,
org.apache.commons.vfs2.FileObject databaseDir) |
void |
loadXmlModel() |
void |
retryFailedConnections() |
void |
runLiquibase(com.manydesigns.portofino.model.database.Database database) |
void |
saveXmlModel() |
void |
setMultiTenancyImplementationFactory(MultiTenancyImplementationFactory multiTenancyImplementationFactory) |
void |
start() |
void |
stop() |
void |
syncDataModel(String databaseName) |
public static final String copyright
public static final String APP_MODEL_DIRECTORY
@Deprecated public static final String APP_MODEL_FILE
public static final String LIQUIBASE_CONTEXT
public static final String changelogFileNameTemplate
protected final com.manydesigns.portofino.model.database.platforms.DatabasePlatformsRegistry databasePlatformsRegistry
protected com.manydesigns.portofino.model.Model model
protected final Map<String,HibernateDatabaseSetup> setups
protected final org.apache.commons.vfs2.FileObject applicationDirectory
protected final com.manydesigns.portofino.config.ConfigurationSource configuration
@Autowired protected MultiTenancyImplementationFactory multiTenancyImplementationFactory
public final io.reactivex.subjects.BehaviorSubject<Persistence.Status> status
public final io.reactivex.subjects.PublishSubject<Persistence.DatabaseSetupEvent> databaseSetupEvents
public com.manydesigns.portofino.cache.CacheResetListenerRegistry cacheResetListenerRegistry
public static final org.slf4j.Logger logger
public Persistence(org.apache.commons.vfs2.FileObject applicationDirectory,
com.manydesigns.portofino.config.ConfigurationSource configuration,
com.manydesigns.portofino.model.database.platforms.DatabasePlatformsRegistry databasePlatformsRegistry)
throws org.apache.commons.vfs2.FileSystemException
org.apache.commons.vfs2.FileSystemExceptionpublic void loadXmlModel()
public JAXBContext createModelJAXBContext() throws JAXBException
JAXBExceptionprotected void loadXmlDatabase(Unmarshaller um, com.manydesigns.portofino.model.Model model, org.apache.commons.vfs2.FileObject databaseDir) throws IOException, JAXBException
IOExceptionJAXBException@Deprecated public org.apache.commons.vfs2.FileObject getModelFile() throws org.apache.commons.vfs2.FileSystemException
org.apache.commons.vfs2.FileSystemExceptionpublic org.apache.commons.vfs2.FileObject getModelDirectory()
throws org.apache.commons.vfs2.FileSystemException
org.apache.commons.vfs2.FileSystemExceptionpublic void runLiquibase(com.manydesigns.portofino.model.database.Database database)
public void saveXmlModel()
throws IOException,
JAXBException,
ConfigurationException
protected void deleteUnusedDatabaseDirectories()
throws org.apache.commons.vfs2.FileSystemException
org.apache.commons.vfs2.FileSystemException - if the schema directories cannot be listed.protected void deleteUnusedSchemaDirectories(com.manydesigns.portofino.model.database.Database database,
org.apache.commons.vfs2.FileObject databaseDir)
throws org.apache.commons.vfs2.FileSystemException
database - the parent database containing the schemasdatabaseDir - the database directoryorg.apache.commons.vfs2.FileSystemException - if the schema directories cannot be listed.public void initModel()
protected void initConnectionProvider(com.manydesigns.portofino.model.database.Database database)
protected MultiTenancyImplementation getMultiTenancyImplementation(com.manydesigns.portofino.model.database.Database database)
public void retryFailedConnections()
public com.manydesigns.portofino.model.database.ConnectionProvider getConnectionProvider(String databaseName)
public com.manydesigns.portofino.config.ConfigurationSource getConfiguration()
public com.manydesigns.portofino.model.database.platforms.DatabasePlatformsRegistry getDatabasePlatformsRegistry()
public com.manydesigns.portofino.model.Model getModel()
protected HibernateDatabaseSetup ensureDatabaseSetup(String databaseName)
public HibernateDatabaseSetup getDatabaseSetup(String databaseName)
public void closeSessions()
public void closeSession(String databaseName)
protected void closeSession(HibernateDatabaseSetup current)
@NotNull public TableAccessor getTableAccessor(String databaseName, String entityName)
@NotNull public TableAccessor getTableAccessor(com.manydesigns.portofino.model.database.Table table)
public void start()
public void stop()
@Deprecated public String getName()
public org.apache.commons.vfs2.FileObject getLiquibaseChangelogFile(com.manydesigns.portofino.model.database.Schema schema)
throws org.apache.commons.vfs2.FileSystemException
org.apache.commons.vfs2.FileSystemException@Deprecated public org.apache.commons.vfs2.FileObject getAppModelFile()
public org.apache.commons.vfs2.FileObject getApplicationDirectory()
public MultiTenancyImplementationFactory getMultiTenancyImplementationFactory()
public void setMultiTenancyImplementationFactory(MultiTenancyImplementationFactory multiTenancyImplementationFactory)
Copyright © 2022 MANYDESIGNS s.r.l.. All rights reserved.