|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.nuiton.topia.migration.ManualMigrationEngine
public class ManualMigrationEngine
TopiaMigrationServiceImpl.java Classe principale du projet.
| Field Summary | |
|---|---|
protected org.nuiton.util.Version |
applicationVersion
Version courante de l'application (initialise en pre-init) |
protected ManualMigrationCallback |
callback
CallbackHandler list (initialise en pre-init) |
protected org.nuiton.util.Version |
dbVersion
Version courante de la base (initialise en pre-init) |
protected boolean |
init
Un drapeau pour savoir si le service a bien ete initialise (i.e a bien fini la methode preInit) |
protected java.lang.String |
mappingsDirectory
Chemin du dossier contenant les schemas de toutes les versions (initialise en pre-init) |
static java.lang.String |
MIGRATION_APPLICATION_VERSION
La version de référence |
static java.lang.String |
MIGRATION_CALLBACK
L'unique handler a utiliser |
static java.lang.String |
MIGRATION_MAPPING_DIRECTORY
L'emplacement de tous les mappings |
static java.lang.String |
MIGRATION_MODEL_NAME
Les noms des modèles connus |
static java.lang.String |
MIGRATION_NO_MIGRATE_ON_INIT
Un drapeau pour indiquer si on ne doit pas lancer le service au demarrage |
protected boolean |
noMigrateOnInit
Un drapeau pour ne pas effectuer de migration au demarrage (initialise en pre-init) |
protected TopiaContextImplementor |
rootContext
topia root context (initialise en pre-init) |
protected org.hibernate.cfg.Configuration |
versionConfiguration
Configuration hibernate ne mappant que l'entite version (initialise en pre-init) |
protected java.util.SortedSet<org.nuiton.util.Version> |
versions
ensemble des versions connues par le service |
protected boolean |
versionTableExist
Un drapeau pour savoir si la table version existe en base (initialise en pre-init) |
| Fields inherited from interface org.nuiton.topia.migration.TopiaMigrationService |
|---|
SERVICE_NAME |
| Constructor Summary | |
|---|---|
ManualMigrationEngine()
|
|
| Method Summary | |
|---|---|
void |
beginTransaction(TopiaTransactionEvent event)
|
protected void |
checkInit()
|
protected org.nuiton.util.Version |
detectDbVersion()
Detecte la version de la base. |
protected java.util.List<org.nuiton.util.Version> |
detectVersions(java.util.SortedSet<org.nuiton.util.Version> versions,
org.nuiton.util.Version dbVersion,
org.nuiton.util.Version applicationVersion)
Filtre l'ensemble des versions, pour obtenir toutes les versions a migrer. |
void |
doMigrateSchema()
|
java.lang.Class<?>[] |
getPersistenceClasses()
|
java.lang.String |
getServiceName()
|
protected java.util.SortedSet<org.nuiton.util.Version> |
getVersions()
Recupere toutes les versions prises en charge par le service de migration. |
boolean |
migrateSchema()
|
void |
postCreateSchema(TopiaContextEvent event)
|
boolean |
postInit(TopiaContextImplementor context)
|
void |
postRestoreSchema(TopiaContextEvent event)
|
void |
postUpdateSchema(TopiaContextEvent event)
|
void |
preCreateSchema(TopiaContextEvent event)
|
boolean |
preInit(TopiaContextImplementor context)
|
void |
preRestoreSchema(TopiaContextEvent event)
|
void |
preUpdateSchema(TopiaContextEvent event)
|
void |
saveVersion(org.nuiton.util.Version version)
Enregistre la version donnee en base avec creation de la table si elle n'existe pas. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String MIGRATION_APPLICATION_VERSION
public static final java.lang.String MIGRATION_MAPPING_DIRECTORY
public static final java.lang.String MIGRATION_MODEL_NAME
public static final java.lang.String MIGRATION_CALLBACK
public static final java.lang.String MIGRATION_NO_MIGRATE_ON_INIT
protected org.hibernate.cfg.Configuration versionConfiguration
protected java.lang.String mappingsDirectory
protected java.util.SortedSet<org.nuiton.util.Version> versions
protected org.nuiton.util.Version applicationVersion
protected boolean versionTableExist
protected org.nuiton.util.Version dbVersion
protected boolean noMigrateOnInit
protected ManualMigrationCallback callback
protected TopiaContextImplementor rootContext
protected boolean init
| Constructor Detail |
|---|
public ManualMigrationEngine()
| Method Detail |
|---|
public java.lang.Class<?>[] getPersistenceClasses()
getPersistenceClasses in interface TopiaServicepublic java.lang.String getServiceName()
getServiceName in interface TopiaServicepublic boolean preInit(TopiaContextImplementor context)
preInit in interface TopiaServicepublic boolean postInit(TopiaContextImplementor context)
postInit in interface TopiaServicepublic void preCreateSchema(TopiaContextEvent event)
preCreateSchema in interface TopiaContextListenerpublic void preRestoreSchema(TopiaContextEvent event)
preRestoreSchema in interface TopiaContextListenerpublic void preUpdateSchema(TopiaContextEvent event)
preUpdateSchema in interface TopiaContextListenerpublic void postCreateSchema(TopiaContextEvent event)
postCreateSchema in interface TopiaContextListenerpublic void postUpdateSchema(TopiaContextEvent event)
postUpdateSchema in interface TopiaContextListenerpublic void postRestoreSchema(TopiaContextEvent event)
postRestoreSchema in interface TopiaContextListenerpublic void beginTransaction(TopiaTransactionEvent event)
beginTransaction in interface TopiaTransactionVetoable
public void doMigrateSchema()
throws MigrationServiceException
MigrationServiceException
public boolean migrateSchema()
throws MigrationServiceException
migrateSchema in interface TopiaMigrationServiceMigrationServiceExceptionpublic void saveVersion(org.nuiton.util.Version version)
version - la nouvelle version de la base
protected java.util.SortedSet<org.nuiton.util.Version> getVersions()
throws MigrationServiceException
MigrationServiceException - pour tout probleme
protected java.util.List<org.nuiton.util.Version> detectVersions(java.util.SortedSet<org.nuiton.util.Version> versions,
org.nuiton.util.Version dbVersion,
org.nuiton.util.Version applicationVersion)
versions - les versions a filtrerdbVersion - la version actuelapplicationVersion - la version a atteindre
protected org.nuiton.util.Version detectDbVersion()
throws MigrationServiceException
MigrationServiceExceptionprotected void checkInit()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||